OSDN Git Service

first commit
[slackware/slackbuild.git] / busybox / busybox.SlackBuild
1 #!/bin/sh
2 # Copyright 2007  Patrick J. Volkerding, Sebeka, MN, USA
3 # All rights reserved.
4 #
5 # Redistribution and use of this script, with or without modification, is
6 # permitted provided that the following conditions are met:
7 #
8 # 1. Redistributions of this script must retain the above copyright
9 #    notice, this list of conditions and the following disclaimer.
10 #
11 #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
14 #  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16 #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
17 #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
18 #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
19 #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
20 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21
22
23 PKGNAM=busybox
24 VERSION=${VERSION:-1.17.2}
25 ARCH=${ARCH:-i486}
26 BUILD=${BUILD:-1}
27
28
29 CWD=$(pwd)
30 if [ "$TMP" = "" ]; then
31   TMP=/tmp
32 fi
33
34 cd $TMP
35 rm -rf ${PKGNAM}-${VERSION}
36 tar xjvf $CWD/${PKGNAM}-$VERSION.tar.bz2 || exit 1
37 cd ${PKGNAM}-$VERSION || exit 1
38
39 # Turn off ash job control warnings:
40 zcat $CWD/busybox.ash.quiet.diff.gz | patch -p1 --verbose || exit 1
41
42 # Make sure ownerships and permissions are sane:
43 chown -R root:root .
44 find . -perm 666 -exec chmod 644 {} \;
45 find . -perm 664 -exec chmod 644 {} \;
46 find . -perm 600 -exec chmod 644 {} \;
47 find . -perm 444 -exec chmod 644 {} \;
48 find . -perm 400 -exec chmod 644 {} \;
49 find . -perm 440 -exec chmod 644 {} \;
50 find . -perm 777 -exec chmod 755 {} \;
51 find . -perm 775 -exec chmod 755 {} \;
52 find . -perm 511 -exec chmod 755 {} \;
53 find . -perm 711 -exec chmod 755 {} \;
54 find . -perm 555 -exec chmod 755 {} \;
55
56 # Configure:
57 cat $CWD/busybox.dot.config > .config
58 make oldconfig
59
60 # Build and install:
61 make -j4 || exit 1
62 make install || exit 1
63