Contents of /smage/branches/alx-0_6_0/core/busybox/busybox-1.17.4-r7.smage2
Parent Directory | Revision Log
Revision 2722 -
(show annotations)
(download)
Mon Aug 8 10:21:32 2011 UTC (13 years, 1 month ago) by niro
File size: 6134 byte(s)
Mon Aug 8 10:21:32 2011 UTC (13 years, 1 month ago) by niro
File size: 6134 byte(s)
-fixed a typo
1 | # $Id$ |
2 | |
3 | PNAME="busybox" |
4 | PVER="1.17.4" |
5 | PBUILD="r7" |
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.3 |
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 | http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE} |
73 | mirror://${PNAME}/${MISC_SRCFILE} |
74 | mirror://${PNAME}/${SPLASHTHEME_SRCFILE} |
75 | ) |
76 | |
77 | src_prepare() |
78 | { |
79 | munpack ${SRCFILE} || die |
80 | munpack de.kmap.gz ${SRCDIR} || die |
81 | munpack ${MISC_SRCFILE} || die |
82 | munpack ${SPLASHTHEME_SRCFILE} || die |
83 | cd ${SRCDIR} |
84 | |
85 | # official patches |
86 | # fix tar issues: autodetection of compression modes - fixed with 1.18.3 |
87 | # see: http://lists.busybox.net/pipermail/busybox/2011-February/074737.html |
88 | mpatch ${PNAME}-1.18.2-tar.patch || die |
89 | |
90 | # magellan patches |
91 | # remove broken cflags |
92 | mpatch ${PNAME}-1.15.3-flags.patch || die |
93 | |
94 | # enhanced fbsplash from tykef |
95 | # http://tykef.havlinda.net/programovani/fbsplash/ |
96 | mpatch ${PNAME}-${PVER}-fbsplash-tykef-1.0.patch || die |
97 | |
98 | # using a custom config |
99 | cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die |
100 | |
101 | # disable static linking atm, broken with glibc-2.12 |
102 | sed -i 's/.*\(CONFIG_STATIC\).*/#\ \1 is not set/' .config || die |
103 | } |
104 | |
105 | src_compile() |
106 | { |
107 | cd ${SRCDIR} |
108 | |
109 | make oldconfig || die |
110 | mmake || die |
111 | |
112 | # create a busybox.links file |
113 | HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die |
114 | |
115 | # fix missing applet symlinks |
116 | echo "/bin/du" >> busybox.links || die |
117 | |
118 | # do not use ash as default sh, we want bin/bash |
119 | sed -i '/bin\/sh/d' busybox.links || die |
120 | |
121 | # use poweroff as default halt command |
122 | sed -i '/sbin\/halt/d' busybox.links || die |
123 | echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die |
124 | |
125 | # remove some applet symlinks which are provided by other packages |
126 | ### patch |
127 | sed -i '/usr\/bin\/patch/d' busybox.links || die |
128 | ### e2fsprogs |
129 | sed -i '/sbin\/fsck/d' busybox.links || die |
130 | sed -i '/sbin\/mke2fs/d' busybox.links || die |
131 | sed -i '/sbin\/mkfs.ext2/d' busybox.links || die |
132 | sed -i '/sbin\/tune2fs/d' busybox.links || die |
133 | ### binutils |
134 | sed -i '/usr\/bin\/ar/d' busybox.links || die |
135 | sed -i '/usr\/bin\/strings/d' busybox.links || die |
136 | ### diffutils |
137 | sed -i '/usr\/bin\/cmp/d' busybox.links || die |
138 | ### umount (use from util-linux, need -t option) |
139 | sed -i '/bin\/umount/d' busybox.links || die |
140 | |
141 | cd ${MISC_SRCDIR} |
142 | mmake fbres || die |
143 | } |
144 | |
145 | src_install() |
146 | { |
147 | cd ${SRCDIR} |
148 | |
149 | minstalldir /bin || die |
150 | minstallexec busybox /bin || die |
151 | # set suid bit for suid applets like su |
152 | mchmod +s /bin/busybox || die |
153 | |
154 | minstalldir /sbin || die |
155 | minstallexec halt.sh /sbin/halt || die |
156 | |
157 | minstalldir /usr/share/busybox || die |
158 | minstallfile busybox.links /usr/share/busybox || die |
159 | |
160 | minstalldir /usr/share/busybox/keymaps || die |
161 | minstallfile de.kmap /usr/share/busybox/keymaps || die |
162 | |
163 | minstalldir /usr/share/udhcpc || die |
164 | minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die |
165 | |
166 | # install syslogd rc script |
167 | minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die |
168 | |
169 | # install crond rc script and keep needed directories |
170 | minstallrc crond.rc crond || die |
171 | mkeepdir /var/spool/cron/crontabs || die |
172 | |
173 | # install splash-functions |
174 | minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die |
175 | minstalldir /etc/splash || die |
176 | minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die |
177 | minstalldir /dev || die |
178 | mkfifo ${BINDIR}/dev/splashfifo || die |
179 | |
180 | # install fbres for splash |
181 | minstallexec ${MISC_SRCDIR}/fbres || die |
182 | |
183 | # install fbsplash theme |
184 | cd ${SPLASHTHEME_SRCDIR} |
185 | make DESTDIR=${BINDIR} install || die |
186 | # set alx theme as default |
187 | mlink alx /etc/splash/themes/default || die |
188 | |
189 | # disable config_protection for themes |
190 | minstalldir /etc/env.d || die |
191 | echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die |
192 | |
193 | # enable SPLASH_X11_TTY to supress flickers |
194 | sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die |
195 | } |
196 | |
197 | preinstall() |
198 | { |
199 | add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d |
200 | } |
201 | |
202 | postinstall() |
203 | { |
204 | if [ -x ${MROOT}/bin/busybox ] |
205 | then |
206 | echo "Setting suid bit for ${MROOT}/bin/busybox" |
207 | chmod +s ${MROOT}/bin/busybox |
208 | fi |
209 | |
210 | if [ -f ${MROOT}/usr/share/busybox/busybox.links ] |
211 | then |
212 | echo "Setting up busybox links ... " |
213 | local i |
214 | for i in $(< ${MROOT}/usr/share/busybox/busybox.links) |
215 | do |
216 | ln -snf /bin/busybox ${MROOT}/${i} |
217 | done |
218 | fi |
219 | |
220 | if [[ ! -p ${MROOT}/dev/splashfifo ]] |
221 | then |
222 | mkfifo ${MROOT}/dev/splashfifo |
223 | fi |
224 | |
225 | # run syslogd *after* creating the busybox symlinks! |
226 | mstartservice syslogd |
227 | |
228 | alx_postinstall |
229 | } |
230 | |
231 | postremove() |
232 | { |
233 | mstopservice syslogd |
234 | } |