malekith: bootdisk BOOT,1.2,1.3
Michał Moskal
malekith w pld-linux.org
Pon, 18 Mar 2002, 10:21:11 CET
Module name: bootdisk
Changes by: malekith
Changed RCS file: /cvsroot/bootdisk/scripts/BOOT,v
----------------------------
revision 1.3
date: 2002/03/18 09:21:07; author: malekith; state: Exp; lines: +116 -52
- build more packages
Index: BOOT
===================================================================
RCS file: /cvsroot/bootdisk/scripts/BOOT,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- BOOT 16 Mar 2002 13:40:06 -0000 1.2
+++ BOOT 18 Mar 2002 09:21:07 -0000 1.3
@@ -1,79 +1,143 @@
#!/bin/sh
+#
+# Copyright (c) 2002 Michal Moskal <malekith w pld.org.pl>.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Michal Moskal.
+# 4. Neither the name of the author nor the names of any co-contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY MICHAL MOSKAL AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
-common_opt="--define '__cc i386-uclibc-gcc' \
- --define 'rpmcflags -march=i386 -Os' \
+set -e
+
+arch=`uname -m | sed -e 's/athlon/i386/; s/i.86/i386/'`
+
+stage0="reiserfsprogs xfsprogs poldek"
+stage1="uClibc"
+stage2="slang e2fsprogs"
+stage3="dml ash busybox iproute2 snarf dhcpcd parted jfsutils
+ pcmcia-cs e3 mdctl util-linux ltrace raidtools"
+
+case $arch in
+ i386 )
+ target_cflags="-march=i386"
+ ;;
+ ppc )
+ target_cflags=""
+ ;;
+esac
+
+cflags="$target_cflags -Os"
+
+common_opt="--define 'rpmcflags $cflags' \
--without nls \
--without tetex \
- --target=i386-pld-linux \
+ --target=$arch-pld-linux \
+ --define 'distribution PLD-installer package' \
--clean \
"
-lds="--define 'rpmldflags -s -static'"
-cflags="-march=i386 -Os -I/usr/include"
-usr_include="--define 'rpmcflags $cflags'"
+usr_include="--define 'rpmcflags $cflags -I/usr/include'"
-case "$1" in
- ALL )
- all=`grep '\.spec *)' $0 | sed -e 's/)//'`
- echo $all
- for f in $all ; do
- if $0 $f ; then
- echo "$f built OK"
- else
- echo "$f built FAILED"
- exit 1
- fi
- done
- ;;
- uClibc.spec )
- package_opt="$lds"
+spec=$1
+
+for f in $stage0 ; do
+ if [ "$f.spec" = "$spec" ] ; then
+ glibc_static=yes
+ fi
+done
+
+if test "$glibc_static" ; then
+ rpmcc=""
+ rpm -q glibc-static > /dev/null
+else
+ rpmcc="--define '__cc $arch-uclibc-gcc'"
+fi
+
+case "$spec" in
+ slang.spec | poldek.spec | xfsprogs.spec )
+ rpmld=""
;;
- slang.spec )
+ * )
+ rpmld="--define 'rpmldflags -s -static'"
;;
+esac
+
+case "$spec" in
e2fsprogs.spec )
- package_opt="--with allstatic $lds"
+ package_opt="--with allstatic"
;;
- dml.spec )
- package_opt="$lds $usr_include"
+ ash.spec | busybox.spec)
+ package_opt="--without static"
;;
- ash.spec )
- package_opt="--without static $lds"
+ reiserfsprogs.spec | xfsprogs.spec )
+ package_opt="--with static"
;;
- busybox.spec )
- package_opt="--without static $lds"
+ poldek.spec )
+ package_opt="--with static --without imode"
;;
iproute2.spec )
- package_opt="$lds --without tc"
- ;;
- snarf.spec )
- package_opt="$lds"
- ;;
- dhcpcd.spec )
- package_opt="$lds"
+ package_opt="--without tc"
;;
parted.spec )
export CPPFLAGS="-I/usr/include"
def="-DUSE_OWN_LLSEEK -DNO_BIOS_GEOMETRY_WARNING"
- package_opt="$lds \
- --with static \
+ package_opt="--with static \
--without readline \
--with uClibc \
- --define 'rpmcflags $cflags $def'"
+ --define 'rpmcflags $cflags $CPPFLAGS $def'"
;;
jfsutils.spec )
- package_opt="$lds --without fsck"
+ package_opt="--without fsck"
;;
- pcmcia-cs.spec )
- package_opt="$lds"
+ mdctl.spec )
+ package_opt="--without initrd"
;;
- e3.spec )
- package_opt="$lds"
+ util-linux.spec )
+ package_opt="--with uClibc"
;;
- mdctl.spec )
- package_opt="$lds --without initrd"
+esac
+
+case "$spec" in
+ stage* )
+ all=`eval echo \\$$1`
+ for f in $all ; do
+ if $0 $f.spec ; then
+ echo "$f built OK"
+ else
+ echo "$f didn't build" 1>&2
+ exit 1
+ fi
+ done
;;
- xfsprogs.spec )
- export CPPFLAGS="-I/usr/include"
- package_opt="--with static $usr_include"
+ *.spec )
+ echo "Running rpm with \"$rpmcc $rpmld $package_opt\""
+ eval "exec rpm -bb $common_opt $rpmcc $rpmld $package_opt \"$@\""
;;
+ * )
+ echo "USAGE: $0 foo.spec|stage[0-3]" 1>&2
+ exit 1
esac
-eval "rpm -bb $common_opt $package_opt \"$@\""
+
+exit 0
Więcej informacji o liście dyskusyjnej pld-installer