From: Michael Tremer Date: Wed, 28 Oct 2009 20:13:58 +0000 (+0100) Subject: naoki: Fixes on chroot environment. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79f35170560f63b622ca60ec932ab007bd60d598;p=ipfire-3.x.git naoki: Fixes on chroot environment. --- diff --git a/pkgs/Config b/pkgs/Config index 66d37777a..43b846e7f 100644 --- a/pkgs/Config +++ b/pkgs/Config @@ -18,6 +18,10 @@ # # ############################################################################### +ifeq "$(CHROOT)" "1" + BASEDIR = /usr/src +endif + THISAPP = $(PKG_NAME)-$(PKG_VER) DIR_APP = $(DIR_SRC)/$(THISAPP) @@ -27,6 +31,7 @@ DIR_SRC = $(ROOT)/usr/src DIR_TMP = /tmp DIR_SOURCE = $(CURDIR) DIR_PACKAGES = /usr/src/packages +DIR_TOOLS = $(BASEDIR)/tools BUILD_HOST ?= $(shell cat /proc/sys/kernel/hostname) @@ -42,18 +47,13 @@ PKG_PACKAGES_FILES = $(foreach package,$(PKG_PACKAGES),$(call DO_PACKAGE_FILENAM DO_PACKAGE_FILENAME = $(subst --,-,$(PKG_NAME_REAL)-$(subst default,,$(1))-$(PKG_VER)-$(DISTRO_SNAME)$(DISTRO_EPOCH)-$(PKG_REL).ipk) -TC_PACKAGES = binutils gcc glibc +TC_PACKAGES = binutils gcc glibc make PKG_TOOLCHAIN_DEPS ?= $(TC_PACKAGES) PKG_BUILD_DEPS ?= $(TC_PACKAGES) -ifeq "$(TOOLCHAIN)" "1" - DO_EXTRACT = bash /build/ipfire-3.x/src/scripts/extractor - DO_PATCHES = cd $(DIR_APP) && /build/ipfire-3.x/tools/patch $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch)) -else - DO_EXTRACT = bash /usr/src/src/scripts/extractor - DO_PATCHES = cd $(DIR_APP) && /usr/src/tools/patch $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch)) -endif -DO_LOAD = python /build/ipfire-3.x/tools/downloader http://source.ipfire.org/source-3.x/$@ +DO_EXTRACT = $(DIR_TOOLS)/extractor +DO_LOAD = $(DIR_TOOLS)/downloader http://source.ipfire.org/source-3.x/$@ +DO_PATCHES = cd $(DIR_APP) && $(DIR_TOOLS)/patch $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch)) define PKG_FILES_devel /usr/include diff --git a/pkgs/Rules b/pkgs/Rules index 8827e4789..752ccb6a8 100644 --- a/pkgs/Rules +++ b/pkgs/Rules @@ -84,14 +84,14 @@ $(STAGE_PACKAGE_TARGETS): $(STAGE_INSTALL) --root=$(BUILDROOT) $(if $(PKG_FILES_$@), --regexes=$(DIR_TMP)/filelist_$@) $(STAGE_PREPARE): $(OBJECTS) - $(PRE_PREPARE) + @$(PRE_PREPARE) ifneq "$(PKG_TARBALL)" "" cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(PKG_TARBALL) endif $(DO_PATCHES) - $(POST_PREPARE) + @$(POST_PREPARE) $(STAGE_BUILD): $(STAGE_PREPARE) $(PRE_BUILD) @@ -108,6 +108,6 @@ $(STAGE_BUILD): $(STAGE_PREPARE) $(STAGE_INSTALL): $(STAGE_BUILD) @$(PRE_INSTALL) - cd $(DIR_APP) && make install + cd $(DIR_APP) && make install $(if $(TOOLCHAIN),,DESTDIR=$(BUILDROOT)) @$(POST_INSTALL) diff --git a/src/pakfire/compressor b/src/pakfire/compressor index c9a9716cc..c4e565ed6 100755 --- a/src/pakfire/compressor +++ b/src/pakfire/compressor @@ -89,6 +89,8 @@ function create_manifest() { for file in ${files}; do echo "${file#${root}/}" done > ${manifest} + + cat ${manifest} } function apply_regexes() { @@ -103,7 +105,7 @@ function apply_regexes() { for regex in $(<${regexes}); do [ "${regex:0:1}" != "/" ] && regex="/${regex}" - filelist=$(find ${root}${regex}) + filelist=$(find ${root}${regex} 2>/dev/null) for file in ${files}; do grep "${file}" <<<"${filelist}" done diff --git a/src/scripts/extractor b/tools/extractor old mode 100644 new mode 100755 similarity index 100% rename from src/scripts/extractor rename to tools/extractor diff --git a/tools/naoki-functions b/tools/naoki-functions index c8862219c..cee1d8c8b 100644 --- a/tools/naoki-functions +++ b/tools/naoki-functions @@ -98,7 +98,7 @@ function naoki_prepare() { # Extract needed packages - for i in /bin/bash /bin/sh; do + for i in /bin/bash /bin/pwd /bin/sh; do if [ -e "${BUILD_DIR}${i}" ]; then continue fi @@ -176,13 +176,14 @@ function naoki_cmd() { \ DISTRO_NAME="${DISTRO_NAME}" \ DISTRO_SNAME="${DISTRO_SNAME}" \ - DISTRO_VER="${DISTRO_VER}" \ + DISTRO_VERSION="${DISTRO_VERSION}" \ DISTRO_EPOCH="${DISTRO_EPOCH}" \ DISTRO_SLOGAN="${DISTRO_SLOGAN}" \ \ + BASEDIR="${BASEDIR}" \ ROOT=$([ "${TOOLCHAIN}" = "1" ] && \ echo "${BUILD_DIR}") \ - CHROOT="${CHROOT}" \ + CHROOT="${with_chroot}" \ TOOLS_DIR="${TOOLS_DIR}" \ TOOLCHAIN="${TOOLCHAIN}" \ BUILDROOT="${BUILD_ROOT}" \