diff options
Diffstat (limited to 'meta/packages/apt/apt-package.inc')
-rw-r--r-- | meta/packages/apt/apt-package.inc | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/meta/packages/apt/apt-package.inc b/meta/packages/apt/apt-package.inc new file mode 100644 index 0000000000..43f54cadab --- /dev/null +++ b/meta/packages/apt/apt-package.inc | |||
@@ -0,0 +1,101 @@ | |||
1 | apt-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/fr/apt-cache.fr.8 \ | ||
9 | doc/fr/apt-cdrom.fr.8 \ | ||
10 | doc/fr/apt-config.fr.8 \ | ||
11 | doc/fr/apt-get.fr.8 \ | ||
12 | doc/fr/apt.conf.fr.5 \ | ||
13 | doc/fr/apt_preferences.fr.5 \ | ||
14 | doc/fr/sources.list.fr.5 \ | ||
15 | doc/es/apt.es.8 \ | ||
16 | doc/es/apt-cache.es.8 \ | ||
17 | doc/es/apt-cdrom.es.8 \ | ||
18 | doc/es/apt-config.es.8 \ | ||
19 | doc/es/apt-get.es.8 \ | ||
20 | doc/es/apt.conf.es.5 \ | ||
21 | doc/es/apt_preferences.es.5 \ | ||
22 | doc/es/sources.list.es.5 \ | ||
23 | doc/pt_BR/apt_preferences.pt_BR.5 \ | ||
24 | doc/ja/apt-cache.ja.8 \ | ||
25 | doc/ja/apt-cdrom.ja.8 \ | ||
26 | doc/ja/apt-get.ja.8 \ | ||
27 | doc/ja/apt.conf.ja.5 \ | ||
28 | doc/sources.list.5" | ||
29 | apt-utils-manpages="doc/apt-extracttemplates.1 \ | ||
30 | doc/apt-sortpkgs.1 \ | ||
31 | doc/fr/apt-extracttemplates.fr.1 \ | ||
32 | doc/fr/apt-sortpkgs.fr.1" | ||
33 | # doc/fr/apt-ftparchive.fr.1 | ||
34 | # doc/apt-ftparchive.1 | ||
35 | |||
36 | def get_files_apt_doc(d, bb, manpages): | ||
37 | import re | ||
38 | manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages) | ||
39 | manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages) | ||
40 | return manpages | ||
41 | |||
42 | def get_commands_apt_doc(d, bb, manpages): | ||
43 | import os | ||
44 | s = list() | ||
45 | __dir_cache__ = list() | ||
46 | for m in manpages.split(): | ||
47 | dest = get_files_apt_doc(d, bb, m) | ||
48 | dir = os.path.dirname(dest) | ||
49 | if not dir in __dir_cache__: | ||
50 | s.append("install -d ${D}/%s" % dir) | ||
51 | __dir_cache__.append(dir) | ||
52 | s.append("install -m 0644 %s ${D}/%s" % (m, dest)) | ||
53 | return "\n".join(s) | ||
54 | |||
55 | PACKAGES += "${PN}-utils ${PN}-utils-doc" | ||
56 | FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \ | ||
57 | ${bindir}/apt-config ${bindir}/apt-cache \ | ||
58 | ${libdir}/apt ${libdir}/libapt*.so.* \ | ||
59 | ${localstatedir} ${sysconfdir} \ | ||
60 | ${libdir}/dpkg" | ||
61 | FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates" | ||
62 | FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, bb.data.getVar('apt-manpages', d, 1))} \ | ||
63 | ${docdir}/apt" | ||
64 | FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, bb.data.getVar('apt-utils-manpages', d, 1))}" | ||
65 | FILES_${PN}-dev = "${libdir}/libapt*.so" | ||
66 | |||
67 | do_install () { | ||
68 | set -x | ||
69 | ${@get_commands_apt_doc(d, bb, bb.data.getVar('apt-manpages', d, 1))} | ||
70 | ${@get_commands_apt_doc(d, bb, bb.data.getVar('apt-utils-manpages', d, 1))} | ||
71 | install -d ${D}${bindir} | ||
72 | install -m 0755 bin/apt-cdrom ${D}${bindir}/ | ||
73 | install -m 0755 bin/apt-get ${D}${bindir}/ | ||
74 | install -m 0755 bin/apt-config ${D}${bindir}/ | ||
75 | install -m 0755 bin/apt-cache ${D}${bindir}/ | ||
76 | |||
77 | install -m 0755 bin/apt-sortpkgs ${D}${bindir}/ | ||
78 | install -m 0755 bin/apt-extracttemplates ${D}${bindir}/ | ||
79 | |||
80 | eval `cat environment.mak | grep ^GLIBC_VER | sed -e's, = ,=,'` | ||
81 | oe_libinstall -so -C bin libapt-pkg$GLIBC_VER-6 ${D}${libdir}/ | ||
82 | ln -sf libapt-pkg$GLIBC_VER-6.so ${D}${libdir}/libapt-pkg.so | ||
83 | oe_libinstall -so -C bin libapt-inst$GLIBC_VER-6 ${D}${libdir}/ | ||
84 | ln -sf libapt-inst$GLIBC_VER-6.so ${D}${libdir}/libapt-inst.so | ||
85 | |||
86 | install -d ${D}${libdir}/apt/methods | ||
87 | install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/ | ||
88 | |||
89 | install -d ${D}${libdir}/dpkg/methods/apt | ||
90 | install -m 0644 dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ | ||
91 | install -m 0644 dselect/names ${D}${libdir}/dpkg/methods/apt/ | ||
92 | install -m 0755 dselect/install ${D}${libdir}/dpkg/methods/apt/ | ||
93 | install -m 0755 dselect/setup ${D}${libdir}/dpkg/methods/apt/ | ||
94 | install -m 0755 dselect/update ${D}${libdir}/dpkg/methods/apt/ | ||
95 | |||
96 | install -d ${D}${sysconfdir}/apt | ||
97 | install -d ${D}${localstatedir}/lib/apt/lists/partial | ||
98 | install -d ${D}${localstatedir}/cache/apt/archives/partial | ||
99 | install -d ${D}${docdir}/apt/examples | ||
100 | install -m 0644 doc/examples/* ${D}${docdir}/apt/examples/ | ||
101 | } | ||