wok view busybox-pam/receipt @ rev 5918

busybox: update touch usage
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 28 11:56:35 2010 +0200 (2010-07-28)
parents b5f4ef5d86ec
children 4421c2206be7
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 PROVIDE="busybox:pam"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 while read file; do
22 [ -f done.$file ] && continue
23 echo "Apply $file..."
24 patch -p1 < $WOK/$SOURCE/stuff/$SOURCE-$VERSION-$file || return 1
25 touch done.$file
26 done <<EOT
27 cpio-mkdir.u
28 tar.u
29 stat.u
30 ris.u
31 depmod.u
32 zmodules.u
33 usage.u
34 EOT
35 cp $WOK/$SOURCE/stuff/$SOURCE-$VERSION.config .config
36 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
37 make oldconfig
38 # "CFLAGS=-O0" is a workaround for GCC 4.5.0
39 make -j 4 "CFLAGS=-O0" && make "CFLAGS=-O0" install
40 echo "Chmod 4755 on busybox binary..."
41 chmod 4755 _install/bin/busybox
42 }
44 # Rules to gen a SliTaz package suitable for Tazpkg.
45 genpkg_rules()
46 {
47 cp -a $src/_install/* $fs
48 rm -f $fs/sbin/depmod $fs/usr/bin/ar
49 cp -a stuff/etc $fs
50 mkdir -p $fs/etc/init.d
51 # Busybox config files.
52 # genpkg busybox-pam depends on busybox config files
53 # Note: no space/tab before WANTED
54 WANTED="busybox"
55 cd $WOK/$SOURCE
56 fs=$WOK/$PACKAGE/taz/$PACKAGE-$VERSION/fs
57 cp stuff/busybox.conf $fs/etc
58 chmod 600 $fs/etc/busybox.conf
59 cp stuff/dnsd.conf $fs/etc
60 cp stuff/udhcpd.conf $fs/etc
61 touch $fs/etc/resolv.conf
62 cp stuff/inetd.conf $fs/etc
63 cp stuff/daemon $fs/etc/init.d
64 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
65 udhcpd zcip ; do
66 grep -qi config_$i=y $src/.config &&
67 ln -s daemon $fs/etc/init.d/$i
68 done
69 cp stuff/init $fs
70 rm $fs/linuxrc
71 mkdir -p $fs/etc/modprobe.d
72 # Udhcpc stuff.
73 mkdir -p $fs/usr/share/udhcpc
74 cp stuff/udhcp.script $fs/usr/share/udhcpc/default.script
75 chmod +x $fs/usr/share/udhcpc/default.script
76 # ZeroConf stuff.
77 cp stuff/zcip.script $fs/etc
78 # Httpd stuff.
79 cp stuff/httpd_helper.sh $fs/usr/bin
80 chmod +x $fs/usr/bin/httpd_helper.sh
81 # .desktop stuff
82 mkdir -p $fs/usr/share
83 cp -a stuff/applications $fs/usr/share
84 }
86 # Force glibc-2.7 reinstall if 2.3.6 still in use.
87 pre_install()
88 {
89 local i
90 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
91 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
92 tazpkg get-install glibc-base --forced
93 fi
94 answer=""
95 while read i ; do
96 [ -f $1$i ] || continue
97 case "$i" in
98 /bin/busybox) continue ;;
99 *bin/*) ;;
100 *) continue ;;
101 esac
102 if [ -z "$answer" ]; then
103 echo -n "Keep installed GNU utilities ? "
104 read answer
105 case "$answer" in
106 y*|Y*|o*|O*);;
107 *) break;;
108 esac
109 fi
110 cp -a $1$i $1$i-busybox-install
111 done < $1$INSTALLED/$PACKAGE/files.list
112 }
114 post_install()
115 {
116 local i
117 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
118 while read i ; do
119 [ -f $1$i-busybox-install ] || continue
120 mv $1$i-busybox-install $1$i
121 done < $1$INSTALLED/$PACKAGE/files.list
122 chmod 4755 $1/bin/busybox
123 }