wok view busybox-pam/receipt @ rev 5975

busybox*: remember post_install answer
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 11 12:39:49 2010 +0200 (2010-08-11)
parents c29991cef110
children 029092db0791
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox-pam"
4 VERSION="1.17.1"
5 CATEGORY="base-system"
6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 DEPENDS="slitaz-base-files glibc-base pam"
9 BUILD_DEPENDS="bzip2 pam pam-dev"
10 SOURCE="busybox"
11 TARBALL="$SOURCE-$VERSION.tar.bz2"
12 WEB_SITE="http://www.busybox.net/"
13 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
14 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf \
15 /etc/pam.d"
16 PROVIDE="busybox:pam"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 cd $src
22 while read file; do
23 [ -f done.$file ] && continue
24 echo "Apply $file..."
25 patch -p1 < $WOK/$SOURCE/stuff/$SOURCE-$VERSION-$file || return 1
26 touch done.$file
27 done <<EOT
28 cpio-mkdir.u
29 tar.u
30 stat.u
31 ris.u
32 depmod.u
33 zmodules.u
34 usage.u
35 EOT
36 cp $WOK/$SOURCE/stuff/$SOURCE-$VERSION.config .config
37 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
38 make oldconfig
39 if [ "$(gcc --version | awk '{ print $3; exit }')" == "4.5.0" ]; then
40 # "CFLAGS=-O0" is a workaround for GCC 4.5.0 (sed crash)
41 # "CFLAGS=-fno-tree-pta" may be a workaround for GCC 4.5.0 (sed garbage)
42 make -j 4 "CFLAGS=-O0" && make "CFLAGS=-O0" install
43 else
44 make -j 4 && make install
45 fi
46 echo "Chmod 4755 on busybox binary..."
47 chmod 4755 _install/bin/busybox
48 }
50 # Rules to gen a SliTaz package suitable for Tazpkg.
51 genpkg_rules()
52 {
53 cp -a $src/_install/* $fs
54 rm -f $fs/sbin/depmod $fs/usr/bin/ar
55 cp -a stuff/etc $fs
56 mkdir -p $fs/etc/init.d
57 # Busybox config files.
58 # genpkg busybox-pam depends on busybox config files
59 # Note: no space/tab before WANTED
60 WANTED="busybox"
61 cd $WOK/$SOURCE
62 fs=$WOK/$PACKAGE/taz/$PACKAGE-$VERSION/fs
63 cp stuff/busybox.conf $fs/etc
64 chmod 600 $fs/etc/busybox.conf
65 cp stuff/dnsd.conf $fs/etc
66 cp stuff/udhcpd.conf $fs/etc
67 touch $fs/etc/resolv.conf
68 cp stuff/inetd.conf $fs/etc
69 cp stuff/daemon $fs/etc/init.d
70 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
71 udhcpd zcip ; do
72 grep -qi config_$i=y $src/.config &&
73 ln -s daemon $fs/etc/init.d/$i
74 done
75 cp stuff/init $fs
76 rm $fs/linuxrc
77 mkdir -p $fs/etc/modprobe.d
78 # Udhcpc stuff.
79 mkdir -p $fs/usr/share/udhcpc
80 cp stuff/udhcp.script $fs/usr/share/udhcpc/default.script
81 chmod +x $fs/usr/share/udhcpc/default.script
82 # ZeroConf stuff.
83 cp stuff/zcip.script $fs/etc
84 # Httpd stuff.
85 cp stuff/httpd_helper.sh $fs/usr/bin
86 chmod +x $fs/usr/bin/httpd_helper.sh
87 # .desktop stuff
88 mkdir -p $fs/usr/share
89 cp -a stuff/applications $fs/usr/share
90 }
92 # Force glibc-2.7 reinstall if 2.3.6 still in use.
93 pre_install()
94 {
95 local i
96 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
97 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
98 tazpkg get-install glibc-base --forced
99 fi
100 answer=""
101 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
102 [ -f $1$i ] || continue
103 case "$i" in
104 /bin/busybox) continue ;;
105 *bin/*) ;;
106 *) continue ;;
107 esac
108 if [ -z "$answer" ]; then
109 echo -n "Keep installed GNU utilities ? "
110 read -t 30 answer # by default: keep
111 case "$answer" in
112 n*|N*) break;;
113 *) answer="Y";;
114 esac
115 fi
116 cp -a $1$i $1$i-busybox-install
117 done
118 }
120 post_install()
121 {
122 local i
123 [ -f /etc/resolv.conf-busybox-install ] &&
124 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
125 while read i ; do
126 [ -f $1$i-busybox-install ] || continue
127 mv $1$i-busybox-install $1$i
128 done < $1$INSTALLED/$PACKAGE/files.list
129 chmod 4755 $1/bin/busybox
130 sed -i "s@vcsa2txt.*\$@busybox conspy -d | sed 's/ *\$//;/^\$/d;/^Processi\|^.witchi/,\$!d' > /var/log/boot.log@" $1/etc/init.d/rcS
131 }