blob: a553aa21fe44efe2e97a2884e888899e7d631f9f [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001apt-manpages="doc/apt-cache.8 \
2 doc/apt-cdrom.8 \
3 doc/apt-config.8 \
4 doc/apt-get.8 \
5 doc/apt.8 \
6 doc/apt.conf.5 \
7 doc/apt_preferences.5 \
8 doc/sources.list.5"
9apt-utils-manpages="doc/apt-extracttemplates.1 \
10 doc/apt-sortpkgs.1"
11
12def get_files_apt_doc(d, bb, manpages):
13 import re
14 manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages)
15 manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages)
16 return manpages
17
18def get_commands_apt_doc(d, bb, manpages):
19 s = list()
20 __dir_cache__ = list()
21 for m in manpages.split():
22 dest = get_files_apt_doc(d, bb, m)
23 dir = os.path.dirname(dest)
24 if not dir in __dir_cache__:
25 s.append("install -d ${D}/%s" % dir)
26 __dir_cache__.append(dir)
27 s.append("install -m 0644 %s ${D}/%s" % (m, dest))
28 return "\n".join(s)
29
30PACKAGES += "${PN}-utils ${PN}-utils-doc"
31FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
32 ${bindir}/apt-config ${bindir}/apt-cache \
33 ${libdir}/apt ${libdir}/libapt*.so.* \
34 ${localstatedir} ${sysconfdir} \
35 ${libdir}/dpkg"
36FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
37FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
38 ${docdir}/apt"
39FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
40FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
41
42do_install () {
43 set -x
44 install -d ${D}${bindir}
45 install -m 0755 bin/apt-key ${D}${bindir}/
46 install -m 0755 bin/apt-cdrom ${D}${bindir}/
47 install -m 0755 bin/apt-get ${D}${bindir}/
48 install -m 0755 bin/apt-config ${D}${bindir}/
49 install -m 0755 bin/apt-cache ${D}${bindir}/
50
51 install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
52 install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
53
54 oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
55 oe_libinstall -so -C bin libapt-inst ${D}${libdir}
56
57 install -d ${D}${libdir}/apt/methods
58 install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
59
60 install -d ${D}${libdir}/dpkg/methods/apt
61 install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/
62 install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/
63 install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/
64 install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/
65 install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/
66
67 install -d ${D}${sysconfdir}/apt
68 install -d ${D}${sysconfdir}/apt/apt.conf.d
69 install -d ${D}${sysconfdir}/apt/sources.list.d
70 install -d ${D}${sysconfdir}/apt/preferences.d
71 install -d ${D}${localstatedir}/lib/apt/lists/partial
72 install -d ${D}${localstatedir}/cache/apt/archives/partial
73 install -d ${D}${docdir}/apt/examples
74 install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
75
76 install -d ${D}${includedir}/apt-pkg/
77 install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
78}