Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3513 - (show annotations) (download)
Thu Apr 19 15:49:06 2012 UTC (12 years ago) by niro
File size: 6874 byte(s)
-fixed whitespaces
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.17.4"
5 PBUILD="r9"
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
35 # busbox config CVS revision
36 CFG_CVS_REV=1.13
37 # udhcpc client script CVS revision
38 UDHCPC_CVS_REV=1.1
39 # syslogd.rc cvs revision
40 SYSLOGD_CVS_REV=1.4
41 # splash.conf cvs revision
42 SPLASHCONF_CVS_REV=1.3
43 # splash-functions.rc cvs revision
44 SPLASHRC_CVS_REV=1.4
45
46 SRCFILE="${PNAME}-${PVER}.tar.bz2"
47 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
48
49 MISC_PVER="0.1.8"
50 MISC_SRCFILE="miscsplashutils-${MISC_PVER}.tar.bz2"
51 MISC_SRCDIR="${BUILDDIR}/miscsplashutils-${MISC_PVER}"
52
53 SPLASHTHEME_PVER="1.0"
54 SPLASHTHEME_SRCFILE="alx-theme-busybox-${SPLASHTHEME_PVER}.tar.bz2"
55 SPLASHTHEME_SRCDIR="${BUILDDIR}/alx-theme-busybox-${SPLASHTHEME_PVER}"
56
57 sminclude mtools alx
58
59 SRC_URI=(
60 http://www.busybox.net/downloads/${SRCFILE}
61 mirror://${PNAME}/${SRCFILE}
62 mirror://${PNAME}/config-${CFG_CVS_REV}
63 mirror://${PNAME}/udhcpc.sh-${UDHCPC_CVS_REV}
64 mirror://${PNAME}/de.kmap.gz
65 mirror://${PNAME}/syslogd.rc-${SYSLOGD_CVS_REV}
66 mirror://${PNAME}/crond.rc
67 mirror://${PNAME}/${PNAME}-1.15.3-flags.patch
68 mirror://${PNAME}/${PNAME}-1.18.2-tar.patch
69 mirror://${PNAME}/splash-functions.rc-${SPLASHRC_CVS_REV}
70 mirror://${PNAME}/splash.conf-${SPLASHCONF_CVS_REV}
71 mirror://${PNAME}/${PNAME}-${PVER}-fbsplash-tykef-1.0.patch
72 mirror://${PNAME}/${PNAME}-${PVER}-fbsplash-reload-background-image.patch
73 http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE}
74 mirror://${PNAME}/${MISC_SRCFILE}
75 mirror://${PNAME}/${SPLASHTHEME_SRCFILE}
76 )
77
78 src_prepare()
79 {
80 munpack ${SRCFILE} || die
81 munpack de.kmap.gz ${SRCDIR} || die
82 munpack ${MISC_SRCFILE} || die
83 munpack ${SPLASHTHEME_SRCFILE} || die
84 cd ${SRCDIR}
85
86 # official patches
87 # fix tar issues: autodetection of compression modes - fixed with 1.18.3
88 # see: http://lists.busybox.net/pipermail/busybox/2011-February/074737.html
89 mpatch ${PNAME}-1.18.2-tar.patch || die
90
91 # magellan patches
92 # remove broken cflags
93 mpatch ${PNAME}-1.15.3-flags.patch || die
94
95 # enhanced fbsplash from tykef
96 # http://tykef.havlinda.net/programovani/fbsplash/
97 mpatch ${PNAME}-${PVER}-fbsplash-tykef-1.0.patch || die
98
99 # fbsplash: adds 'image:' cmd to be able to reload the background image
100 # requires the tykef patch
101 mpatch ${PNAME}-${PVER}-fbsplash-reload-background-image.patch || die
102
103 # using a custom config
104 cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die
105
106 # disable static linking atm, broken with glibc-2.12
107 sed -i 's/.*\(CONFIG_STATIC\).*/#\ \1 is not set/' .config || die
108 }
109
110 src_compile()
111 {
112 cd ${SRCDIR}
113
114 make oldconfig || die
115 mmake || die
116
117 # create a busybox.links file
118 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
119
120 # fix missing applet symlinks
121 echo "/bin/du" >> busybox.links || die
122
123 # do not use ash as default sh, we want bin/bash
124 sed -i '/bin\/sh/d' busybox.links || die
125
126 # use poweroff as default halt command
127 sed -i '/sbin\/halt/d' busybox.links || die
128 echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die
129
130 # remove some applet symlinks which are provided by other packages
131 ### patch
132 sed -i '/usr\/bin\/patch/d' busybox.links || die
133 ### e2fsprogs
134 sed -i '/sbin\/fsck/d' busybox.links || die
135 sed -i '/sbin\/mke2fs/d' busybox.links || die
136 sed -i '/sbin\/mkfs.ext2/d' busybox.links || die
137 sed -i '/sbin\/tune2fs/d' busybox.links || die
138 ### binutils
139 sed -i '/usr\/bin\/ar/d' busybox.links || die
140 sed -i '/usr\/bin\/strings/d' busybox.links || die
141 ### diffutils
142 sed -i '/usr\/bin\/cmp/d' busybox.links || die
143 ### umount (use from util-linux, need -t option)
144 sed -i '/bin\/umount/d' busybox.links || die
145
146 cd ${MISC_SRCDIR}
147 mmake fbres || die
148 }
149
150 src_install()
151 {
152 cd ${SRCDIR}
153
154 minstalldir /bin || die
155 minstallexec busybox /bin || die
156 # set suid bit for suid applets like su
157 mchmod +s /bin/busybox || die
158
159 minstalldir /sbin || die
160 minstallexec halt.sh /sbin/halt || die
161
162 minstalldir /usr/share/busybox || die
163 minstallfile busybox.links /usr/share/busybox || die
164
165 minstalldir /usr/share/busybox/keymaps || die
166 minstallfile de.kmap /usr/share/busybox/keymaps || die
167
168 minstalldir /usr/share/udhcpc || die
169 minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die
170
171 # install syslogd rc script
172 minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die
173
174 # install crond rc script and keep needed directories
175 minstallrc crond.rc crond || die
176 mkeepdir /var/spool/cron/crontabs || die
177
178 # install splash-functions
179 minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die
180 minstalldir /etc/splash || die
181 minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die
182 minstalldir /dev || die
183 mkfifo ${BINDIR}/dev/splashfifo || die
184
185 # install fbres for splash
186 minstallexec ${MISC_SRCDIR}/fbres || die
187
188 # install fbsplash theme
189 cd ${SPLASHTHEME_SRCDIR}
190 make DESTDIR=${BINDIR} install || die
191 # set alx theme as default
192 mlink alx /etc/splash/themes/default || die
193
194 # disable config_protection for themes
195 minstalldir /etc/env.d || die
196 echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die
197
198 # use vt12 for bootsplash and enable SPLASH_X11_TTY for vt03 to supress flickers
199 sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die
200 sed -i 's:^\(SPLASH_X11_TTY=\).*:\1"3":' ${BINDIR}/etc/splash/splash.conf || die
201 sed -i 's:^\(SPLASH_TTY=\).*:\1"12":' ${BINDIR}/etc/splash/splash.conf || die
202 }
203
204 preinstall()
205 {
206 add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d
207 }
208
209 postinstall()
210 {
211 if [ -x ${MROOT}/bin/busybox ]
212 then
213 echo "Setting suid bit for ${MROOT}/bin/busybox"
214 chmod +s ${MROOT}/bin/busybox
215 fi
216
217 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
218 then
219 echo "Setting up busybox links ... "
220 local i
221 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
222 do
223 ln -snf /bin/busybox ${MROOT}/${i}
224 done
225 fi
226
227 if [[ ! -p ${MROOT}/dev/splashfifo ]]
228 then
229 mkfifo ${MROOT}/dev/splashfifo
230 fi
231
232 # run syslogd *after* creating the busybox symlinks!
233 mstartservice syslogd
234
235 # check if intel fb quirk is required
236 if [[ -x ${MROOT}/sbin/alx-hwdetection ]]
237 then
238 local fbdev="$(${MROOT}/sbin/alx-hwdetection intel-fb-quirk)"
239 if [[ ${fbdev} -ne 0 ]]
240 then
241 sed -i "s:^\(SPLASH_OPTS=\).*:\1\"-d /dev/fb${fbdev}\":" ${MROOT}/etc/splash/splash.conf || die
242 fi
243 fi
244
245 alx_postinstall
246 }
247
248 postremove()
249 {
250 mstopservice syslogd
251 }