blob: 6a01f99c63f7b43646123c1c20a74cb709c467ca [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 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050039FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages'))} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040 ${docdir}/apt"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050041FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages'))}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
43
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044inherit systemd
45
46SYSTEMD_SERVICE_${PN} = "apt-daily.timer"
47
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048do_install () {
49 set -x
50 install -d ${D}${bindir}
51 install -m 0755 bin/apt-key ${D}${bindir}/
52 install -m 0755 bin/apt-cdrom ${D}${bindir}/
53 install -m 0755 bin/apt-get ${D}${bindir}/
54 install -m 0755 bin/apt-config ${D}${bindir}/
55 install -m 0755 bin/apt-cache ${D}${bindir}/
56
57 install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
58 install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
59
60 oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
61 oe_libinstall -so -C bin libapt-inst ${D}${libdir}
62
63 install -d ${D}${libdir}/apt/methods
64 install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
65
66 install -d ${D}${libdir}/dpkg/methods/apt
67 install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/
68 install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/
69 install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/
70 install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/
71 install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/
72
73 install -d ${D}${sysconfdir}/apt
74 install -d ${D}${sysconfdir}/apt/apt.conf.d
75 install -d ${D}${sysconfdir}/apt/sources.list.d
76 install -d ${D}${sysconfdir}/apt/preferences.d
77 install -d ${D}${localstatedir}/lib/apt/lists/partial
78 install -d ${D}${localstatedir}/cache/apt/archives/partial
79 install -d ${D}${docdir}/apt/examples
80 install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
81
82 install -d ${D}${includedir}/apt-pkg/
83 install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
Brad Bishop6e60e8b2018-02-01 10:27:11 -050084
85 install -d ${D}${systemd_unitdir}/system/
86 install -m 0644 ${S}/debian/apt.systemd.daily ${D}${libdir}/apt/
87 install -m 0644 ${S}/debian/apt-daily.service ${D}${systemd_unitdir}/system/
88 sed -i 's#/usr/lib/apt/#${libdir}/apt/#g' ${D}${systemd_unitdir}/system/apt-daily.service
89 install -m 0644 ${S}/debian/apt-daily.timer ${D}${systemd_unitdir}/system/
90 install -d ${D}${sysconfdir}/cron.daily/
91 install -m 0755 ${S}/debian/apt.apt-compat.cron.daily ${D}${sysconfdir}/cron.daily/
92 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 -050093}