Magellan Linux

Contents of /smage/trunk/core/busybox/busybox-1.20.2-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3962 - (show annotations) (download)
Wed Jul 25 13:36:33 2012 UTC (11 years, 11 months ago) by niro
File size: 7382 byte(s)
auto added: ver bump to 1.20.2-r3
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.20.2"
5 PBUILD="r3"
6
7 PCAT="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/ed
16 virtual/sed
17 virtual/tar
18 virtual/usbutils
19 virtual/pciutils
20 virtual/debianutils
21 virtual/which
22 virtual/wget
23 virtual/grep
24 virtual/bzip2
25 virtual/gzip
26 virtual/syslog
27 virtual/less
28 virtual/net-tools
29 virtual/inetutils
30 virtual/kbd
31 virtual/procps
32 virtual/psmisc
33 virtual/dhcp
34 virtual/cron
35 virtual/xz-utils
36 virtual/sysvinit
37 virtual/sysvinit-tools
38 virtual/eject"
39
40 # busbox config CVS revision
41 CFG_CVS_REV=1.15
42 # udhcpc client script CVS revision
43 UDHCPC_CVS_REV=1.1
44 # syslogd.rc cvs revision
45 SYSLOGD_CVS_REV=1.4
46 # splash.conf cvs revision
47 SPLASHCONF_CVS_REV=1.4
48 # splash-functions.rc cvs revision
49 SPLASHRC_CVS_REV=1.6
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.0"
59 SPLASHTHEME_SRCFILE="alx-theme-busybox-${SPLASHTHEME_PVER}.tar.bz2"
60 SPLASHTHEME_SRCDIR="${BUILDDIR}/alx-theme-busybox-${SPLASHTHEME_PVER}"
61
62 sminclude mtools alx
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}/syslogd.rc-${SYSLOGD_CVS_REV}
71 mirror://${PNAME}/syslog.conf
72 mirror://${PNAME}/crond.rc
73 mirror://${PNAME}/${PNAME}-1.15.3-flags.patch
74 mirror://${PNAME}/${PNAME}-${PVER}-tar-seamless-xz.patch
75 mirror://${PNAME}/splash-functions.rc-${SPLASHRC_CVS_REV}
76 mirror://${PNAME}/splash.conf-${SPLASHCONF_CVS_REV}
77 mirror://${PNAME}/${PNAME}-${PVER}-fbsplash-tykef-1.0.patch
78 mirror://${PNAME}/${PNAME}-1.17.4-fbsplash-reload-background-image.patch
79 mirror://${PNAME}/${PNAME}-${PVER}-glibc216.patch
80 mirror://${PNAME}/${PNAME}-${PVER}-mv-ignore-verbose.patch
81 mirror://${PNAME}/${PNAME}-${PVER}-cp-ignore-onefilesystem.patch
82 http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE}
83 mirror://${PNAME}/${MISC_SRCFILE}
84 mirror://${PNAME}/${SPLASHTHEME_SRCFILE}
85 )
86
87 src_prepare()
88 {
89 munpack ${SRCFILE} || die
90 munpack de.kmap.gz ${SRCDIR} || die
91 munpack ${MISC_SRCFILE} || die
92 munpack ${SPLASHTHEME_SRCFILE} || die
93 cd ${SRCDIR}
94
95 # official patches
96
97 # magellan patches
98 # remove broken cflags
99 mpatch ${PNAME}-1.15.3-flags.patch || die
100 # seamless xz uncompression support in tar (tar -J)
101 mpatch ${PNAME}-${PVER}-tar-seamless-xz.patch || die
102 # fix build against newer glibc (>=2.16)
103 mpatch ${PNAME}-${PVER}-glibc216.patch || die
104 # let mv ignore the verbose mode switch (mv -v prints an error)
105 mpatch ${PNAME}-${PVER}-mv-ignore-verbose.patch || die
106 # let cp ignore the onefilesystem mode switch (cp -x prints an error)
107 mpatch ${PNAME}-${PVER}-cp-ignore-onefilesystem.patch || die
108
109 # enhanced fbsplash from tykef
110 # http://tykef.havlinda.net/programovani/fbsplash/
111 mpatch ${PNAME}-${PVER}-fbsplash-tykef-1.0.patch || die
112
113 # fbsplash: adds 'image:' cmd to be able to reload the background image
114 # requires the tykef patch
115 mpatch ${PNAME}-1.17.4-fbsplash-reload-background-image.patch || die
116
117 # using a custom config
118 cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die
119 }
120
121 src_compile()
122 {
123 cd ${SRCDIR}
124
125 make oldconfig || die
126 mmake || die
127
128 # create a busybox.links file
129 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
130
131 # do not use ash as default sh, we want bin/bash
132 sed -i '/bin\/sh/d' busybox.links || die
133
134 # use poweroff as default halt command
135 sed -i '/sbin\/halt/d' busybox.links || die
136 echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die
137
138 # remove some applet symlinks which are provided by other packages
139 ### patch
140 sed -i '/usr\/bin\/patch/d' busybox.links || die
141 ### e2fsprogs
142 sed -i '/sbin\/fsck/d' busybox.links || die
143 sed -i '/sbin\/mke2fs/d' busybox.links || die
144 sed -i '/sbin\/mkfs.ext2/d' busybox.links || die
145 sed -i '/sbin\/tune2fs/d' busybox.links || die
146 ### binutils
147 sed -i '/usr\/bin\/ar/d' busybox.links || die
148 sed -i '/usr\/bin\/strings/d' busybox.links || die
149 ### diffutils
150 sed -i '/usr\/bin\/cmp/d' busybox.links || die
151 ### umount (use from util-linux, need -t option)
152 sed -i '/bin\/umount/d' busybox.links || die
153
154 # honor usr move
155 sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die
156
157 cd ${MISC_SRCDIR}
158 mmake fbres || die
159 }
160
161 src_install()
162 {
163 cd ${SRCDIR}
164
165 minstallexec busybox || die
166 # set suid bit for suid applets like su
167 mchmod +s /usr/bin/busybox || die
168
169 minstalldir /usr/sbin || die
170 minstallexec halt.sh /usr/sbin/halt || die
171
172 minstalldir /usr/share/busybox || die
173 minstallfile busybox.links /usr/share/busybox || die
174
175 minstalldir /usr/share/busybox/keymaps || die
176 minstallfile de.kmap /usr/share/busybox/keymaps || die
177
178 minstalldir /usr/share/udhcpc || die
179 minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die
180
181 # install syslogd rc script and config
182 minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die
183 minstallfile -s syslog.conf /etc/syslog.conf || die
184
185 # install crond rc script and keep needed directories
186 minstallrc crond.rc crond || die
187 mkeepdir /var/spool/cron/crontabs || die
188
189 # install splash-functions
190 minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die
191 minstalldir /etc/splash || die
192 minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die
193 minstalldir /dev || die
194 mkfifo ${BINDIR}/dev/splashfifo || die
195
196 # install fbres for splash
197 minstallexec ${MISC_SRCDIR}/fbres || die
198
199 # install fbsplash theme
200 cd ${SPLASHTHEME_SRCDIR}
201 make DESTDIR=${BINDIR} install || die
202 # set alx theme as default
203 mlink alx /etc/splash/themes/default || die
204
205 # disable config_protection for themes
206 minstalldir /etc/env.d || die
207 echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die
208
209 # use vt12 for bootsplash and enable SPLASH_X11_TTY for vt03 to supress flickers
210 sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die
211 sed -i 's:^\(SPLASH_X11_TTY=\).*:\1"3":' ${BINDIR}/etc/splash/splash.conf || die
212 sed -i 's:^\(SPLASH_TTY=\).*:\1"12":' ${BINDIR}/etc/splash/splash.conf || die
213 }
214
215 preinstall()
216 {
217 add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d
218 }
219
220 postinstall()
221 {
222 if [ -x ${MROOT}/usr/bin/busybox ]
223 then
224 echo "Setting suid bit for ${MROOT}/usr/bin/busybox"
225 chmod +s ${MROOT}/usr/bin/busybox
226 fi
227
228 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
229 then
230 echo "Setting up busybox links ... "
231 local i
232 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
233 do
234 ln -snf /usr/bin/busybox ${MROOT}/${i}
235 done
236 fi
237
238 if [[ ! -p ${MROOT}/dev/splashfifo ]]
239 then
240 mkfifo ${MROOT}/dev/splashfifo
241 fi
242
243 # run syslogd *after* creating the busybox symlinks!
244 mstartservice syslogd
245
246 # check if intel fb quirk is required
247 if [[ -x ${MROOT}/usr/sbin/alx-hwdetection ]]
248 then
249 local fbdev="$(${MROOT}/usr/sbin/alx-hwdetection intel-fb-quirk)"
250 if [[ ${fbdev} -ge 0 ]]
251 then
252 sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${MROOT}/etc/splash/splash.conf || die
253 fi
254 fi
255 }
256
257 postremove()
258 {
259 mstopservice syslogd
260 }