Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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