blob: d826786329dc344da181d800f3c67684cd39c788 [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 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010"
11
12python do_install () {
13 bb.build.exec_func('do_install_base', d)
14 bb.build.exec_func('do_install_config', d)
15}
16
17python do_install_config () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018 indir = os.path.dirname(d.getVar('FILE'))
Patrick Williamsc0f7c042017-02-23 20:41:17 -060019 infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020 data = infile.read()
21 infile.close()
22
23 data = d.expand(data)
24
Brad Bishop6e60e8b2018-02-01 10:27:11 -050025 outdir = oe.path.join(d.getVar('D'), d.getVar('sysconfdir'), 'apt')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026 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 Williamsc0f7c042017-02-23 20:41:17 -060031 outfile = open(outpath, 'w')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032 outfile.write(data)
33 outfile.close()
34}
35
36do_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 Bishop316dfdd2018-06-25 12:45:53 -040068
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 Williamsc124f4f2015-09-15 14:41:29 -050074}