Magellan Linux

Contents of /smage/branches/alx-0_6_0/core/busybox/busybox-1.17.4-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1796 - (show annotations) (download)
Wed Apr 13 08:10:21 2011 UTC (13 years, 2 months ago) by niro
File size: 4084 byte(s)
-install busybox links in postinstall
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.17.4"
5 PBUILD="r1"
6
7 PCATEGORIE="sys-apps"
8 STATE="unstable"
9
10 DESCRIPTION="BusyBox combines tiny versions of many common UNIX utilities into a single small executable."
11 HOMEPAGE="http://www.busybox.net/"
12
13 DEPEND=""
14
15 PROVIDE="virtual/sed
16 virtual/tar
17 virtual/usbutils
18 virtual/pciutils
19 virtual/debianutils
20 virtual/which
21 virtual/wget
22 virtual/grep
23 virtual/bzip2
24 virtual/gzip
25 virtual/syslog"
26
27 # busbox config CVS revision
28 CFG_CVS_REV=1.13
29 # udhcpc client script CVS revision
30 UDHCPC_CVS_REV=1.1
31 # syslogd.rc cvs revision
32 SYSLOGD_CVS_REV=1.3
33
34 SRCFILE="${PNAME}-${PVER}.tar.bz2"
35 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
36
37 sminclude mtools alx
38
39 SRC_URI=(
40 http://www.busybox.net/downloads/${SRCFILE}
41 mirror://${PNAME}/${SRCFILE}
42 mirror://${PNAME}/config-${CFG_CVS_REV}
43 mirror://${PNAME}/udhcpc.sh-${UDHCPC_CVS_REV}
44 mirror://${PNAME}/de.kmap.gz
45 mirror://${PNAME}/syslogd.rc-${SYSLOGD_CVS_REV}
46 mirror://${PNAME}/${PNAME}-1.15.3-flags.patch
47 mirror://${PNAME}/${PNAME}-1.18.2-tar.patch
48 )
49
50 src_prepare()
51 {
52 munpack ${SRCFILE} || die
53 munpack de.kmap.gz ${SRCDIR} || die
54 cd ${SRCDIR}
55
56 # official patches
57 # fix tar issues: autodetection of compression modes - fixed with 1.18.3
58 # see: http://lists.busybox.net/pipermail/busybox/2011-February/074737.html
59 mpatch ${PNAME}-1.18.2-tar.patch || die
60
61 # magellan patches
62 # remove broken cflags
63 mpatch ${PNAME}-1.15.3-flags.patch || die
64
65 # using a custom config
66 cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die
67
68 # disable static linking atm, broken with glibc-2.12
69 sed -i 's/.*\(CONFIG_STATIC\).*/#\ \1 is not set/' .config || die
70 }
71
72 src_compile()
73 {
74 cd ${SRCDIR}
75
76 make oldconfig || die
77 mmake || die
78
79 # create a busybox.links file
80 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
81
82 # fix missing applet symlinks
83 echo "/bin/du" >> busybox.links || die
84
85 # do not use ash as default sh, we want bin/bash
86 sed -i '/bin\/sh/d' busybox.links || die
87
88 # use poweroff as default halt command
89 sed -i '/sbin\/halt/d' busybox.links || die
90 echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die
91
92 # remove some applet symlinks which are provided by other packages
93 ### patch
94 sed -i '/usr\/bin\/patch/d' busybox.links || die
95 ### e2fsprogs
96 sed -i '/sbin\/fsck/d' busybox.links || die
97 sed -i '/sbin\/mke2fs/d' busybox.links || die
98 sed -i '/sbin\/mkfs.ext2/d' busybox.links || die
99 sed -i '/sbin\/tune2fs/d' busybox.links || die
100 ### shadow
101 sed -i '/bin\/login/d' busybox.links || die
102 sed -i '/bin\/su/d' busybox.links || die
103 sed -i '/usr\/bin\/passwd/d' busybox.links || die
104 ### sysvinit
105 sed -i '/sbin\/init/d' busybox.links || die
106 sed -i '/sbin\/poweroff/d' busybox.links || die
107 sed -i '/sbin\/reboot/d' busybox.links || die
108 sed -i '/sbin\/runlevel/d' busybox.links || die
109 sed -i '/sbin\/sulogin/d' busybox.links || die
110 ### binutils
111 sed -i '/usr\/bin\/ar/d' busybox.links || die
112 sed -i '/usr\/bin\/strings/d' busybox.links || die
113 ### diffutils
114 sed -i '/usr\/bin\/cmp/d' busybox.links || die
115 }
116
117 src_install()
118 {
119 cd ${SRCDIR}
120
121 minstalldir /bin || die
122 minstallexec busybox /bin || die
123 # set suid bit for suid applets like su
124 mchmod +s /bin/busybox || die
125
126 minstalldir /sbin || die
127 minstallexec halt.sh /sbin/halt || die
128
129 minstalldir /usr/share/busybox || die
130 minstallfile busybox.links /usr/share/busybox || die
131
132 minstalldir /usr/share/busybox/keymaps || die
133 minstallfile de.kmap /usr/share/busybox/keymaps || die
134
135 minstalldir /usr/share/udhcpc || die
136 minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die
137
138 # install syslogd rc script
139 minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die
140 }
141
142 postinstall()
143 {
144 mstartservice syslogd
145
146 if [ -x ${MROOT}/bin/busybox ]
147 then
148 echo "Setting suid bit for ${MROOT}/bin/busybox"
149 chmod +s ${MROOT}/bin/busybox
150 fi
151
152 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
153 then
154 echo "Setting up busybox links ... "
155 local i
156 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
157 do
158 ln -snf /bin/busybox ${MROOT}/${i}
159 done
160 fi
161 }
162
163 postremove()
164 {
165 mstopservice syslogd
166 }