# #
###############################################################################
+ifeq "$(CHROOT)" "1"
+ BASEDIR = /usr/src
+endif
+
THISAPP = $(PKG_NAME)-$(PKG_VER)
DIR_APP = $(DIR_SRC)/$(THISAPP)
DIR_TMP = /tmp
DIR_SOURCE = $(CURDIR)
DIR_PACKAGES = /usr/src/packages
+DIR_TOOLS = $(BASEDIR)/tools
BUILD_HOST ?= $(shell cat /proc/sys/kernel/hostname)
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
--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)
$(STAGE_INSTALL): $(STAGE_BUILD)
@$(PRE_INSTALL)
- cd $(DIR_APP) && make install
+ cd $(DIR_APP) && make install $(if $(TOOLCHAIN),,DESTDIR=$(BUILDROOT))
@$(POST_INSTALL)
for file in ${files}; do
echo "${file#${root}/}"
done > ${manifest}
+
+ cat ${manifest}
}
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
# 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
\
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}" \