Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require apt.inc |
| 2 | inherit native |
| 3 | |
| 4 | DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native" |
| 5 | PACKAGES = "" |
| 6 | USE_NLS = "yes" |
| 7 | |
| 8 | SRC_URI += "file://db_linking_hack.patch \ |
| 9 | file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | " |
| 11 | |
| 12 | python do_install () { |
| 13 | bb.build.exec_func('do_install_base', d) |
| 14 | bb.build.exec_func('do_install_config', d) |
| 15 | } |
| 16 | |
| 17 | python do_install_config () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | indir = os.path.dirname(d.getVar('FILE')) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 19 | infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 20 | data = infile.read() |
| 21 | infile.close() |
| 22 | |
| 23 | data = d.expand(data) |
| 24 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 25 | outdir = oe.path.join(d.getVar('D'), d.getVar('sysconfdir'), 'apt') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | if not os.path.exists(outdir): |
| 27 | os.makedirs(outdir) |
| 28 | |
| 29 | outpath = oe.path.join(outdir, 'apt.conf.sample') |
| 30 | if not os.path.exists(outpath): |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 31 | outfile = open(outpath, 'w') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | outfile.write(data) |
| 33 | outfile.close() |
| 34 | } |
| 35 | |
| 36 | do_install_base () { |
| 37 | install -d ${D}${bindir} |
| 38 | install -m 0755 bin/apt-cdrom ${D}${bindir}/ |
| 39 | install -m 0755 bin/apt-get ${D}${bindir}/ |
| 40 | install -m 0755 bin/apt-config ${D}${bindir}/ |
| 41 | install -m 0755 bin/apt-cache ${D}${bindir}/ |
| 42 | install -m 0755 bin/apt-sortpkgs ${D}${bindir}/ |
| 43 | install -m 0755 bin/apt-extracttemplates ${D}${bindir}/ |
| 44 | install -m 0755 bin/apt-ftparchive ${D}${bindir}/ |
| 45 | |
| 46 | oe_libinstall -so -C bin libapt-private ${D}${libdir}/ |
| 47 | |
| 48 | oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/ |
| 49 | oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/ |
| 50 | |
| 51 | install -d ${D}${libdir}/apt/methods |
| 52 | install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/ |
| 53 | |
| 54 | install -d ${D}${libdir}/dpkg/methods/apt |
| 55 | install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ |
| 56 | install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ |
| 57 | install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ |
| 58 | install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ |
| 59 | install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ |
| 60 | |
| 61 | install -d ${D}${sysconfdir}/apt |
| 62 | install -d ${D}${sysconfdir}/apt/apt.conf.d |
| 63 | install -d ${D}${sysconfdir}/apt/preferences.d |
| 64 | install -d ${D}${localstatedir}/lib/apt/lists/partial |
| 65 | install -d ${D}${localstatedir}/cache/apt/archives/partial |
| 66 | |
| 67 | install -d ${D}${localstatedir}/log/apt/ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 68 | |
| 69 | install -d ${D}${includedir}/apt-pkg |
| 70 | for h in `find ${S}/apt-pkg ${S}/apt-inst -name '*.h'` |
| 71 | do |
| 72 | install -m 0644 $h ${D}${includedir}/apt-pkg |
| 73 | done |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 74 | } |