summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt/apt-package.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/apt/apt-package.inc')
-rw-r--r--meta/recipes-devtools/apt/apt-package.inc77
1 files changed, 77 insertions, 0 deletions
diff --git a/meta/recipes-devtools/apt/apt-package.inc b/meta/recipes-devtools/apt/apt-package.inc
new file mode 100644
index 0000000..0897d3a
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt-package.inc
@@ -0,0 +1,77 @@
1apt-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-cdrom ${D}${bindir}/
46 install -m 0755 bin/apt-get ${D}${bindir}/
47 install -m 0755 bin/apt-config ${D}${bindir}/
48 install -m 0755 bin/apt-cache ${D}${bindir}/
49
50 install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
51 install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
52
53 oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
54 oe_libinstall -so -C bin libapt-inst ${D}${libdir}
55
56 install -d ${D}${libdir}/apt/methods
57 install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
58
59 install -d ${D}${libdir}/dpkg/methods/apt
60 install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/
61 install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/
62 install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/
63 install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/
64 install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/
65
66 install -d ${D}${sysconfdir}/apt
67 install -d ${D}${sysconfdir}/apt/apt.conf.d
68 install -d ${D}${sysconfdir}/apt/sources.list.d
69 install -d ${D}${sysconfdir}/apt/preferences.d
70 install -d ${D}${localstatedir}/lib/apt/lists/partial
71 install -d ${D}${localstatedir}/cache/apt/archives/partial
72 install -d ${D}${docdir}/apt/examples
73 install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
74
75 install -d ${D}${includedir}/apt-pkg/
76 install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
77}