Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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