]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
naoki: Fixes on chroot environment.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Oct 2009 20:13:58 +0000 (21:13 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Oct 2009 20:13:58 +0000 (21:13 +0100)
pkgs/Config
pkgs/Rules
src/pakfire/compressor
tools/extractor [moved from src/scripts/extractor with 100% similarity, mode: 0755]
tools/naoki-functions

index 66d37777aa46ed8ac18439669a90f3af18f09ce9..43b846e7f0ebf486daabe8b13af895fd3d07d365 100644 (file)
 #                                                                             #
 ###############################################################################
 
+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
index 8827e4789bac9b28cc63cd6b1a6fe7910b3a20c8..752ccb6a8630b5eb9fb0df2806ef543b20147851 100644 (file)
@@ -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)
index c9a9716cc7eb0aa3374c902b74a3cbcecc8b9af8..c4e565ed62d05727f3c8e5cae3963e9138889944 100755 (executable)
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from src/scripts/extractor
rename to tools/extractor
index c8862219cf9678aa7a03bce7c0301493e3f4cd10..cee1d8c8b57eb5aefc07ada5295311d9839199e2 100644 (file)
@@ -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}" \