From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- .../apt-0.9.9.4/apt-0.9.9.4-CVE-2014-0478.patch | 193 +++++++++++++++++++++ .../disable-configure-in-makefile.patch | 18 ++ .../apt-0.9.9.4/fix-gcc-4.6-null-not-defined.patch | 12 ++ .../apt/apt-0.9.9.4/makerace.patch | 23 +++ .../apt/apt-0.9.9.4/no-ko-translation.patch | 11 ++ .../apt/apt-0.9.9.4/no-nls-dpkg.patch | 26 +++ .../apt/apt-0.9.9.4/noconfigure.patch | 36 ++++ meta/recipes-devtools/apt/apt-0.9.9.4/nodoc.patch | 18 ++ .../apt/apt-0.9.9.4/truncate-filename.patch | 35 ++++ .../apt/apt-0.9.9.4/use-host.patch | 15 ++ meta/recipes-devtools/apt/apt-native.inc | 68 ++++++++ meta/recipes-devtools/apt/apt-native_0.9.9.4.bb | 9 + meta/recipes-devtools/apt/apt-package.inc | 78 +++++++++ meta/recipes-devtools/apt/apt.inc | 38 ++++ meta/recipes-devtools/apt/apt_0.9.9.4.bb | 18 ++ meta/recipes-devtools/apt/files/apt.conf | 42 +++++ .../apt/files/db_linking_hack.patch | 29 ++++ meta/recipes-devtools/apt/files/environment.patch | 15 ++ meta/recipes-devtools/apt/files/no-curl.patch | 38 ++++ 19 files changed, 722 insertions(+) create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/apt-0.9.9.4-CVE-2014-0478.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/disable-configure-in-makefile.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/fix-gcc-4.6-null-not-defined.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/makerace.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/no-ko-translation.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/no-nls-dpkg.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/noconfigure.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/nodoc.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/truncate-filename.patch create mode 100644 meta/recipes-devtools/apt/apt-0.9.9.4/use-host.patch create mode 100644 meta/recipes-devtools/apt/apt-native.inc create mode 100644 meta/recipes-devtools/apt/apt-native_0.9.9.4.bb create mode 100644 meta/recipes-devtools/apt/apt-package.inc create mode 100644 meta/recipes-devtools/apt/apt.inc create mode 100644 meta/recipes-devtools/apt/apt_0.9.9.4.bb create mode 100644 meta/recipes-devtools/apt/files/apt.conf create mode 100644 meta/recipes-devtools/apt/files/db_linking_hack.patch create mode 100644 meta/recipes-devtools/apt/files/environment.patch create mode 100644 meta/recipes-devtools/apt/files/no-curl.patch (limited to 'meta/recipes-devtools/apt') diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/apt-0.9.9.4-CVE-2014-0478.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/apt-0.9.9.4-CVE-2014-0478.patch new file mode 100644 index 0000000000..79a6897572 --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/apt-0.9.9.4-CVE-2014-0478.patch @@ -0,0 +1,193 @@ +This patch comes from: +https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=73;filename=apt_0.9.7.9%2Bdeb7u2.debdiff;att=1;bug=749795 + +Upstream-Status: Backport + +Signed-off-by: Wenlin Kang +Signed-off-by: Chong Lu + +diff -uarN apt-0.9.9.4-org/cmdline/apt-get.cc apt-0.9.9.4/cmdline/apt-get.cc +--- apt-0.9.9.4-org/cmdline/apt-get.cc 2014-08-29 15:37:42.587156134 +0800 ++++ apt-0.9.9.4/cmdline/apt-get.cc 2014-08-29 15:51:16.672334086 +0800 +@@ -1046,25 +1046,8 @@ + return true; + } + /*}}}*/ +-// CheckAuth - check if each download comes form a trusted source /*{{{*/ +-// --------------------------------------------------------------------- +-/* */ +-static bool CheckAuth(pkgAcquire& Fetcher) ++static bool AuthPrompt(std::string UntrustedList, bool const PromptUser) + { +- string UntrustedList; +- for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I) +- { +- if (!(*I)->IsTrusted()) +- { +- UntrustedList += string((*I)->ShortDesc()) + " "; +- } +- } +- +- if (UntrustedList == "") +- { +- return true; +- } +- + ShowList(c2out,_("WARNING: The following packages cannot be authenticated!"),UntrustedList,""); + + if (_config->FindB("APT::Get::AllowUnauthenticated",false) == true) +@@ -1073,6 +1056,9 @@ + return true; + } + ++ if (PromptUser == false) ++ return _error->Error(_("Some packages could not be authenticated")); ++ + if (_config->FindI("quiet",0) < 2 + && _config->FindB("APT::Get::Assume-Yes",false) == false) + { +@@ -1090,6 +1076,28 @@ + return _error->Error(_("There are problems and -y was used without --force-yes")); + } + /*}}}*/ ++// CheckAuth - check if each download comes form a trusted source /*{{{*/ ++// --------------------------------------------------------------------- ++/* */ ++static bool CheckAuth(pkgAcquire& Fetcher, bool PromptUser=true) ++{ ++ string UntrustedList; ++ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I) ++ { ++ if (!(*I)->IsTrusted()) ++ { ++ UntrustedList += string((*I)->ShortDesc()) + " "; ++ } ++ } ++ ++ if (UntrustedList == "") ++ { ++ return true; ++ } ++ ++ return AuthPrompt(UntrustedList, PromptUser); ++} ++ + // InstallPackages - Actually download and install the packages /*{{{*/ + // --------------------------------------------------------------------- + /* This displays the informative messages describing what is going to +@@ -2482,6 +2490,7 @@ + + // Load the requestd sources into the fetcher + unsigned J = 0; ++ std::string UntrustedList; + for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++) + { + string Src; +@@ -2491,7 +2500,10 @@ + delete[] Dsc; + return _error->Error(_("Unable to find a source package for %s"),Src.c_str()); + } +- ++ ++ if (Last->Index().IsTrusted() == false) ++ UntrustedList += Src + " "; ++ + string srec = Last->AsStr(); + string::size_type pos = srec.find("\nVcs-"); + while (pos != string::npos) +@@ -2575,7 +2587,11 @@ + Last->Index().SourceInfo(*Last,*I),Src); + } + } +- ++ ++ // check authentication status of the source as well ++ if (UntrustedList != "" && !AuthPrompt(UntrustedList, false)) ++ return false; ++ + // Display statistics + unsigned long long FetchBytes = Fetcher.FetchNeeded(); + unsigned long long FetchPBytes = Fetcher.PartialPresent(); +diff -uarN apt-0.9.9.4-org/test/integration/framework apt-0.9.9.4/test/integration/framework +--- apt-0.9.9.4-org/test/integration/framework 2014-08-29 15:37:42.623156154 +0800 ++++ apt-0.9.9.4/test/integration/framework 2014-08-29 15:55:23.592197940 +0800 +@@ -151,7 +151,7 @@ + mkdir rootdir aptarchive keys + cd rootdir + mkdir -p etc/apt/apt.conf.d etc/apt/sources.list.d etc/apt/trusted.gpg.d etc/apt/preferences.d +- mkdir -p var/cache var/lib var/log ++ mkdir -p var/cache var/lib var/log tmp + mkdir -p var/lib/dpkg/info var/lib/dpkg/updates var/lib/dpkg/triggers + touch var/lib/dpkg/available + mkdir -p usr/lib/apt +@@ -910,3 +910,35 @@ + local IGNORE + read IGNORE + } ++ ++testsuccess() { ++ if [ "$1" = '--nomsg' ]; then ++ shift ++ else ++ msgtest 'Test for successful execution of' "$*" ++ fi ++ local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" ++ if $@ >${OUTPUT} 2>&1; then ++ msgpass ++ else ++ echo >&2 ++ cat >&2 $OUTPUT ++ msgfail ++ fi ++} ++ ++testfailure() { ++ if [ "$1" = '--nomsg' ]; then ++ shift ++ else ++ msgtest 'Test for failure in execution of' "$*" ++ fi ++ local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" ++ if $@ >${OUTPUT} 2>&1; then ++ echo >&2 ++ cat >&2 $OUTPUT ++ msgfail ++ else ++ msgpass ++ fi ++} +diff -uarN apt-0.9.9.4-org/test/integration/test-apt-get-source-authenticated apt-0.9.9.4/test/integration/test-apt-get-source-authenticated +--- apt-0.9.9.4-org/test/integration/test-apt-get-source-authenticated 1970-01-01 08:00:00.000000000 +0800 ++++ apt-0.9.9.4/test/integration/test-apt-get-source-authenticated 2014-08-29 15:58:06.137156796 +0800 +@@ -0,0 +1,31 @@ ++#!/bin/sh ++# ++# Regression test for debian bug #749795. Ensure that we fail with ++# a error if apt-get source foo will download a source that comes ++# from a unauthenticated repository ++# ++set -e ++ ++TESTDIR=$(readlink -f $(dirname $0)) ++. $TESTDIR/framework ++ ++setupenvironment ++configarchitecture "i386" ++ ++# a "normal" package with source and binary ++buildsimplenativepackage 'foo' 'all' '2.0' ++ ++setupaptarchive --no-update ++ ++APTARCHIVE=$(readlink -f ./aptarchive) ++rm -f $APTARCHIVE/dists/unstable/*Release* ++ ++# update without authenticated InRelease file ++testsuccess aptget update ++ ++# this all should fail ++testfailure aptget install -y foo ++testfailure aptget source foo ++ ++# allow overriding the warning ++testsuccess aptget source --allow-unauthenticated foo diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/disable-configure-in-makefile.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/disable-configure-in-makefile.patch new file mode 100644 index 0000000000..7c2f64e3e6 --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/disable-configure-in-makefile.patch @@ -0,0 +1,18 @@ +Disable configure at compilation stage + +Upstream-Status: Inappropriate [configuration] +Signed-off-by: Constantin Musca + +Index: apt-0.9.7.7/Makefile +=================================================================== +--- apt-0.9.7.7.orig/Makefile ++++ apt-0.9.7.7/Makefile +@@ -33,7 +33,7 @@ veryclean: clean + # The startup target builds the necessary configure scripts. It should + # be used after a CVS checkout. + CONVERTED=environment.mak include/config.h include/apti18n.h build/doc/Doxyfile makefile +-include buildlib/configure.mak ++#include buildlib/configure.mak + $(BUILDDIR)/include/config.h: buildlib/config.h.in + $(BUILDDIR)/include/apti18n.h: buildlib/apti18n.h.in + $(BUILDDIR)/environment.mak: buildlib/environment.mak.in diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/fix-gcc-4.6-null-not-defined.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/fix-gcc-4.6-null-not-defined.patch new file mode 100644 index 0000000000..801ae6dddb --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/fix-gcc-4.6-null-not-defined.patch @@ -0,0 +1,12 @@ +Upstream-Status: Pending + +--- a/apt-pkg/contrib/weakptr.h ++++ b/apt-pkg/contrib/weakptr.h +@@ -21,6 +21,7 @@ + #ifndef WEAK_POINTER_H + #define WEAK_POINTER_H + ++#include + #include + /** + * Class for objects providing support for weak pointers. diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/makerace.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/makerace.patch new file mode 100644 index 0000000000..46e3161b67 --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/makerace.patch @@ -0,0 +1,23 @@ +I was seeing various issues with parallel make, mainly due to to what was likely +partially installed headers. If you change into the source directory and +"NOISY=1 make ../obj/apt-pkg/sourcelist.opic" in apt-pkg, you'll see it +doesn't have any dependencies on the headers being installed. This patch +fixes that so things build correctly. + +RP 2012/3/19 + +Upstream-Status: Pending + +Index: apt-0.9.9.4/buildlib/library.mak +=================================================================== +--- apt-0.9.9.4.orig/buildlib/library.mak 2013-07-31 15:45:07.320440575 +0300 ++++ apt-0.9.9.4/buildlib/library.mak 2013-07-31 15:46:49.440440561 +0300 +@@ -61,7 +61,7 @@ + + # Compilation rules + vpath %.cc $(SUBDIRS) +-$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS) ++$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS) $($(LOCAL)-HEADERS) + echo Compiling $< to $@ + $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $< + $(DoDep) diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/no-ko-translation.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/no-ko-translation.patch new file mode 100644 index 0000000000..7aa408f19e --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/no-ko-translation.patch @@ -0,0 +1,11 @@ +Upstream-Status: Inappropriate [configuration] + +--- + po/LINGUAS | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/po/LINGUAS ++++ b/po/LINGUAS +@@ -1 +1 @@ +-ar ast bg bs ca cs cy da de dz el es eu fi fr gl hu it ja km ko ku lt mr nb ne nl nn pl pt pt_BR ro ru sk sl sv th tl uk vi zh_CN zh_TW ++ar ast bg bs ca cs cy da de dz el es eu fi fr gl hu it ja km ku lt mr nb ne nl nn pl pt pt_BR ro ru sk sl sv th tl uk vi zh_CN zh_TW diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/no-nls-dpkg.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/no-nls-dpkg.patch new file mode 100644 index 0000000000..a0996d4d44 --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/no-nls-dpkg.patch @@ -0,0 +1,26 @@ +Upstream-Status: Pending + +--- a/apt-pkg/deb/dpkgpm.cc ++++ b/apt-pkg/deb/dpkgpm.cc +@@ -42,6 +42,12 @@ + #include + /*}}}*/ + ++#ifdef USE_NLS ++#define _dpkg(x) dgettext("dpkg", x) ++#else ++#define _dpkg(x) x ++#endif ++ + using namespace std; + + namespace +@@ -1279,7 +1285,7 @@ void pkgDPkgPM::WriteApportReport(const + } + + // check if its not a follow up error +- const char *needle = dgettext("dpkg", "dependency problems - leaving unconfigured"); ++ const char *needle = _dpkg("dependency problems - leaving unconfigured"); + if(strstr(errormsg, needle) != NULL) { + std::clog << _("No apport report written because the error message indicates its a followup error from a previous failure.") << std::endl; + return; diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/noconfigure.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/noconfigure.patch new file mode 100644 index 0000000000..712d5e7296 --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/noconfigure.patch @@ -0,0 +1,36 @@ +Upstream-Status: Inappropriate [configuration] +Signed-off-by: Constantin Musca + +Index: apt-0.9.7.7/apt-pkg/packagemanager.cc +=================================================================== +--- apt-0.9.7.7.orig/apt-pkg/packagemanager.cc ++++ apt-0.9.7.7/apt-pkg/packagemanager.cc +@@ -893,10 +893,12 @@ bool pkgPackageManager::SmartUnPack(PkgI + return false; + + if (Immediate == true) { ++#if 0 + // Perform immedate configuration of the package. + if (SmartConfigure(Pkg, Depth + 1) == false) + _error->Warning(_("Could not perform immediate configuration on '%s'. " + "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.FullName().c_str(),2); ++#endif + } + + return true; +@@ -986,6 +988,7 @@ pkgPackageManager::OrderResult pkgPackag + } + } + ++#if 0 + // Final run through the configure phase + if (ConfigureAll() == false) + return Failed; +@@ -1000,6 +1003,7 @@ pkgPackageManager::OrderResult pkgPackag + return Failed; + } + } ++#endif + + return Completed; + } diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/nodoc.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/nodoc.patch new file mode 100644 index 0000000000..449e42df4a --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/nodoc.patch @@ -0,0 +1,18 @@ +Disable documentation + +Upstream-Status: Inappropriate [configuration] +Signed-off-by: Constantin Musca + +Index: apt-0.9.7.7/Makefile +=================================================================== +--- apt-0.9.7.7.orig/Makefile ++++ apt-0.9.7.7/Makefile +@@ -17,7 +17,7 @@ all headers library clean veryclean bina + $(MAKE) -C cmdline $@ + $(MAKE) -C ftparchive $@ + $(MAKE) -C dselect $@ +- $(MAKE) -C doc $@ ++# $(MAKE) -C doc $@ + $(MAKE) -C po $@ + $(MAKE) -C test $@ + diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/truncate-filename.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/truncate-filename.patch new file mode 100644 index 0000000000..db1c42b66c --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/truncate-filename.patch @@ -0,0 +1,35 @@ +strutl.cc: the filename can't be longer than 255 + +The URItoFileName translates the path into the filename, but the +filename can't be longer than 255 according to +/usr/include/linux/limits.h. + +Truncate it when it is longer than 240 (leave some spaces for +".Packages" and "._Release" suffix) + +Upstream-Status: Pending +Signed-off-by: Robert Yang +--- + apt-pkg/contrib/strutl.cc | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc +--- a/apt-pkg/contrib/strutl.cc ++++ b/apt-pkg/contrib/strutl.cc +@@ -399,7 +399,12 @@ string URItoFileName(const string &URI) + // "\x00-\x20{}|\\\\^\\[\\]<>\"\x7F-\xFF"; + string NewURI = QuoteString(U,"\\|{}[]<>\"^~_=!@#$%^&*"); + replace(NewURI.begin(),NewURI.end(),'/','_'); +- return NewURI; ++ ++ // Truncate from the head when it is longer than 240 ++ if(NewURI.length() > 240) ++ return NewURI.substr(NewURI.length() - 240, NewURI.length() - 1); ++ else ++ return NewURI; + } + /*}}}*/ + // Base64Encode - Base64 Encoding routine for short strings /*{{{*/ +-- +1.7.10.4 + diff --git a/meta/recipes-devtools/apt/apt-0.9.9.4/use-host.patch b/meta/recipes-devtools/apt/apt-0.9.9.4/use-host.patch new file mode 100644 index 0000000000..25caa3b0a5 --- /dev/null +++ b/meta/recipes-devtools/apt/apt-0.9.9.4/use-host.patch @@ -0,0 +1,15 @@ +Upstream-Status: Pending + +Index: apt-0.9.7.7/configure.in +=================================================================== +--- apt-0.9.7.7.orig/configure.in ++++ apt-0.9.7.7/configure.in +@@ -112,7 +112,7 @@ dnl This is often the dpkg architecture + dnl First check against the full canonical canoncial-system-type in $target + dnl and if that fails, just look for the cpu + AC_MSG_CHECKING(debian architecture) +-archset="`dpkg-architecture -qDEB_HOST_ARCH`" ++archset="`echo $host_alias|cut -d'-' -f1`" + if test "x$archset" = "x"; then + AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture]) + fi diff --git a/meta/recipes-devtools/apt/apt-native.inc b/meta/recipes-devtools/apt/apt-native.inc new file mode 100644 index 0000000000..fede8694c4 --- /dev/null +++ b/meta/recipes-devtools/apt/apt-native.inc @@ -0,0 +1,68 @@ +require apt.inc +inherit native + +DEPENDS += "dpkg-native gettext-native db-native curl-native" +PACKAGES = "" +USE_NLS = "yes" + +SRC_URI += "file://db_linking_hack.patch" + +python do_install () { + bb.build.exec_func('do_install_base', d) + bb.build.exec_func('do_install_config', d) +} + +python do_install_config () { + indir = os.path.dirname(d.getVar('FILE',1)) + infile = file(oe.path.join(indir, 'files', 'apt.conf'), 'r') + data = infile.read() + infile.close() + + data = d.expand(data) + + outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt') + if not os.path.exists(outdir): + os.makedirs(outdir) + + outpath = oe.path.join(outdir, 'apt.conf.sample') + if not os.path.exists(outpath): + outfile = file(outpath, 'w') + outfile.write(data) + outfile.close() +} + +do_install_base () { + install -d ${D}${bindir} + install -m 0755 bin/apt-cdrom ${D}${bindir}/ + install -m 0755 bin/apt-get ${D}${bindir}/ + install -m 0755 bin/apt-config ${D}${bindir}/ + install -m 0755 bin/apt-cache ${D}${bindir}/ + install -m 0755 bin/apt-sortpkgs ${D}${bindir}/ + install -m 0755 bin/apt-extracttemplates ${D}${bindir}/ + install -m 0755 bin/apt-ftparchive ${D}${bindir}/ + + eval `cat environment.mak | grep ^GLIBC_VER | sed -e's, = ,=,'` + eval `cat environment.mak | grep ^LIBSTDCPP_VER | sed -e's, = ,=,'` + oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/ + ln -sf libapt-pkg$GLIBC_VER$LIBSTDCPP_VER.so ${D}${libdir}/libapt-pkg.so + oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/ + ln -sf libapt-inst$GLIBC_VER$LIBSTDCPP_VER.so ${D}${libdir}/libapt-inst.so + + install -d ${D}${libdir}/apt/methods + install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/ + + install -d ${D}${libdir}/dpkg/methods/apt + install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ + install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ + + install -d ${D}${sysconfdir}/apt + install -d ${D}${sysconfdir}/apt/apt.conf.d + install -d ${D}${sysconfdir}/apt/preferences.d + install -d ${D}${localstatedir}/lib/apt/lists/partial + install -d ${D}${localstatedir}/cache/apt/archives/partial + + install -d ${D}${localstatedir}/log/apt/ +} diff --git a/meta/recipes-devtools/apt/apt-native_0.9.9.4.bb b/meta/recipes-devtools/apt/apt-native_0.9.9.4.bb new file mode 100644 index 0000000000..d5934f9942 --- /dev/null +++ b/meta/recipes-devtools/apt/apt-native_0.9.9.4.bb @@ -0,0 +1,9 @@ +require apt-native.inc + +SRC_URI += "file://noconfigure.patch \ + file://no-curl.patch" + +SRC_URI[md5sum] = "72b3283acd9b99868da5545f0499b0da" +SRC_URI[sha256sum] = "770cb94d7f4c922c2a1516f2b5ec852d3ad668a8c9c3713ac2528c861b7fa79a" + +LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3" diff --git a/meta/recipes-devtools/apt/apt-package.inc b/meta/recipes-devtools/apt/apt-package.inc new file mode 100644 index 0000000000..a553aa21fe --- /dev/null +++ b/meta/recipes-devtools/apt/apt-package.inc @@ -0,0 +1,78 @@ +apt-manpages="doc/apt-cache.8 \ + doc/apt-cdrom.8 \ + doc/apt-config.8 \ + doc/apt-get.8 \ + doc/apt.8 \ + doc/apt.conf.5 \ + doc/apt_preferences.5 \ + doc/sources.list.5" +apt-utils-manpages="doc/apt-extracttemplates.1 \ + doc/apt-sortpkgs.1" + +def get_files_apt_doc(d, bb, manpages): + import re + manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages) + manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages) + return manpages + +def get_commands_apt_doc(d, bb, manpages): + s = list() + __dir_cache__ = list() + for m in manpages.split(): + dest = get_files_apt_doc(d, bb, m) + dir = os.path.dirname(dest) + if not dir in __dir_cache__: + s.append("install -d ${D}/%s" % dir) + __dir_cache__.append(dir) + s.append("install -m 0644 %s ${D}/%s" % (m, dest)) + return "\n".join(s) + +PACKAGES += "${PN}-utils ${PN}-utils-doc" +FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \ + ${bindir}/apt-config ${bindir}/apt-cache \ + ${libdir}/apt ${libdir}/libapt*.so.* \ + ${localstatedir} ${sysconfdir} \ + ${libdir}/dpkg" +FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates" +FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \ + ${docdir}/apt" +FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}" +FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}" + +do_install () { + set -x + install -d ${D}${bindir} + install -m 0755 bin/apt-key ${D}${bindir}/ + install -m 0755 bin/apt-cdrom ${D}${bindir}/ + install -m 0755 bin/apt-get ${D}${bindir}/ + install -m 0755 bin/apt-config ${D}${bindir}/ + install -m 0755 bin/apt-cache ${D}${bindir}/ + + install -m 0755 bin/apt-sortpkgs ${D}${bindir}/ + install -m 0755 bin/apt-extracttemplates ${D}${bindir}/ + + oe_libinstall -so -C bin libapt-pkg ${D}${libdir} + oe_libinstall -so -C bin libapt-inst ${D}${libdir} + + install -d ${D}${libdir}/apt/methods + install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/ + + install -d ${D}${libdir}/dpkg/methods/apt + install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ + install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ + + install -d ${D}${sysconfdir}/apt + install -d ${D}${sysconfdir}/apt/apt.conf.d + install -d ${D}${sysconfdir}/apt/sources.list.d + install -d ${D}${sysconfdir}/apt/preferences.d + install -d ${D}${localstatedir}/lib/apt/lists/partial + install -d ${D}${localstatedir}/cache/apt/archives/partial + install -d ${D}${docdir}/apt/examples + install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/ + + install -d ${D}${includedir}/apt-pkg/ + install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/ +} diff --git a/meta/recipes-devtools/apt/apt.inc b/meta/recipes-devtools/apt/apt.inc new file mode 100644 index 0000000000..378021a327 --- /dev/null +++ b/meta/recipes-devtools/apt/apt.inc @@ -0,0 +1,38 @@ +SUMMARY = "Advanced front-end for dpkg" +LICENSE = "GPLv2.0+" +SECTION = "base" + +SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/apt_${PV}.tar.gz \ + file://no-ko-translation.patch \ + file://use-host.patch \ + file://makerace.patch \ + file://no-nls-dpkg.patch \ + file://fix-gcc-4.6-null-not-defined.patch \ + file://truncate-filename.patch \ + file://nodoc.patch \ + file://disable-configure-in-makefile.patch \ + file://apt-0.9.9.4-CVE-2014-0478.patch \ + " + +inherit autotools gettext + +EXTRA_AUTORECONF = "--exclude=autopoint,autoheader" + +do_configure_prepend() { + rm -rf ${S}/buildlib/config.sub + rm -rf ${S}/buildlib/config.guess +} + +# Apt wants to know the glibc version by running a binary file, which will +# fail, so we have to tell configure which version to use Since I don't know +# the impliations of setting a wrong value I only provide one for angstrom, +# which uses glibc 2.5 (which claims to be 2.4) +# Koen - 20070327 +EXTRA_OECONF_append_angstrom = " ac_cv_glibc_ver=libc6.4" + +# under Debian it is set to libc6.3 as they use glibc 2.3 +# They also provide glibc 2.5 in 'experimental' and it works with APT built +# for 2.3 so we set it in same way +EXTRA_OECONF_append = " ac_cv_glibc_ver=libc6.3" + +FILES_${PN}-dbg += "${libdir}/apt/methods/.debug/" diff --git a/meta/recipes-devtools/apt/apt_0.9.9.4.bb b/meta/recipes-devtools/apt/apt_0.9.9.4.bb new file mode 100644 index 0000000000..86ffe66ca4 --- /dev/null +++ b/meta/recipes-devtools/apt/apt_0.9.9.4.bb @@ -0,0 +1,18 @@ +DEPENDS = "curl db" +RDEPENDS_${PN} = "dpkg bash" +LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3" +require apt.inc + +SRC_URI[md5sum] = "72b3283acd9b99868da5545f0499b0da" +SRC_URI[sha256sum] = "770cb94d7f4c922c2a1516f2b5ec852d3ad668a8c9c3713ac2528c861b7fa79a" + +require apt-package.inc + +FILES_${PN} += "${bindir}/apt-key" +apt-manpages += "doc/apt-key.8" + +do_install_append() { + #Write the correct apt-architecture to apt.conf + APT_CONF=${D}/etc/apt/apt.conf + echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF} +} diff --git a/meta/recipes-devtools/apt/files/apt.conf b/meta/recipes-devtools/apt/files/apt.conf new file mode 100644 index 0000000000..03351356bc --- /dev/null +++ b/meta/recipes-devtools/apt/files/apt.conf @@ -0,0 +1,42 @@ +Dir "${STAGING_DIR_NATIVE}/" +{ + State "var/lib/apt/" + { + Lists "#APTCONF#/lists/"; + status "#ROOTFS#/var/lib/dpkg/status"; + }; + Cache "var/cache/apt/" + { + Archives "archives/"; + pkgcache ""; + srcpkgcache ""; + }; + Bin "${STAGING_BINDIR_NATIVE}/" + { + methods "${STAGING_LIBDIR}/apt/methods/"; + gzip "/bin/gzip"; + dpkg "dpkg"; + dpkg-source "dpkg-source"; + dpkg-buildpackage "dpkg-buildpackage"; + apt-get "apt-get"; + apt-cache "apt-cache"; + }; + Etc "#APTCONF#" + { + Preferences "preferences"; + }; +}; + +APT +{ + Install-Recommends "true"; + Immediate-Configure "false"; + Architecture "i586"; + Get + { + Assume-Yes "true"; + Force-Yes "true" + }; +}; + +DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"}; diff --git a/meta/recipes-devtools/apt/files/db_linking_hack.patch b/meta/recipes-devtools/apt/files/db_linking_hack.patch new file mode 100644 index 0000000000..d2246b3d2b --- /dev/null +++ b/meta/recipes-devtools/apt/files/db_linking_hack.patch @@ -0,0 +1,29 @@ +Upstream-Status: Backport + +Index: apt-0.7.3/configure.in +=================================================================== +--- apt-0.7.3.orig/configure.in 2007-07-01 10:38:45.000000000 +0000 ++++ apt-0.7.3/configure.in 2007-08-21 13:39:26.000000000 +0000 +@@ -67,8 +67,20 @@ + [AC_DEFINE(HAVE_BDB) + BDBLIB="-ldb" + AC_MSG_RESULT(yes)], +- [BDBLIB="" +- AC_MSG_RESULT(no)] ++ ++ LIBS="$LIBS -lpthread" ++ [AC_MSG_CHECKING(if we can link against BerkeleyDB with pthread) ++ AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM( ++ [#include ], ++ [int r, s, t; db_version(&r, &s, &t);] ++ )], ++ [AC_DEFINE(HAVE_BDB) ++ BDBLIB="-ldb -lpthread" ++ AC_MSG_RESULT(yes)], ++ [BDBLIB="" ++ AC_MSG_RESULT(no)] ++ )] + )] + ) + diff --git a/meta/recipes-devtools/apt/files/environment.patch b/meta/recipes-devtools/apt/files/environment.patch new file mode 100644 index 0000000000..9a0303803e --- /dev/null +++ b/meta/recipes-devtools/apt/files/environment.patch @@ -0,0 +1,15 @@ +Upstream-Status: Backport + +Index: apt-0.6.46.2/buildlib/environment.mak.in +=================================================================== +--- apt-0.6.46.2.orig/buildlib/environment.mak.in 2007-03-29 11:38:58.000000000 +0100 ++++ apt-0.6.46.2/buildlib/environment.mak.in 2007-03-29 11:39:12.000000000 +0100 +@@ -62,7 +62,7 @@ + + # Shared library things + HOST_OS = @host_os@ +-ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0) ++ifneq ($(words $(filter linux-gnu linux-gnueabi gnu% %gnu,$(HOST_OS))),0) + SONAME_MAGIC=-Wl,-soname -Wl, + LFLAGS_SO= + else diff --git a/meta/recipes-devtools/apt/files/no-curl.patch b/meta/recipes-devtools/apt/files/no-curl.patch new file mode 100644 index 0000000000..9fd3b3ab79 --- /dev/null +++ b/meta/recipes-devtools/apt/files/no-curl.patch @@ -0,0 +1,38 @@ +Upstream-Status: Inappropriate [configuration] + +--- + configure.in | 6 ------ + methods/makefile | 7 ------- + 2 files changed, 13 deletions(-) + +--- a/configure.in ++++ b/configure.in +@@ -86,12 +86,6 @@ AC_CHECK_HEADER(db.h, + + LIBS="$saveLIBS" + +-AC_CHECK_LIB(curl, curl_easy_init, +- [AC_CHECK_HEADER(curl/curl.h, +- curl_ok=yes, +- curl_ok=no)], +- AC_MSG_ERROR([failed: I need CURL due https support]), +-) + + AC_SUBST(BDBLIB) + +--- a/methods/makefile ++++ b/methods/makefile +@@ -51,13 +51,6 @@ LIB_MAKES = apt-pkg/makefile + SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc + include $(PROGRAM_H) + +-# The https method +-PROGRAM=https +-SLIBS = -lapt-pkg -lcurl $(INTLLIBS) +-LIB_MAKES = apt-pkg/makefile +-SOURCE = https.cc +-include $(PROGRAM_H) +- + # The ftp method + PROGRAM=ftp + SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -- cgit v1.2.3-54-g00ecf