Magellan Linux

Contents of /smage/trunk/core/busybox/busybox-1.19.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3133 - (show annotations) (download)
Thu Sep 8 21:41:46 2011 UTC (12 years, 9 months ago) by niro
File size: 5787 byte(s)
-added upstream crond patch and added a patch that tar supports seamless xz uncompression (tar -J)
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.19.2"
5 PBUILD="r1"
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 virtual/xz-utils"
35
36 # busbox config CVS revision
37 CFG_CVS_REV=1.14
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.3
44 # splash-functions.rc cvs revision
45 SPLASHRC_CVS_REV=1.3
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.19.2-crond.patch
71 mirror://${PNAME}/splash-functions.rc-${SPLASHRC_CVS_REV}
72 mirror://${PNAME}/splash.conf-${SPLASHCONF_CVS_REV}
73 mirror://${PNAME}/${PNAME}-1.19.0-fbsplash-tykef-1.0.patch
74 http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE}
75 mirror://${PNAME}/${MISC_SRCFILE}
76 mirror://${PNAME}/${SPLASHTHEME_SRCFILE}
77 )
78
79 src_prepare()
80 {
81 munpack ${SRCFILE} || die
82 munpack de.kmap.gz ${SRCDIR} || die
83 munpack ${MISC_SRCFILE} || die
84 munpack ${SPLASHTHEME_SRCFILE} || die
85 cd ${SRCDIR}
86
87 # official patches
88 mpatch ${PNAME}-1.19.2-crond.patch || die
89
90 # magellan patches
91 # remove broken cflags
92 mpatch ${PNAME}-1.15.3-flags.patch || die
93 # support seamless xz uncompress support in tar (tar -J)
94 mpatch ${PNAME}-1.19.2-tar-seamless-xz.patch || die
95
96 # enhanced fbsplash from tykef
97 # http://tykef.havlinda.net/programovani/fbsplash/
98 mpatch ${PNAME}-1.19.0-fbsplash-tykef-1.0.patch || die
99
100 # using a custom config
101 cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die
102
103 # hotfix for glibc-2.14, rpc interface not supported anymore
104 sed -i 's/.*\(CONFIG_FEATURE_MOUNT_NFS\).*/#\ \1 is not set/' .config || die
105 }
106
107 src_compile()
108 {
109 cd ${SRCDIR}
110
111 make oldconfig || die
112 mmake || die
113
114 # create a busybox.links file
115 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
116
117 # fix missing applet symlinks
118 echo "/bin/du" >> busybox.links || die
119
120 # do not use ash as default sh, we want bin/bash
121 sed -i '/bin\/sh/d' busybox.links || die
122
123 # use poweroff as default halt command
124 sed -i '/sbin\/halt/d' busybox.links || die
125 echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die
126
127 # remove some applet symlinks which are provided by other packages
128 ### umount (use from util-linux, need -t option)
129 sed -i '/bin\/umount/d' busybox.links || die
130
131 cd ${MISC_SRCDIR}
132 mmake fbres || die
133 }
134
135 src_install()
136 {
137 cd ${SRCDIR}
138
139 minstalldir /bin || die
140 minstallexec busybox /bin || die
141 # set suid bit for suid applets like su
142 mchmod +s /bin/busybox || die
143
144 minstalldir /sbin || die
145 minstallexec halt.sh /sbin/halt || die
146
147 minstalldir /usr/share/busybox || die
148 minstallfile busybox.links /usr/share/busybox || die
149
150 minstalldir /usr/share/busybox/keymaps || die
151 minstallfile de.kmap /usr/share/busybox/keymaps || die
152
153 minstalldir /usr/share/udhcpc || die
154 minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die
155
156 # install syslogd rc script and config
157 minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die
158 minstallfile -s syslog.conf /etc/syslog.conf || die
159
160 # install crond rc script and keep needed directories
161 minstallrc crond.rc crond || die
162 mkeepdir /var/spool/cron/crontabs || die
163
164 # install splash-functions
165 minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die
166 minstalldir /etc/splash || die
167 minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die
168 minstalldir /dev || die
169 mkfifo ${BINDIR}/dev/splashfifo || die
170
171 # install fbres for splash
172 minstallexec ${MISC_SRCDIR}/fbres || die
173
174 # install fbsplash theme
175 cd ${SPLASHTHEME_SRCDIR}
176 make DESTDIR=${BINDIR} install || die
177 # set alx theme as default
178 mlink alx /etc/splash/themes/default || die
179
180 # disable config_protection for themes
181 minstalldir /etc/env.d || die
182 echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die
183
184 # enable SPLASH_X11_TTY to supress flickers
185 sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die
186 }
187
188 preinstall()
189 {
190 add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d
191 }
192
193 postinstall()
194 {
195 if [ -x ${MROOT}/bin/busybox ]
196 then
197 echo "Setting suid bit for ${MROOT}/bin/busybox"
198 chmod +s ${MROOT}/bin/busybox
199 fi
200
201 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
202 then
203 echo "Setting up busybox links ... "
204 local i
205 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
206 do
207 ln -snf /bin/busybox ${MROOT}/${i}
208 done
209 fi
210
211 if [[ ! -p ${MROOT}/dev/splashfifo ]]
212 then
213 mkfifo ${MROOT}/dev/splashfifo
214 fi
215
216 # run syslogd *after* creating the busybox symlinks!
217 mstartservice syslogd
218
219 alx_postinstall
220 }
221
222 postremove()
223 {
224 mstopservice syslogd
225 }