Magellan Linux

Contents of /smage/trunk/core/busybox/busybox-1.19.2-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1825 - (show annotations) (download)
Mon Sep 26 15:55:37 2011 UTC (12 years, 7 months ago) by niro
File size: 7114 byte(s)
-rev bump to -r2; added upstream patches
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.19.2"
5 PBUILD="r2"
6
7 PCATEGORIE="sys-apps"
8
9 DESCRIPTION="BusyBox combines tiny versions of many common UNIX utilities into a single small executable."
10 HOMEPAGE="http://www.busybox.net/"
11
12 # shared busybox needs glibc
13 DEPEND=">= virtual/glibc"
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 virtual/less
27 virtual/net-tools
28 virtual/inetutils
29 virtual/kbd
30 virtual/procps
31 virtual/psmisc
32 virtual/dhcp
33 virtual/cron
34 virtual/xz-utils"
35
36 # busbox config CVS revision
37 CFG_CVS_REV=1.14
38 # udhcpc client script CVS revision
39 UDHCPC_CVS_REV=1.1
40 # mdev.r cvs revision
41 MDEVRC_CVS_REV=1.3
42 # mdev.conf cvs revision
43 MDEVCONF_CVS_REV=1.2
44 # syslogd.rc cvs revision
45 SYSLOGD_CVS_REV=1.4
46 # splash.conf cvs revision
47 SPLASHCONF_CVS_REV=1.3
48 # splash-functions.rc cvs revision
49 SPLASHRC_CVS_REV=1.3
50
51 SRCFILE="${PNAME}-${PVER}.tar.bz2"
52 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
53
54 MISC_PVER="0.1.8"
55 MISC_SRCFILE="miscsplashutils-${MISC_PVER}.tar.bz2"
56 MISC_SRCDIR="${BUILDDIR}/miscsplashutils-${MISC_PVER}"
57
58 SPLASHTHEME_PVER="1.1"
59 SPLASHTHEME_SRCFILE="mcore-theme-busybox-${SPLASHTHEME_PVER}.tar.bz2"
60 SPLASHTHEME_SRCDIR="${BUILDDIR}/mcore-theme-busybox-${SPLASHTHEME_PVER}"
61
62 sminclude mtools mcore
63
64 SRC_URI=(
65 http://www.busybox.net/downloads/${SRCFILE}
66 mirror://${PNAME}/${SRCFILE}
67 mirror://${PNAME}/config-${CFG_CVS_REV}
68 mirror://${PNAME}/udhcpc.sh-${UDHCPC_CVS_REV}
69 mirror://${PNAME}/de.kmap.gz
70 mirror://${PNAME}/mdev.rc-${MDEVRC_CVS_REV}
71 mirror://${PNAME}/mdev.conf-${MDEVCONF_CVS_REV}
72 mirror://${PNAME}/dvbdev.sh
73 mirror://${PNAME}/ide_links.sh
74 mirror://${PNAME}/usbdev.sh
75 mirror://${PNAME}/usbdisk_link.sh
76 mirror://${PNAME}/syslogd.rc-${SYSLOGD_CVS_REV}
77 mirror://${PNAME}/syslog.conf
78 mirror://${PNAME}/crond.rc
79 mirror://${PNAME}/splash-functions.rc-${SPLASHRC_CVS_REV}
80 mirror://${PNAME}/splash.conf-${SPLASHCONF_CVS_REV}
81 mirror://${PNAME}/${PNAME}-1.15.3-flags.patch
82 mirror://${PNAME}/${PNAME}-1.19.2-crond.patch
83 mirror://${PNAME}/${PNAME}-1.19.2-android.patch
84 mirror://${PNAME}/${PNAME}-1.19.2-buildsys.patch
85 mirror://${PNAME}/${PNAME}-1.19.2-chpasswd.patch
86 mirror://${PNAME}/${PNAME}-1.19.2-inetd.patch
87 mirror://${PNAME}/${PNAME}-1.19.2-syslogd.patch
88 mirror://${PNAME}/${PNAME}-1.19.2-tail.patch
89 mirror://${PNAME}/${PNAME}-1.19.2-tar-seamless-xz.patch
90 mirror://${PNAME}/${PNAME}-1.19.0-fbsplash-tykef-1.0.patch
91 http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE}
92 mirror://${PNAME}/${MISC_SRCFILE}
93 mirror://${PNAME}/${SPLASHTHEME_SRCFILE}
94 )
95
96 src_prepare()
97 {
98 munpack ${SRCFILE} || die
99 munpack de.kmap.gz ${SRCDIR} || die
100 munpack ${MISC_SRCFILE} || die
101 munpack ${SPLASHTHEME_SRCFILE} || die
102 cd ${SRCDIR}
103
104 # official patches
105 mpatch ${PNAME}-1.19.2-crond.patch || die
106 mpatch ${PNAME}-1.19.2-android.patch || die
107 mpatch ${PNAME}-1.19.2-buildsys.patch || die
108 mpatch ${PNAME}-1.19.2-chpasswd.patch || die
109 mpatch ${PNAME}-1.19.2-inetd.patch || die
110 mpatch ${PNAME}-1.19.2-syslogd.patch || die
111 mpatch ${PNAME}-1.19.2-tail.patch || die
112
113 # magellan patches
114 # remove broken cflags
115 mpatch ${PNAME}-1.15.3-flags.patch || die
116 # seamless xz uncompression support in tar (tar -J)
117 mpatch ${PNAME}-1.19.2-tar-seamless-xz.patch || die
118
119 # enhanced fbsplash from tykef
120 # http://tykef.havlinda.net/programovani/fbsplash/
121 mpatch ${PNAME}-1.19.0-fbsplash-tykef-1.0.patch || die
122
123 # using a custom config
124 cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die
125
126 # hotfix for glibc-2.14, rpc interface not supported anymore
127 sed -i 's/.*\(CONFIG_FEATURE_MOUNT_NFS\).*/#\ \1 is not set/' .config || die
128 }
129
130 src_compile()
131 {
132 cd ${SRCDIR}
133
134 make oldconfig || die
135 mmake || die
136
137 # create a busybox.links file
138 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
139
140 # fix missing applet symlinks
141 echo "/bin/du" >> busybox.links || die
142
143 # do not use ash as default sh, we want bin/bash
144 sed -i '/bin\/sh/d' busybox.links || die
145
146 # use poweroff as default halt command
147 sed -i '/sbin\/halt/d' busybox.links || die
148 echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die
149
150 # remove some applet symlinks which are provided by other packages
151 ### umount (use from util-linux, need -t option)
152 sed -i '/bin\/umount/d' busybox.links || die
153
154 cd ${MISC_SRCDIR}
155 mmake fbres || die
156 }
157
158 src_install()
159 {
160 cd ${SRCDIR}
161
162 minstalldir /bin || die
163 minstallexec busybox /bin || die
164 # set suid bit for suid applets like su
165 mchmod +s /bin/busybox || die
166
167 minstalldir /sbin || die
168 minstallexec halt.sh /sbin/halt || die
169
170 minstalldir /usr/share/busybox || die
171 minstallfile busybox.links /usr/share/busybox || die
172
173 minstalldir /usr/share/busybox/keymaps || die
174 minstallfile de.kmap /usr/share/busybox/keymaps || die
175
176 minstalldir /usr/share/udhcpc || die
177 minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die
178
179 minstallrc mdev.rc-${MDEVRC_CVS_REV} mdev || die
180 minstalldir /etc || die
181 minstallfile -s mdev.conf-${MDEVCONF_CVS_REV} /etc/mdev.conf || die
182
183 # install mdev-helpers
184 minstalldir /lib/mdev || die
185 minstallexec -s dvbdev.sh /lib/mdev/devbdev || die
186 minstallexec -s ide_links.sh /lib/mdev/ide_links || die
187 minstallexec -s usbdev.sh /lib/mdev/usbdev || die
188 minstallexec -s usbdisk_link.sh /lib/mdev/usbdisk_link || die
189
190 # install syslogd rc script and config
191 minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die
192 minstallfile -s syslog.conf /etc/syslog.conf || die
193
194 # install crond rc script and keep needed directories
195 minstallrc crond.rc crond || die
196 mkeepdir /var/spool/cron/crontabs || die
197
198 # install splash-functions
199 minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die
200 minstalldir /etc/splash || die
201 minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die
202 minstalldir /dev || die
203 mkfifo ${BINDIR}/dev/splashfifo || die
204
205 # install fbres for splash
206 minstallexec ${MISC_SRCDIR}/fbres || die
207
208 # install fbsplash theme
209 cd ${SPLASHTHEME_SRCDIR}
210 make DESTDIR=${BINDIR} install || die
211 # set alx theme as default
212 mlink alx /etc/splash/themes/default || die
213
214 # disable config_protection for themes
215 minstalldir /etc/env.d || die
216 echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die
217
218 # enable SPLASH_X11_TTY to supress flickers
219 sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die
220 }
221
222 preinstall()
223 {
224 add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d
225 }
226
227 postinstall()
228 {
229 if [ -x ${MROOT}/bin/busybox ]
230 then
231 echo "Setting suid bit for ${MROOT}/bin/busybox"
232 chmod +s ${MROOT}/bin/busybox
233 fi
234
235 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
236 then
237 echo "Setting up busybox links ... "
238 local i
239 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
240 do
241 ln -snf /bin/busybox ${MROOT}/${i}
242 done
243 fi
244
245 if [[ ! -p ${MROOT}/dev/splashfifo ]]
246 then
247 mkfifo ${MROOT}/dev/splashfifo
248 fi
249
250 # run syslogd *after* creating the busybox symlinks!
251 mstartservice syslogd
252 }
253
254 postremove()
255 {
256 mstopservice syslogd
257 }