Contents of /smage/trunk/core/busybox/busybox-1.22.1-r3.smage2
Parent Directory | Revision Log
Revision 5486 -
(show annotations)
(download)
Wed Mar 26 13:02:17 2014 UTC (10 years, 3 months ago) by niro
File size: 6404 byte(s)
Wed Mar 26 13:02:17 2014 UTC (10 years, 3 months ago) by niro
File size: 6404 byte(s)
-use ln from coreutils to support --relative option and added more upstream patches
1 | # $Id$ |
2 | |
3 | PNAME="busybox" |
4 | PVER="1.22.1" |
5 | PBUILD="r3" |
6 | |
7 | PCAT="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/bzip2 |
17 | virtual/cron |
18 | virtual/debianutils |
19 | virtual/dhcp |
20 | virtual/ed |
21 | virtual/eject |
22 | virtual/grep |
23 | virtual/gzip |
24 | virtual/inetutils |
25 | virtual/kbd |
26 | virtual/less |
27 | virtual/net-tools |
28 | virtual/pciutils |
29 | virtual/procps |
30 | virtual/psmisc |
31 | virtual/sed |
32 | virtual/shadow |
33 | virtual/sysvinit |
34 | virtual/sysvinit-tools |
35 | virtual/tar |
36 | virtual/unzip |
37 | virtual/usbutils |
38 | virtual/which |
39 | virtual/wget |
40 | virtual/xz-utils" |
41 | |
42 | # busbox config revision |
43 | CFG_REV=1.17 |
44 | # udhcpc client script revision |
45 | UDHCPC_REV=1.1 |
46 | # busybox.tmpfilesd revision |
47 | TMP_REV=1.2 |
48 | # agetty emulation script revision |
49 | AGETTY_REV=1.3 |
50 | # loadkeys emulation script revision |
51 | LOADKEYS_REV=1.4 |
52 | |
53 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
54 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
55 | |
56 | sminclude mtools systemd alx |
57 | |
58 | SRC_URI=( |
59 | http://www.busybox.net/downloads/${SRCFILE} |
60 | mirror://${PNAME}/${SRCFILE} |
61 | mirror://${PNAME}/config-${CFG_REV} |
62 | mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV} |
63 | mirror://${PNAME}/de.kmap.gz |
64 | mirror://${PNAME}/zgrep.sh |
65 | mirror://${PNAME}/nologin.c |
66 | mirror://${PNAME}/crond.service |
67 | mirror://${PNAME}/busybox.tmpfilesd-${TMP_REV} |
68 | mirror://${PNAME}/loadkeys.sh-${LOADKEYS_REV} |
69 | mirror://${PNAME}/agetty.sh-${AGETTY_REV} |
70 | mirror://${PNAME}/autologin.sh |
71 | mirror://${PNAME}/lat9w-16.psfu.gz |
72 | mirror://${PNAME}/LatArCyrHeb-16.psfu.gz |
73 | mirror://${PNAME}/8859-1_to_uni.trans |
74 | mirror://${PNAME}/${PNAME}-${PVER}-ash.patch |
75 | mirror://${PNAME}/${PNAME}-${PVER}-date.patch |
76 | mirror://${PNAME}/${PNAME}-${PVER}-iplink.patch |
77 | mirror://${PNAME}/${PNAME}-${PVER}-nc.patch |
78 | mirror://${PNAME}/${PNAME}-1.20.2-cp-ignore-onefilesystem.patch |
79 | mirror://${PNAME}/${PNAME}-1.20.2-no-send-signals.patch |
80 | ) |
81 | |
82 | src_prepare() |
83 | { |
84 | munpack ${SRCFILE} || die |
85 | munpack de.kmap.gz ${SRCDIR} || die |
86 | munpack lat9w-16.psfu.gz ${SRCDIR} || die |
87 | munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die |
88 | cd ${SRCDIR} |
89 | |
90 | # official patches |
91 | mpatch ${PNAME}-${PVER}-ash.patch || die |
92 | mpatch ${PNAME}-${PVER}-date.patch || die |
93 | mpatch ${PNAME}-${PVER}-iplink.patch || die |
94 | mpatch ${PNAME}-${PVER}-nc.patch || die |
95 | |
96 | # magellan patches |
97 | # let cp ignore the onefilesystem mode switch (cp -x prints an error) |
98 | mpatch ${PNAME}-1.20.2-cp-ignore-onefilesystem.patch || die |
99 | # do not send any signals on shutdown/reboot, we doing this via sendsignals rc |
100 | mpatch ${PNAME}-1.20.2-no-send-signals.patch || die |
101 | |
102 | # using a custom config |
103 | cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die |
104 | |
105 | # disable unicode support |
106 | sed -i -e 's/.*\(CONFIG_UNICODE_SUPPORT\).*/#\ \1 is not set/' \ |
107 | -e 's/.*\(CONFIG_FEATURE_CHECK_UNICODE_IN_ENV\).*/#\ \1 is not set/' \ |
108 | -e 's/.*\(CONFIG_SUBST_WCHAR\).*/\1=0/' \ |
109 | -e 's/.*\(CONFIG_LAST_SUPPORTED_WCHAR\).*/\1=0/' \ |
110 | .config || die |
111 | } |
112 | |
113 | src_compile() |
114 | { |
115 | cd ${SRCDIR} |
116 | |
117 | make oldconfig || die |
118 | mmake || die |
119 | |
120 | # create a busybox.links file |
121 | HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die |
122 | |
123 | # do not use ash as default sh, we want bin/bash |
124 | sed -i '/bin\/sh$/d' busybox.links || die |
125 | |
126 | # use ln of coreutils to support --relative option |
127 | sed -i '/bin\/ln$/d' busybox.links || die |
128 | |
129 | # setfont resides in /bin on newer systems |
130 | sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die |
131 | |
132 | # honor usr move |
133 | sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die |
134 | |
135 | # build nologin program |
136 | gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die |
137 | } |
138 | |
139 | src_install() |
140 | { |
141 | cd ${SRCDIR} |
142 | |
143 | minstallexec busybox || die |
144 | # set suid bit for suid applets like su |
145 | mchmod +s /usr/bin/busybox || die |
146 | |
147 | minstalldir /usr/share/busybox || die |
148 | minstallfile busybox.links /usr/share/busybox || die |
149 | |
150 | # systemd needs the keymaps in /usr/share/kbd/keymaps and no! symlinks are allowed |
151 | # keymaps must end with .map or .map.gz |
152 | # dracut uses /usr/share/kbd/keymaps too |
153 | minstalldir /usr/share/kbd/keymaps || die |
154 | minstallfile de.kmap /usr/share/kbd/keymaps/de.map || die |
155 | |
156 | minstalldir /usr/share/udhcpc || die |
157 | minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die |
158 | |
159 | # install initsystem services |
160 | minstallunit crond.service || die |
161 | minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die |
162 | |
163 | # loadkeys emulation script |
164 | minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die |
165 | |
166 | # agetty emulation script |
167 | minstalldir /usr/sbin || die |
168 | minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die |
169 | |
170 | # autologin helper script |
171 | minstallexec -s autologin.sh /usr/sbin/autologin || die |
172 | |
173 | # install service configuration files and keep needed directories |
174 | mkeepdir /var/spool/cron/crontabs || die |
175 | |
176 | # install a busybox compilant zgrep script, at last needed by plymouth |
177 | minstallexec -s zgrep.sh /usr/bin/zgrep || die |
178 | |
179 | # install nologin program |
180 | minstalldir /usr/sbin || die |
181 | minstallexec nologin /usr/sbin/nologin || die |
182 | |
183 | # install consolefont and trans from kbd-1.15.5 to fully emulate kbd |
184 | # for systemd without any configfile changes |
185 | # busybox cmds requires the base name without any extension, we provide symlinks for systemd |
186 | minstalldir /usr/share/kbd/consolefonts || die |
187 | minstallfile lat9w-16.psfu /usr/share/kbd/consolefonts/lat9w-16 || die |
188 | mlink lat9w-16 /usr/share/kbd/consolefonts/lat9w-16.psfu || die |
189 | minstallfile LatArCyrHeb-16.psfu /usr/share/kbd/consolefonts/LatArCyrHeb-16 || die |
190 | mlink LatArCyrHeb-16 /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu || die |
191 | minstalldir /usr/share/kbd/consoletrans || die |
192 | minstallfile -s 8859-1_to_uni.trans /usr/share/kbd/consoletrans/8859-1_to_uni || die |
193 | mlink 8859-1_to_uni /usr/share/kbd/consoletrans/8859-1_to_uni.trans || die |
194 | |
195 | # install unimaps directory and a README to suppress warning messages by dracut |
196 | minstalldir /usr/share/kbd/unimaps || die |
197 | MCONFIG=/usr/share/kbd/unimaps/README || die |
198 | mclearconfig || die |
199 | maddconfig '# This directory only exist for compatibility reasons' || die |
200 | } |
201 | |
202 | postinstall() |
203 | { |
204 | if [ -x ${MROOT}/usr/bin/busybox ] |
205 | then |
206 | echo "Setting suid bit for ${MROOT}/usr/bin/busybox" |
207 | chmod +s ${MROOT}/usr/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 /usr/bin/busybox ${MROOT}/${i} |
217 | done |
218 | fi |
219 | } |