Magellan Linux

Contents of /smage/trunk/core/util-linux/util-linux-2.22.2-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4642 - (show annotations) (download)
Wed Mar 20 12:13:13 2013 UTC (11 years, 3 months ago) by niro
File size: 9094 byte(s)
-agetty is also provided by busybox
1 # $Id$
2
3 PNAME="util-linux"
4 PVER="2.22.2"
5 PBUILD="r4"
6
7 SPLIT_PACKAGES="libuuid libuuid-dev libblkid libblkid-dev libmount libmount-dev util-linux util-linux-dev uuidd"
8
9 PCAT="sys-apps"
10 HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
11
12 COMMON_DEPEND=">= virtual/glibc"
13
14 UTIL_DEPEND=">= sys-libs/ncurses-5.9
15 >= sys-fs/libudev-185"
16
17 SDEPEND="${COMMON_DEPEND}
18 ${UTIL_DEPEND}
19 >= virtual/kernel-headers
20 >= virtual/sed
21 >= sys-dev/gettext-0.18"
22
23 SRCFILE="${PNAME}-${PVER/_/-}.tar.bz2"
24 SRCDIR="${BUILDDIR}/${PNAME}-${PVER/_/-}"
25
26 sminclude mtools multilib cleanutils
27
28 SRC_URI=(
29 http://www.kernel.org/pub/linux/utils/${PNAME}/v${PVER%.?}/${SRCFILE}
30 http://www.kernel.org/pub/linux/utils/${PNAME}/v${PVER/%_*/}/${SRCFILE}
31 mirror://${PNAME}/${SRCFILE}
32 mirror://${PNAME}/uuidd.tmpfilesd
33 mirror://${PNAME}/${PNAME}-${PVER}-f2fs.patch
34 mirror://${PNAME}/${PNAME}-${PVER}-f2fs-tests.patch
35 )
36
37 UP2DATE="updatecmd \"${HOMEPAGE}/v\$(updatecmd ${HOMEPAGE} | grep v.*/ | sed -n 's/.*v\(.*\)\/.*/\1/;$ p')/?C=M;O=A\" | grep -v 'rc' | lasttarball"
38
39 split_info_libuuid()
40 {
41 DESCRIPTION="Universally unique ID library."
42 DEPEND="${COMMON_DEPEND}"
43 PCAT="sys-libs"
44 }
45
46 split_info_libuuid-dev()
47 {
48 DESCRIPTION="Development files for libuuid."
49 DEPEND="== sys-libs/libuuid-${PVER}"
50 PCAT="sys-libs"
51 }
52
53 split_info_libblkid()
54 {
55 DESCRIPTION="Block device ID library."
56 DEPEND="${COMMON_DEPEND}"
57 PCAT="sys-libs"
58 }
59
60 split_info_libblkid-dev()
61 {
62 DESCRIPTION="Development files for libblkid."
63 DEPEND="== sys-libs/libblkid-${PVER}"
64 PCAT="sys-libs"
65 }
66
67 split_info_libmount()
68 {
69 DESCRIPTION="Device mounting library."
70 DEPEND="${COMMON_DEPEND}"
71 PCAT="sys-libs"
72 }
73
74 split_info_libmount-dev()
75 {
76 DESCRIPTION="Development files for libmount."
77 DEPEND="== sys-libs/libmount-${PVER}"
78 PCAT="sys-libs"
79 }
80
81 split_info_util-linux()
82 {
83 DESCRIPTION="Various useful Linux utilities."
84 DEPEND="== sys-libs/libuuid-${PVER}
85 == sys-libs/libblkid-${PVER}
86 == sys-libs/libmount-${PVER}
87 ${UTIL_DEPEND}"
88 PROVIDE="virtual/eject"
89 }
90
91 split_info_util-linux()
92 {
93 DESCRIPTION="Various useful Linux utilities."
94 DEPEND="== sys-libs/libuuid-${PVER}
95 == sys-libs/libblkid-${PVER}
96 == sys-libs/libmount-${PVER}
97 ${UTIL_DEPEND}"
98 PROVIDE="virtual/eject"
99 }
100
101 split_info_util-linux-dev()
102 {
103 DESCRIPTION="Development files for util-linux."
104 DEPEND="== sys-apps/util-linux-${PVER}
105 == sys-libs/libuuid-dev-${PVER}
106 == sys-libs/libblkid-dev-${PVER}
107 == sys-libs/libmount-dev-${PVER}"
108 }
109
110 split_info_uuidd()
111 {
112 DESCRIPTION="Helper daemon to guarantee uniqueness of time-based UUIDs."
113 DEPEND="== sys-libs/libuuid-${PVER}
114 ${COMMON_DEPEND}"
115 }
116
117 src_prepare()
118 {
119 munpack ${SRCFILE} || die
120
121 # f2fs support
122 mpatch ${PNAME}-${PVER}-f2fs.patch || die
123 mpatch ${PNAME}-${PVER}-f2fs-tests.patch || die
124
125 # fhs compatibility
126 all-abis sed -i 's:etc/adjtime:var/lib/hwclock/adjtime:' \
127 include/pathnames.h \
128 sys-utils/hwclock.c sys-utils/hwclock.8 \
129 sys-utils/rtcwake.c sys-utils/rtcwake.8 || die
130
131 # satisfy usr-move
132 all-abis sed -i \
133 -e "s:sbindir=/sbin:sbindir=/usr/sbin:" \
134 -e "s:bindir=/bin:bindir=/usr/bin:" \
135 -e "s:libdir=/lib:libdir=/usr/lib:" \
136 -e 's:localstatedir=\${prefix}/\${localstatedir}:localstatedir=\${localstatedir}:' \
137 configure.ac || die
138
139 # regen configure
140 mautoreconf || die
141 }
142
143 src_compile()
144 {
145 # enabled libmount-mount to utilize mount with a mtab symlink
146 # which is needed by systemd
147
148 # we are using blkid from util linux now (--with-fsprobe=built --enable-fsck)
149 # which merges the old blkid from e2fsprogs and udevs libvolume
150 # see: http://lists.freedesktop.org/archives/hal-commit/2009-May/004936.html
151 mconfigure \
152 --localstatedir=/run \
153 --exec-prefix=/usr \
154 --with-systemdsystemunitdir=/usr/lib/systemd/system \
155 --disable-nls \
156 --enable-agetty \
157 --enable-cramfs \
158 --enable-partx \
159 --enable-raw \
160 --enable-rename \
161 --enable-schedutils \
162 --enable-write \
163 --disable-reset \
164 --disable-login \
165 --disable-su \
166 --disable-sulogin \
167 --disable-kill \
168 --disable-last \
169 --disable-mesg \
170 --disable-wall \
171 --enable-fsck \
172 --enable-libmount \
173 --disable-silent-rules \
174 --enable-socket-activation \
175 || die
176
177 mmake || die
178 }
179
180 src_install_libuuid()
181 {
182 mmake DESTDIR=${BINDIR} install || die
183 zapmost ${BINDIR} \
184 usr/$(mlibdir)/libuuid.so.\* \
185 $([[ $(mlibdir) != lib ]] && echo "usr/lib/libuuid.so.*") \
186 || die
187 }
188
189 src_install_libuuid-dev()
190 {
191 mmake DESTDIR=${BINDIR} install || die
192 zapmost ${BINDIR} \
193 usr/include/uuid \
194 usr/$(mlibdir)/libuuid.so \
195 usr/$(mlibdir)/libuuid.la \
196 usr/$(mlibdir)/libuuid.a \
197 usr/$(mlibdir)/pkgconfig/uuid.pc \
198 $([[ $(mlibdir) != lib ]] && echo "usr/lib/libuuid.so usr/lib/libuuid.a usr/lib/libuuid.la usr/lib/pkgconfig/uuid.pc") \
199 || die
200 }
201
202 src_install_libblkid()
203 {
204 mmake DESTDIR=${BINDIR} install || die
205 zapmost ${BINDIR} \
206 usr/$(mlibdir)/libblkid.so.\* \
207 $([[ $(mlibdir) != lib ]] && echo "usr/lib/libblkid.so.*") \
208 || die
209 }
210
211 src_install_libblkid-dev()
212 {
213 mmake DESTDIR=${BINDIR} install || die
214 zapmost ${BINDIR} \
215 usr/include/blkid \
216 usr/$(mlibdir)/libblkid.so \
217 usr/$(mlibdir)/libblkid.la \
218 usr/$(mlibdir)/libblkid.a \
219 usr/$(mlibdir)/pkgconfig/blkid.pc \
220 $([[ $(mlibdir) != lib ]] && echo "usr/lib/libblkid.so usr/lib/libblkid.la usr/lib/libblkid.a usr/lib/pkgconfig/blkid.pc") \
221 || die
222 }
223
224 src_install_libmount()
225 {
226 mmake DESTDIR=${BINDIR} install || die
227 zapmost ${BINDIR} \
228 usr/$(mlibdir)/libmount.so.\* \
229 $([[ $(mlibdir) != lib ]] && echo "usr/lib/libmount.so.*") \
230 || die
231 }
232
233 src_install_libmount-dev()
234 {
235 mmake DESTDIR=${BINDIR} install || die
236 zapmost ${BINDIR} \
237 usr/include/libmount \
238 usr/$(mlibdir)/libmount.so \
239 usr/$(mlibdir)/libmount.la \
240 usr/$(mlibdir)/libmount.a \
241 usr/$(mlibdir)/pkgconfig/mount.pc \
242 $([[ $(mlibdir) != lib ]] && echo "usr/lib/libmount.so usr/lib/libmount.la usr/lib/libmount.a usr/lib/pkgconfig/mount.pc") \
243 || die
244 }
245
246 src_install_util-linux()
247 {
248 mmake DESTDIR=${BINDIR} install || die
249
250 # keep fullfeatured /sbin/blkid for better fstype guessing and uuid handling
251 # mcookie is needed by xorg's startx
252 # keep fullfeatured mount/umount for systemd
253 # mountpoint is required by mage update-tarball / maybe using busbox version?
254 zapmost ${BINDIR} \
255 usr/bin/mount \
256 usr/bin/umount \
257 usr/sbin/fsck \
258 usr/sbin/cfdisk \
259 usr/sbin/sfdisk \
260 usr/sbin/blkid \
261 usr/bin/mcookie \
262 || die
263 }
264
265 src_install_util-linux-dev()
266 {
267 # needed directories
268 mkeepdir /var/lib/hwclock || die
269
270 mmake DESTDIR=${BINDIR} install || die
271
272 # remove files owned by other packages
273 mdelete -r /usr/include/uuid || die
274 mdelete -r /usr/include/blkid || die
275 mdelete -r /usr/include/libmount || die
276 rm ${BINDIR}/usr/$(mlibdir)/libuuid.* || die
277 rm ${BINDIR}/usr/$(mlibdir)/libblkid.* || die
278 rm ${BINDIR}/usr/$(mlibdir)/libmount.* || die
279 mdelete /usr/$(mlibdir)/pkgconfig/uuid.pc || die
280 mdelete /usr/$(mlibdir)/pkgconfig/blkid.pc || die
281 mdelete /usr/$(mlibdir)/pkgconfig/mount.pc || die
282 if [[ $(mlibdir) != lib ]]
283 then
284 rm ${BINDIR}/usr/lib/libuuid.* || die
285 rm ${BINDIR}/usr/lib/libblkid.* || die
286 rm ${BINDIR}/usr/lib/libmount.* || die
287 mdelete /usr/lib/pkgconfig/uuid.pc || die
288 mdelete /usr/lib/pkgconfig/blkid.pc || die
289 mdelete /usr/lib/pkgconfig/mount.pc || die
290 fi
291 mdelete /usr/sbin/uuidd || die
292 mdelete /usr/share/man/man8/uuidd.8 || die
293 mdelete -r /usr/lib/systemd/system || die
294
295 # alx
296 mdelete /usr/bin/mount || die
297 mdelete /usr/bin/umount || die
298 mdelete /usr/sbin/fsck || die
299 mdelete /usr/sbin/cfdisk || die
300 mdelete /usr/sbin/sfdisk || die
301 mdelete /usr/sbin/blkid || die
302 mdelete /usr/bin/mcookie || die
303
304 # provided by busybox
305 mdelete /usr/bin/mountpoint || die
306 mdelete /usr/sbin/agetty || die
307
308 minstalldocs AUTHORS COPYING ChangeLog DECRECATED NEWS README* TODO || die
309 }
310
311 src_install_uuidd()
312 {
313 mmake DESTDIR=${BINDIR} install || die
314 zapmost ${BINDIR} \
315 usr/share/man/man8/uuidd.8 \
316 usr/sbin/uuidd \
317 /usr/lib/systemd/system \
318 || die
319
320 mkeepdir /var/lib/libuuid || die
321 mchown uuidd:uuidd /var/lib/libuuid || die
322 mchmod 2755 /var/lib/libuuid || die
323
324 mkeepdir /run/uuidd || die
325 mchown uuidd:uuidd /run/uuidd || die
326 mchmod 2755 /run/uuidd || die
327
328 # add systemd files
329 minstalltmp uuidd.tmpfilesd uuidd.conf || die
330 }
331
332 preinstall_util-linux()
333 {
334 if [[ ! -z $(magequery -n linux32) ]]
335 then
336 echo -e ${COLRED}
337 echo -e "Error: dev-util/linux32 is installed!!"
338 echo -e "linux32 is now provided by util-linux and doesn't need an extra package anymore."
339 echo -e "Please uninstall dev-util/linux32 first!"
340 echo -e ${COLDEFAULT}
341 die "dev-util/linux32 found!"
342 fi
343 if [[ ! -z $(magequery -n eject) ]]
344 then
345 echo -e ${COLRED}
346 echo -e "Error: sys-apps/eject is installed!!"
347 echo -e "eject is now provided by util-linux and doesn't need an extra package anymore."
348 echo -e "Please uninstall sys-apps/eject first!"
349 echo -e ${COLDEFAULT}
350 die "sys-apps/eject found!"
351 fi
352 }
353
354 preinstall_uuidd()
355 {
356 ${MLIBDIR}/mgroupadd uuidd
357 ${MLIBDIR}/museradd -o "-g uuidd -d /var/lib/libuuid -s /sbin/nologin" uuidd
358 }
359
360 postinstall_uuidd()
361 {
362 mstartunit uuidd.service
363 }
364
365 postremove_uuidd()
366 {
367 mstopunit uuidd.service
368 }