Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2052 - (show annotations) (download)
Wed May 11 20:56:53 2011 UTC (13 years, 1 month ago) by niro
File size: 3856 byte(s)
-added missing postinstall
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.17.4"
5 PBUILD="r1"
6
7 PCATEGORIE="sys-apps"
8 STATE="unstable"
9
10 DESCRIPTION="BusyBox combines tiny versions of many common UNIX utilities into a single small executable."
11 HOMEPAGE="http://www.busybox.net/"
12
13 # shared busybox needs glibc
14 DEPEND=">= virtual/glibc"
15
16 PROVIDE="virtual/sed
17 virtual/tar
18 virtual/usbutils
19 virtual/pciutils
20 virtual/debianutils
21 virtual/which
22 virtual/wget
23 virtual/grep
24 virtual/bzip2
25 virtual/gzip
26 virtual/syslog
27 virtual/less
28 virtual/net-tools
29 virtual/inetutils
30 virtual/kbd
31 virtual/procps
32 virtual/psmisc
33 virtual/dhcp"
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.3
41
42 SRCFILE="${PNAME}-${PVER}.tar.bz2"
43 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
44
45 sminclude mtools alx
46
47 SRC_URI=(
48 http://www.busybox.net/downloads/${SRCFILE}
49 mirror://${PNAME}/${SRCFILE}
50 mirror://${PNAME}/config-${CFG_CVS_REV}
51 mirror://${PNAME}/udhcpc.sh-${UDHCPC_CVS_REV}
52 mirror://${PNAME}/de.kmap.gz
53 mirror://${PNAME}/syslogd.rc-${SYSLOGD_CVS_REV}
54 mirror://${PNAME}/${PNAME}-1.15.3-flags.patch
55 mirror://${PNAME}/${PNAME}-1.18.2-tar.patch
56 )
57
58 src_prepare()
59 {
60 munpack ${SRCFILE} || die
61 munpack de.kmap.gz ${SRCDIR} || die
62 cd ${SRCDIR}
63
64 # official patches
65 # fix tar issues: autodetection of compression modes - fixed with 1.18.3
66 # see: http://lists.busybox.net/pipermail/busybox/2011-February/074737.html
67 mpatch ${PNAME}-1.18.2-tar.patch || die
68
69 # magellan patches
70 # remove broken cflags
71 mpatch ${PNAME}-1.15.3-flags.patch || die
72
73 # using a custom config
74 cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die
75
76 # disable static linking atm, broken with glibc-2.12
77 sed -i 's/.*\(CONFIG_STATIC\).*/#\ \1 is not set/' .config || die
78 }
79
80 src_compile()
81 {
82 cd ${SRCDIR}
83
84 make oldconfig || die
85 mmake || die
86
87 # create a busybox.links file
88 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
89
90 # fix missing applet symlinks
91 echo "/bin/du" >> busybox.links || die
92
93 # do not use ash as default sh, we want bin/bash
94 sed -i '/bin\/sh/d' busybox.links || die
95
96 # use poweroff as default halt command
97 sed -i '/sbin\/halt/d' busybox.links || die
98 echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die
99
100 # remove some applet symlinks which are provided by other packages
101 ### patch
102 sed -i '/usr\/bin\/patch/d' busybox.links || die
103 ### e2fsprogs
104 sed -i '/sbin\/fsck/d' busybox.links || die
105 sed -i '/sbin\/mke2fs/d' busybox.links || die
106 sed -i '/sbin\/mkfs.ext2/d' busybox.links || die
107 sed -i '/sbin\/tune2fs/d' busybox.links || die
108 ### binutils
109 sed -i '/usr\/bin\/ar/d' busybox.links || die
110 sed -i '/usr\/bin\/strings/d' busybox.links || die
111 ### diffutils
112 sed -i '/usr\/bin\/cmp/d' busybox.links || die
113 }
114
115 src_install()
116 {
117 cd ${SRCDIR}
118
119 minstalldir /bin || die
120 minstallexec busybox /bin || die
121 # set suid bit for suid applets like su
122 mchmod +s /bin/busybox || die
123
124 minstalldir /sbin || die
125 minstallexec halt.sh /sbin/halt || die
126
127 minstalldir /usr/share/busybox || die
128 minstallfile busybox.links /usr/share/busybox || die
129
130 minstalldir /usr/share/busybox/keymaps || die
131 minstallfile de.kmap /usr/share/busybox/keymaps || die
132
133 minstalldir /usr/share/udhcpc || die
134 minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die
135
136 # install syslogd rc script
137 minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die
138 }
139
140 postinstall()
141 {
142 mstartservice syslogd
143
144 if [ -x ${MROOT}/bin/busybox ]
145 then
146 echo "Setting suid bit for ${MROOT}/bin/busybox"
147 chmod +s ${MROOT}/bin/busybox
148 fi
149
150 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
151 then
152 echo "Setting up busybox links ... "
153 local i
154 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
155 do
156 ln -snf /bin/busybox ${MROOT}/${i}
157 done
158 fi
159
160 alx_postinstall
161 }
162
163 postremove()
164 {
165 mstopservice syslogd
166 }