From abfc1dbd73d59344564e7cc00754a259d2f2bc85 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 7 Sep 2006 20:46:06 +0000 Subject: Add apt & apt-native, including the generation of the apt.conf to be used for the rootfs population. git-svn-id: https://svn.o-hand.com/repos/poky/trunk@699 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/packages/apt/apt-0.6.45exp2/autofoo.patch | 84 ++++++++++++++++++++ meta/packages/apt/apt-0.6.45exp2/nodoc.patch | 15 ++++ meta/packages/apt/apt-native.inc | 57 ++++++++++++++ meta/packages/apt/apt-native_0.6.45exp2.bb | 3 + meta/packages/apt/apt-package.inc | 101 +++++++++++++++++++++++++ meta/packages/apt/apt.inc | 11 +++ meta/packages/apt/apt_0.6.45exp2.bb | 9 +++ meta/packages/apt/files/apt.conf | 24 ++++++ 8 files changed, 304 insertions(+) create mode 100644 meta/packages/apt/apt-0.6.45exp2/autofoo.patch create mode 100644 meta/packages/apt/apt-0.6.45exp2/nodoc.patch create mode 100644 meta/packages/apt/apt-native.inc create mode 100644 meta/packages/apt/apt-native_0.6.45exp2.bb create mode 100644 meta/packages/apt/apt-package.inc create mode 100644 meta/packages/apt/apt.inc create mode 100644 meta/packages/apt/apt_0.6.45exp2.bb create mode 100644 meta/packages/apt/files/apt.conf (limited to 'meta') diff --git a/meta/packages/apt/apt-0.6.45exp2/autofoo.patch b/meta/packages/apt/apt-0.6.45exp2/autofoo.patch new file mode 100644 index 000000000..74d787cef --- /dev/null +++ b/meta/packages/apt/apt-0.6.45exp2/autofoo.patch @@ -0,0 +1,84 @@ + +# +# Patch managed by http://www.holgerschurig.de/patcher.html +# + +--- + configure.in | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +--- apt-0.6.45exp2.orig/configure.in ++++ apt-0.6.45exp2/configure.in +@@ -18,9 +18,9 @@ AC_CONFIG_AUX_DIR(buildlib) + AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) + + dnl -- SET THIS TO THE RELEASE VERSION -- +-AC_DEFINE_UNQUOTED(VERSION,"0.6.45exp2") ++AC_DEFINE_UNQUOTED(VERSION,"0.6.45exp2",[package version]) + PACKAGE="apt" +-AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") ++AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE",[package name]) + AC_SUBST(PACKAGE) + + dnl Check the archs, we want the target type. +@@ -47,7 +47,7 @@ AC_SUBST(SOCKETLIBS) + LIBS="$SAVE_LIBS" + + dnl Checks for pthread -- disabled due to glibc bugs jgg +-dnl AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"]) ++dnl AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD, 1, [define if we have pthreads]) PTHREADLIB="-lpthread"]) + AC_SUBST(PTHREADLIB) + dnl if test "$PTHREADLIB" != "-lpthread"; then + dnl AC_MSG_ERROR(failed: I need posix threads, pthread) +@@ -84,14 +84,14 @@ if test "x$archset" = "x"; then + AC_MSG_ERROR(failed: use --host= or check buildlib/archtable) + fi + AC_MSG_RESULT($archset) +-AC_DEFINE_UNQUOTED(COMMON_CPU,"$archset") ++AC_DEFINE_UNQUOTED(COMMON_CPU,"$archset",[define to the system architecture]) + + dnl Get a common name for the host OS - this is primarily only for HURD and is + dnl non fatal if it fails + AC_MSG_CHECKING(system OS) + osset="`awk \" ! /^#|^\\\$/ {if (match(\\\"$target_vendor-$target_os\\\",\\\$1)) {print \\\$2; exit}}\" $srcdir/buildlib/ostable`" + AC_MSG_RESULT($osset) +-AC_DEFINE_UNQUOTED(COMMON_OS,"$osset") ++AC_DEFINE_UNQUOTED(COMMON_OS,"$osset",[define to the system OS]) + + dnl We use C99 types if at all possible + AC_CACHE_CHECK([for C99 integer types],c9x_ints,[ +@@ -105,13 +105,13 @@ AC_SUBST(HAVE_STATVFS) + + dnl Arg, linux and bsd put their statfs function in different places + if test x"$HAVE_STATVFS" != x"yes"; then +- AC_EGREP_HEADER(statfs,sys/vfs.h,[AC_DEFINE(HAVE_VFS_H)],[ +- AC_EGREP_HEADER(statfs,sys/mount.h,[AC_DEFINE(HAVE_MOUNT_H)],[AC_MSG_ERROR(failed: Need statvfs)]) ++ AC_EGREP_HEADER(statfs,sys/vfs.h,[AC_DEFINE(HAVE_VFS_H, 1, [define if statfs is in sys/vfs.h])],[ ++ AC_EGREP_HEADER(statfs,sys/mount.h,[AC_DEFINE(HAVE_MOUNT_H, 1, [define if statfs is in sys/mount.h])],[AC_MSG_ERROR(failed: Need statvfs)]) + ]) + fi + + dnl We should use the real timegm function if we have it. +-AC_CHECK_FUNC(timegm,AC_DEFINE(HAVE_TIMEGM)) ++AC_CHECK_FUNC(timegm,AC_DEFINE(HAVE_TIMEGM, 1, [define if we have timegm])) + AC_SUBST(HAVE_TIMEGM) + + dnl Check the sizes etc. of the architecture +@@ -157,7 +157,7 @@ fi + dnl HP-UX sux.. + AC_MSG_CHECKING(for missing socklen_t) + AC_EGREP_HEADER(socklen_t, sys/socket.h,[AC_MSG_RESULT(no)],[ +- AC_DEFINE(NEED_SOCKLEN_T_DEFINE) ++ AC_DEFINE(NEED_SOCKLEN_T_DEFINE, 1, [define if we need to define socklen_t]) + NEED_SOCKLEN_T_DEFINE=yes + AC_MSG_RESULT(missing.)]) + AC_SUBST(NEED_SOCKLEN_T_DEFINE) +@@ -204,7 +204,7 @@ dnl gettext approved makefiles, so this + ALL_LINGUAS="bg bs ca cs cy da de dz el en_GB es eu fi fr gl hu it ja ko nb nl nn pl pt_BR pt ro ru sk sl sv tl vi zn_CN zh_TW" + AM_GNU_GETTEXT(external) + if test x"$USE_NLS" = "xyes"; then +- AC_DEFINE(USE_NLS) ++ AC_DEFINE(USE_NLS, 1, [define if we have native language support]) + fi + AC_SUBST(USE_NLS) + AC_PATH_PROG(BASH, bash) diff --git a/meta/packages/apt/apt-0.6.45exp2/nodoc.patch b/meta/packages/apt/apt-0.6.45exp2/nodoc.patch new file mode 100644 index 000000000..910184718 --- /dev/null +++ b/meta/packages/apt/apt-0.6.45exp2/nodoc.patch @@ -0,0 +1,15 @@ +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- apt-0.6.45exp2.orig/Makefile ++++ apt-0.6.45exp2/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 $@ + + # Some very common aliases diff --git a/meta/packages/apt/apt-native.inc b/meta/packages/apt/apt-native.inc new file mode 100644 index 000000000..4ace9e94b --- /dev/null +++ b/meta/packages/apt/apt-native.inc @@ -0,0 +1,57 @@ +require apt.inc +inherit native + +DEPENDS += "dpkg-native" +FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/apt-${PV}" +PACKAGES = "" +USE_NLS = "no" + +python do_stage () { + bb.build.exec_func('do_stage_base', d) + bb.build.exec_func('do_stage_config', d) +} + +python do_stage_config () { + indir = os.path.dirname(bb.data.getVar('FILE',d,1)) + infile = file(os.path.join(indir, 'files', 'apt.conf'), 'r') + data = infile.read() + infile.close() + + data = bb.data.expand(data, d) + + outpath = bb.data.expand('${STAGING_DIR}/${sysconfdir}/apt.conf', d) + outfile = file(outpath, 'w') + outfile.write(data) + outfile.close() +} + +do_stage_base () { + install -d ${STAGING_BINDIR} + install -m 0755 bin/apt-cdrom ${STAGING_BINDIR}/ + install -m 0755 bin/apt-get ${STAGING_BINDIR}/ + install -m 0755 bin/apt-config ${STAGING_BINDIR}/ + install -m 0755 bin/apt-cache ${STAGING_BINDIR}/ + + install -m 0755 bin/apt-sortpkgs ${STAGING_BINDIR}/ + install -m 0755 bin/apt-extracttemplates ${STAGING_BINDIR}/ + + eval `cat environment.mak | grep ^GLIBC_VER | sed -e's, = ,=,'` + oe_libinstall -so -C bin libapt-pkg$GLIBC_VER-6 ${STAGING_LIBDIR}/ + ln -sf libapt-pkg$GLIBC_VER-6.so ${STAGING_LIBDIR}/libapt-pkg.so + oe_libinstall -so -C bin libapt-inst$GLIBC_VER-6 ${STAGING_LIBDIR}/ + ln -sf libapt-inst$GLIBC_VER-6.so ${STAGING_LIBDIR}/libapt-inst.so + + install -d ${STAGING_LIBDIR}/apt/methods + install -m 0755 bin/methods/* ${STAGING_LIBDIR}/apt/methods/ + + install -d ${STAGING_LIBDIR}/dpkg/methods/apt + install -m 0644 dselect/desc.apt ${STAGING_LIBDIR}/dpkg/methods/apt/ + install -m 0644 dselect/names ${STAGING_LIBDIR}/dpkg/methods/apt/ + install -m 0755 dselect/install ${STAGING_LIBDIR}/dpkg/methods/apt/ + install -m 0755 dselect/setup ${STAGING_LIBDIR}/dpkg/methods/apt/ + install -m 0755 dselect/update ${STAGING_LIBDIR}/dpkg/methods/apt/ + + install -d ${STAGING_DIR}${sysconfdir}/apt + install -d ${STAGING_DIR}${localstatedir}/lib/apt/lists/partial + install -d ${STAGING_DIR}${localstatedir}/cache/apt/archives/partial +} diff --git a/meta/packages/apt/apt-native_0.6.45exp2.bb b/meta/packages/apt/apt-native_0.6.45exp2.bb new file mode 100644 index 000000000..32f19e8e4 --- /dev/null +++ b/meta/packages/apt/apt-native_0.6.45exp2.bb @@ -0,0 +1,3 @@ +require apt-native.inc + +SRC_URI += "file://nodoc.patch;patch=1" diff --git a/meta/packages/apt/apt-package.inc b/meta/packages/apt/apt-package.inc new file mode 100644 index 000000000..43f54cada --- /dev/null +++ b/meta/packages/apt/apt-package.inc @@ -0,0 +1,101 @@ +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/fr/apt-cache.fr.8 \ + doc/fr/apt-cdrom.fr.8 \ + doc/fr/apt-config.fr.8 \ + doc/fr/apt-get.fr.8 \ + doc/fr/apt.conf.fr.5 \ + doc/fr/apt_preferences.fr.5 \ + doc/fr/sources.list.fr.5 \ + doc/es/apt.es.8 \ + doc/es/apt-cache.es.8 \ + doc/es/apt-cdrom.es.8 \ + doc/es/apt-config.es.8 \ + doc/es/apt-get.es.8 \ + doc/es/apt.conf.es.5 \ + doc/es/apt_preferences.es.5 \ + doc/es/sources.list.es.5 \ + doc/pt_BR/apt_preferences.pt_BR.5 \ + doc/ja/apt-cache.ja.8 \ + doc/ja/apt-cdrom.ja.8 \ + doc/ja/apt-get.ja.8 \ + doc/ja/apt.conf.ja.5 \ + doc/sources.list.5" +apt-utils-manpages="doc/apt-extracttemplates.1 \ + doc/apt-sortpkgs.1 \ + doc/fr/apt-extracttemplates.fr.1 \ + doc/fr/apt-sortpkgs.fr.1" +# doc/fr/apt-ftparchive.fr.1 +# doc/apt-ftparchive.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): + import os + 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, bb.data.getVar('apt-manpages', d, 1))} \ + ${docdir}/apt" +FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, bb.data.getVar('apt-utils-manpages', d, 1))}" +FILES_${PN}-dev = "${libdir}/libapt*.so" + +do_install () { + set -x + ${@get_commands_apt_doc(d, bb, bb.data.getVar('apt-manpages', d, 1))} + ${@get_commands_apt_doc(d, bb, bb.data.getVar('apt-utils-manpages', d, 1))} + 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}/ + + eval `cat environment.mak | grep ^GLIBC_VER | sed -e's, = ,=,'` + oe_libinstall -so -C bin libapt-pkg$GLIBC_VER-6 ${D}${libdir}/ + ln -sf libapt-pkg$GLIBC_VER-6.so ${D}${libdir}/libapt-pkg.so + oe_libinstall -so -C bin libapt-inst$GLIBC_VER-6 ${D}${libdir}/ + ln -sf libapt-inst$GLIBC_VER-6.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 dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ + install -m 0644 dselect/names ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 dselect/install ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 dselect/setup ${D}${libdir}/dpkg/methods/apt/ + install -m 0755 dselect/update ${D}${libdir}/dpkg/methods/apt/ + + install -d ${D}${sysconfdir}/apt + 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 doc/examples/* ${D}${docdir}/apt/examples/ +} diff --git a/meta/packages/apt/apt.inc b/meta/packages/apt/apt.inc new file mode 100644 index 000000000..9a4f8f329 --- /dev/null +++ b/meta/packages/apt/apt.inc @@ -0,0 +1,11 @@ +DESCRIPTION = "Advanced front-end for dpkg." +LICENSE = "GPL" +SECTION = "base" +MAINTAINER = "Chris Larson " + +SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/apt_${PV}.tar.gz" +S = "${WORKDIR}/apt-${PV}" + +inherit autotools gettext + +EXTRA_AUTORECONF = "--exclude=autopoint,autoheader" diff --git a/meta/packages/apt/apt_0.6.45exp2.bb b/meta/packages/apt/apt_0.6.45exp2.bb new file mode 100644 index 000000000..1cd8eb270 --- /dev/null +++ b/meta/packages/apt/apt_0.6.45exp2.bb @@ -0,0 +1,9 @@ +require apt.inc + +SRC_URI += "file://autofoo.patch;patch=1 \ + file://nodoc.patch;patch=1" + +require apt-package.inc + +FILES_${PN} += "${bindir}/apt-key" +apt-manpages += "doc/apt-key.8" diff --git a/meta/packages/apt/files/apt.conf b/meta/packages/apt/files/apt.conf new file mode 100644 index 000000000..944233c34 --- /dev/null +++ b/meta/packages/apt/files/apt.conf @@ -0,0 +1,24 @@ +Dir "${STAGING_DIR}/" +{ + State "var/lib/apt/" + { + Lists "lists/"; + status "${IMAGE_ROOTFS}/${localstatedir}/lib/dpkg/status"; + }; + Cache "var/cache/apt/" + { + Archives "archives/"; + pkgcache ""; + srcpkgcache ""; + }; + Bin "${STAGING_BINDIR}/" + { + 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"; + }; +}; -- cgit v1.2.3