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