#!/bin/sh
+set -o errexit
+
# First argument of this script is the package name
# Reading system configuration informations, functions and package versions.
source ../functions
source ../packages-list
-# Applying patches (if any)
-apply_patches ${1} &&
+PACKAGE=${1}
+shift
+CONFIGURE_OPTS=${*}
+
+# Manually applying patches because of order
+apply_patch ${PACKAGE}-use_mmap-1.patch ${PACKAGE}
+apply_patch ${PACKAGE}-256byte_inode-1.patch ${PACKAGE}
+apply_patch ${PACKAGE}-ext4-1.patch ${PACKAGE}
+apply_patch ${PACKAGE}-fixes-1.patch ${PACKAGE}
GRUB_STAGE_FILES="/usr/lib/grub/i386-pc"
-cd ${LFS_TMP}/${1}-build &&
-../${1}/configure \
- --prefix=/usr &&
-make -j ${MAKEJOBS} &&
-make install &&
+cd ${LFS_TMP}/${PACKAGE}-build
+../${PACKAGE}/configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ ${CONFIGURE_OPTS}
+make -j ${MAKEJOBS}
+make install
-mkdir -p /boot/grub &&
-cp -a ${GRUB_STAGE_FILES}/stage{1,2} /boot/grub &&
+mkdir -p /boot/grub
+cp -a ${GRUB_STAGE_FILES}/stage{1,2} /boot/grub
cp -a ${GRUB_STAGE_FILES}/{e2fs,reiserfs}_stage1_5 /boot/grub
-# Return last error
exit $?
+