Magellan Linux

Annotation of /smage/trunk/core/busybox/busybox-1.20.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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