Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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/sources.list.5" |
| 9 | apt-utils-manpages="doc/apt-extracttemplates.1 \ |
| 10 | doc/apt-sortpkgs.1" |
| 11 | |
| 12 | def 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 | |
| 18 | def 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 | |
| 30 | PACKAGES += "${PN}-utils ${PN}-utils-doc" |
| 31 | FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \ |
| 32 | ${bindir}/apt-config ${bindir}/apt-cache \ |
| 33 | ${libdir}/apt ${libdir}/libapt*.so.* \ |
| 34 | ${localstatedir} ${sysconfdir} \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 35 | ${libdir}/dpkg \ |
| 36 | ${systemd_unitdir}/system \ |
| 37 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 39 | FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages'))} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | ${docdir}/apt" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 41 | FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages'))}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}" |
| 43 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 44 | inherit systemd |
| 45 | |
| 46 | SYSTEMD_SERVICE_${PN} = "apt-daily.timer" |
| 47 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | do_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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 84 | |
| 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 93 | } |