blob: 922f739d0d0a05edde2b5985e0f12d61b4762b45 [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} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050035 ${libdir}/dpkg \
36 ${systemd_unitdir}/system \
37 "
Brad Bishop08902b02019-08-20 09:16:51 -040038RDEPENDS_${PN} += "perl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages'))} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041 ${docdir}/apt"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050042FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages'))}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
44
Brad Bishop6e60e8b2018-02-01 10:27:11 -050045inherit systemd
46
47SYSTEMD_SERVICE_${PN} = "apt-daily.timer"
48
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049do_install () {
50 set -x
51 install -d ${D}${bindir}
52 install -m 0755 bin/apt-key ${D}${bindir}/
53 install -m 0755 bin/apt-cdrom ${D}${bindir}/
54 install -m 0755 bin/apt-get ${D}${bindir}/
55 install -m 0755 bin/apt-config ${D}${bindir}/
56 install -m 0755 bin/apt-cache ${D}${bindir}/
57
58 install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
59 install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
60
61 oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
62 oe_libinstall -so -C bin libapt-inst ${D}${libdir}
63
64 install -d ${D}${libdir}/apt/methods
65 install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
66
67 install -d ${D}${libdir}/dpkg/methods/apt
68 install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/
69 install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/
70 install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/
71 install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/
72 install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/
73
74 install -d ${D}${sysconfdir}/apt
75 install -d ${D}${sysconfdir}/apt/apt.conf.d
76 install -d ${D}${sysconfdir}/apt/sources.list.d
77 install -d ${D}${sysconfdir}/apt/preferences.d
78 install -d ${D}${localstatedir}/lib/apt/lists/partial
79 install -d ${D}${localstatedir}/cache/apt/archives/partial
80 install -d ${D}${docdir}/apt/examples
81 install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
82
83 install -d ${D}${includedir}/apt-pkg/
84 install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
Brad Bishop6e60e8b2018-02-01 10:27:11 -050085
86 install -d ${D}${systemd_unitdir}/system/
Brad Bishopf3fd2882019-06-21 08:06:37 -040087 install -m 0755 ${S}/debian/apt.systemd.daily ${D}${libdir}/apt/
Brad Bishop6e60e8b2018-02-01 10:27:11 -050088 install -m 0644 ${S}/debian/apt-daily.service ${D}${systemd_unitdir}/system/
89 sed -i 's#/usr/lib/apt/#${libdir}/apt/#g' ${D}${systemd_unitdir}/system/apt-daily.service
90 install -m 0644 ${S}/debian/apt-daily.timer ${D}${systemd_unitdir}/system/
91 install -d ${D}${sysconfdir}/cron.daily/
92 install -m 0755 ${S}/debian/apt.apt-compat.cron.daily ${D}${sysconfdir}/cron.daily/
93 sed -i 's#/usr/lib/apt/#${libdir}/apt/#g' ${D}${sysconfdir}/cron.daily/apt.apt-compat.cron.daily
Patrick Williamsc124f4f2015-09-15 14:41:29 -050094}