blob: ef232c1eb6763250e7beb1f3dccc12dd364b4ef9 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require apt.inc
2inherit native
3
4DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
5PACKAGES = ""
6USE_NLS = "yes"
7
8SRC_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
14python do_install () {
15 bb.build.exec_func('do_install_base', d)
16 bb.build.exec_func('do_install_config', d)
17}
18
19python do_install_config () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050020 indir = os.path.dirname(d.getVar('FILE'))
Patrick Williamsc0f7c042017-02-23 20:41:17 -060021 infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022 data = infile.read()
23 infile.close()
24
25 data = d.expand(data)
26
Brad Bishop6e60e8b2018-02-01 10:27:11 -050027 outdir = oe.path.join(d.getVar('D'), d.getVar('sysconfdir'), 'apt')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028 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 Williamsc0f7c042017-02-23 20:41:17 -060033 outfile = open(outpath, 'w')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034 outfile.write(data)
35 outfile.close()
36}
37
38do_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 Bishop316dfdd2018-06-25 12:45:53 -040070
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 Williamsc124f4f2015-09-15 14:41:29 -050076}