[package] util-linux: compile with -fPIC, some users of its libuuid.a require it...
[openwrt/svn-archive/archive.git] / package / util-linux / Makefile
1 #
2 # Copyright (C) 2007-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=util-linux
11 PKG_VERSION:=2.21.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.21
16 PKG_MD5SUM:=ad602dcd528f340b1329cfa6200d8f80
17
18 PKG_BUILD_PARALLEL:=1
19 PKG_BUILD_DEPENDS:=libncurses
20 PKG_FIXUP:=autoreconf
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/util-linux/Default
25 SECTION:=utils
26 CATEGORY:=Utilities
27 URL:=http://www.kernel.org/pub/linux/utils/util-linux/
28 endef
29
30 CONFIGURE_VARS += \
31 scanf_cv_alloc_modifier="ms"
32
33 CONFIGURE_ARGS += \
34 --enable-new-mount \
35 --with-ncurses \
36 --disable-nls \
37 --disable-tls
38
39 TARGET_CFLAGS += $(FPIC)
40
41 define Build/InstallDev
42 $(MAKE) -C $(PKG_BUILD_DIR) \
43 BUILDCC="$(HOSTCC)" \
44 DESTDIR="$(1)" \
45 installdirs install-data
46
47 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
48 $(CP) $(PKG_BUILD_DIR)/libblkid/blkid.pc $(1)/usr/lib/pkgconfig
49 $(CP) $(PKG_BUILD_DIR)/libmount/mount.pc $(1)/usr/lib/pkgconfig
50 $(CP) $(PKG_BUILD_DIR)/libuuid/uuid.pc $(1)/usr/lib/pkgconfig
51
52 $(INSTALL_DIR) $(1)/usr/include/blkid
53 $(CP) $(PKG_BUILD_DIR)/libblkid/src/blkid.h $(1)/usr/include/blkid
54 $(INSTALL_DIR) $(1)/usr/include/libmount
55 $(CP) $(PKG_BUILD_DIR)/libmount/src/libmount.h $(1)/usr/include/libmount
56 $(INSTALL_DIR) $(1)/usr/include/uuid
57 $(CP) $(PKG_BUILD_DIR)/libuuid/src/uuid.h $(1)/usr/include/uuid
58
59 $(INSTALL_DIR) $(1)/usr/lib
60 $(CP) $(PKG_BUILD_DIR)/libblkid/src/.libs/libblkid.{a,so.*} $(1)/usr/lib
61 $(CP) $(PKG_BUILD_DIR)/libmount/src/.libs/libmount.{a,so.*} $(1)/usr/lib
62 $(CP) $(PKG_BUILD_DIR)/libuuid/src/.libs/libuuid.{a,so.*} $(1)/usr/lib
63 endef
64
65 define Package/libblkid
66 $(call Package/util-linux/Default)
67 TITLE:=block device id library
68 SECTION:=libs
69 CATEGORY:=Libraries
70 endef
71
72 define Package/libblkid/description
73 The libblkid library is used to identify block devices (disks) as to their
74 content (e.g. filesystem type, partitions) as well as extracting additional
75 information such as filesystem labels/volume names, partitions, unique
76 identifiers/serial numbers...
77 endef
78
79 define Package/libmount
80 $(call Package/util-linux/Default)
81 TITLE:=mount library
82 SECTION:=libs
83 CATEGORY:=Libraries
84 endef
85
86 define Package/libblkid/description
87 The libmount library is used to parse /etc/fstab, /etc/mtab and
88 /proc/self/mountinfo files, manage the mtab file, evaluate mount options...
89 endef
90
91 define Package/libuuid
92 $(call Package/util-linux/Default)
93 TITLE:=DCE compatible Universally Unique Identifier library
94 SECTION:=libs
95 CATEGORY:=Libraries
96 endef
97
98 define Package/libuuid/description
99 The UUID library is used to generate unique identifiers for objects
100 that may be accessible beyond the local system. This library
101 generates UUIDs compatible with those created by the Open Software
102 Foundation (OSF) Distributed Computing Environment (DCE) utility.
103 endef
104
105 define Package/agetty
106 $(call Package/util-linux/Default)
107 TITLE:=alternative Linux getty
108 SUBMENU=Terminal
109 endef
110
111 define Package/agetty/description
112 agetty opens a tty port, prompts for a login name and invokes the
113 /bin/login command
114 endef
115
116 define Package/blkid
117 $(call Package/util-linux/Default)
118 TITLE:=locate/print block device attributes
119 DEPENDS:= +libblkid +libuuid
120 SUBMENU=disc
121 endef
122
123 define Package/blkid/description
124 The blkid program is the command-line interface to working with the libblkid
125 library.
126 endef
127
128 define Package/cal
129 $(call Package/util-linux/Default)
130 TITLE:=display a calendar
131 DEPENDS:= +libncurses
132 endef
133
134 define Package/cal/description
135 cal displays a simple calendar
136 endef
137
138 define Package/cfdisk
139 $(call Package/util-linux/Default)
140 TITLE:=display or manipulate disk partition table
141 DEPENDS:= +libblkid +libncurses +libuuid
142 SUBMENU:=disc
143 endef
144
145 define Package/cfdisk/description
146 cfdisk is a curses-based program for partitioning any hard disk drive
147 endef
148
149 define Package/dmesg
150 $(call Package/util-linux/Default)
151 TITLE:=print or control the kernel ring buffer
152 endef
153
154 define Package/dmesg/description
155 dmesg is used to examine or control the kernel ring buffer
156 endef
157
158 define Package/fdisk
159 $(call Package/util-linux/Default)
160 TITLE:=manipulate disk partition table
161 DEPENDS:= +libblkid +libuuid
162 SUBMENU=disc
163 endef
164
165 define Package/fdisk/description
166 a menu-driven program for creation and manipulation of partition tables
167 endef
168
169 define Package/findfs
170 $(call Package/util-linux/Default)
171 TITLE:=find a filesystem by label or UUID
172 DEPENDS:= +libblkid +libuuid
173 SUBMENU=disc
174 endef
175
176 define Package/findfs/description
177 findfs will search the disks in the system looking for a filesystem which has
178 a label matching label or a UUID equal to uuid
179 endef
180
181 define Package/flock
182 $(call Package/util-linux/Default)
183 TITLE:=manage locks from shell scripts
184 endef
185
186 define Package/flock/description
187 manages flock locks from within shell scripts or the command line
188 endef
189
190 define Package/getopt
191 $(call Package/util-linux/Default)
192 TITLE:=parse command options (enhanced)
193 endef
194
195 define Package/getopt/description
196 getopt is used to break up (parse) options in command lines for easy parsing
197 by shell procedures, and to check for legal options
198 endef
199
200 define Package/hwclock
201 $(call Package/util-linux/Default)
202 TITLE:=query or set the hardware clock
203 endef
204
205 define Package/hwclock/description
206 hwclock is a tool for accessing the Hardware Clock
207 endef
208
209 define Package/logger
210 $(call Package/util-linux/Default)
211 TITLE:=a shell command interface to the syslog system log module
212 endef
213
214 define Package/logger/description
215 logger makes entries in the system log, it provides a shell command interface to the syslog system log module
216 endef
217
218 define Package/look
219 $(call Package/util-linux/Default)
220 TITLE:=display lines beginning with a given string
221 endef
222
223 define Package/look/description
224 look utility displays any lines in file which contain string
225 endef
226
227 define Package/losetup
228 $(call Package/util-linux/Default)
229 TITLE:=set up and control loop devices
230 endef
231
232 define Package/losetup/description
233 losetup is used to associate loop devices with regular files or block devices,
234 to detach loop devices and to query the status of a loop device
235 endef
236
237 define Package/lsblk
238 $(call Package/util-linux/Default)
239 TITLE:=list block devices
240 DEPENDS:= +libblkid +libuuid
241 SUBMENU=disc
242 endef
243
244 define Package/lsblk/description
245 lsblk lists information about all or the specified block devices
246 endef
247
248 define Package/mcookie
249 $(call Package/util-linux/Default)
250 TITLE:=generate magic cookies for xauth
251 endef
252
253 define Package/mcookie/description
254 mcookie generates a 128-bit random hexadecimal number for use with the X
255 authority system
256 endef
257
258 define Package/mount-utils
259 $(call Package/util-linux/Default)
260 TITLE:=related (u)mount utilities
261 DEPENDS+= +libblkid +libmount +libuuid
262 endef
263
264 define Package/mount-utils/description
265 contains: mount, umount, findmnt
266 endef
267
268 define Package/namei
269 $(call Package/util-linux/Default)
270 TITLE:=follow a pathname until a terminal point is found
271 endef
272
273 define Package/namei/description
274 namei uses its arguments as pathnames to any type of Unix file (symlinks,
275 files, directories, and so forth)
276 endef
277
278 define Package/rename
279 $(call Package/util-linux/Default)
280 TITLE:=rename files
281 endef
282
283 define Package/rename/description
284 rename will rename the specified files by replacing the first occurrence of
285 expression in their name by replacement
286 endef
287
288 define Package/partx-utils
289 $(call Package/util-linux/Default)
290 TITLE:=inform kernel about the presence and numbering of on-disk partitions
291 DEPENDS:= +libblkid +libuuid
292 SUBMENU=disc
293 endef
294
295 define Package/partx-utils/description
296 contains partx, addpart, delpart
297 endef
298
299 define Package/script-utils
300 $(call Package/util-linux/Default)
301 TITLE:=make and replay typescript of terminal session
302 SUBMENU=Terminal
303 endef
304
305 define Package/script-utils/description
306 contains: script, scriptreplay
307 endef
308
309 define Package/setterm
310 $(call Package/util-linux/Default)
311 TITLE:=set terminal attributes
312 SUBMENU:=Terminal
313 endef
314
315 define Package/setterm/description
316 setterm writes to standard output a character string that will invoke the
317 specified terminal capabilities
318 endef
319
320 define Package/sfdisk
321 $(call Package/util-linux/Default)
322 TITLE:=partition table manipulator for Linux
323 SUBMENU=disc
324 endef
325
326 define Package/sfdisk/description
327 list the size of a partition, list the partitions on a device, check the
328 partitions on a device and repartition a device
329 endef
330
331 define Package/swap-utils
332 $(call Package/util-linux/Default)
333 TITLE:=swap space management utilities
334 DEPENDS+= +libblkid +libuuid
335 SUBMENU:=disc
336 endef
337
338 define Package/swap-utils/description
339 contains: mkswap, swaplabel, swapon, swapoff
340 endef
341
342 define Package/uuidd
343 $(call Package/util-linux/Default)
344 TITLE:=UUID generation daemon
345 DEPENDS:= +libuuid
346 endef
347
348 define Package/uuidd/description
349 The uuidd daemon is used by the UUID library to generate universally unique
350 identifiers (UUIDs), especially time-based UUIDs, in a secure and
351 guaranteed-unique fashion, even in the face of large numbers of threads
352 running on different CPUs trying to grab UUIDs.
353 endef
354
355 define Package/uuidgen
356 $(call Package/util-linux/Default)
357 TITLE:=create a new UUID value
358 DEPENDS:= +libuuid
359 endef
360
361 define Package/uuidgen/description
362 The uuidgen program creates (and prints) a new universally unique identifier
363 (UUID) using the libuuid library. The new UUID can reasonably be considered
364 unique among all UUIDs created on the local system, and among UUIDs created on
365 other systems in the past and in the future.
366 endef
367
368 define Package/wall
369 $(call Package/util-linux/Default)
370 TITLE:=send a message to everybody's terminal
371 SUBMENU=Terminal
372 endef
373
374 define Package/wall/description
375 Wall sends a message to everybody logged in with their mesg permission
376 set to yes
377 endef
378
379 define Package/whereis
380 $(call Package/util-linux/Default)
381 TITLE:=locate the binary, source, and manual page files for a command
382 endef
383
384 define Package/wipefs/description
385 whereis locates source/binary and manuals sections for specified files
386 endef
387
388 define Package/wipefs
389 $(call Package/util-linux/Default)
390 TITLE:=wipe a signature from a device
391 DEPENDS:= +libblkid +libuuid
392 SUBMENU:=disc
393 endef
394
395 define Package/wipefs/description
396 wipefs can erase filesystem, raid or partition table signatures (magic
397 strings) from the specified device to make the signature invisible for
398 libblkid.
399 endef
400
401 define Package/libblkid/install
402 $(INSTALL_DIR) $(1)/usr/lib
403 $(CP) $(PKG_BUILD_DIR)/libblkid/src/.libs/libblkid.so.* $(1)/usr/lib/
404 endef
405
406 define Package/libmount/install
407 $(INSTALL_DIR) $(1)/usr/lib
408 $(CP) $(PKG_BUILD_DIR)/libmount/src/.libs/libmount.so.* $(1)/usr/lib/
409 endef
410
411 define Package/libuuid/install
412 $(INSTALL_DIR) $(1)/usr/lib
413 $(CP) $(PKG_BUILD_DIR)/libuuid/src/.libs/libuuid.so.* $(1)/usr/lib/
414 endef
415
416 define Package/agetty/install
417 $(INSTALL_DIR) $(1)/sbin
418 $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/agetty $(1)/sbin/
419 endef
420
421 define Package/blkid/install
422 $(INSTALL_DIR) $(1)/sbin
423 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/blkid $(1)/sbin/
424 endef
425
426 define Package/cal/install
427 $(INSTALL_DIR) $(1)/usr/bin
428 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/cal $(1)/usr/bin/
429 endef
430
431 define Package/cfdisk/install
432 $(INSTALL_DIR) $(1)/sbin
433 $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/.libs/cfdisk $(1)/sbin/
434 endef
435
436 define Package/fdisk/install
437 $(INSTALL_DIR) $(1)/sbin
438 $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/.libs/fdisk $(1)/sbin/
439 endef
440
441 define Package/findfs/install
442 $(INSTALL_DIR) $(1)/sbin
443 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/findfs $(1)/sbin/
444 endef
445
446 define Package/flock/install
447 $(INSTALL_DIR) $(1)/usr/bin
448 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/flock $(1)/usr/bin/
449 endef
450
451 define Package/getopt/install
452 $(INSTALL_DIR) $(1)/usr/bin
453 $(INSTALL_BIN) $(PKG_BUILD_DIR)/getopt/getopt $(1)/usr/bin/
454 endef
455
456 define Package/hwclock/install
457 $(INSTALL_DIR) $(1)/sbin
458 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hwclock/hwclock $(1)/sbin/
459 endef
460
461 define Package/logger/install
462 $(INSTALL_DIR) $(1)/usr/bin
463 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/logger $(1)/usr/bin/
464 endef
465
466 define Package/look/install
467 $(INSTALL_DIR) $(1)/usr/bin
468 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/look $(1)/usr/bin/
469 endef
470
471 define Package/losetup/install
472 $(INSTALL_DIR) $(1)/sbin
473 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/losetup $(1)/sbin/
474 endef
475
476 define Package/lsblk/install
477 $(INSTALL_DIR) $(1)/bin
478 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/lsblk $(1)/bin/
479 endef
480
481 define Package/mcookie/install
482 $(INSTALL_DIR) $(1)/usr/bin
483 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/mcookie $(1)/usr/bin/
484 endef
485
486 define Package/mount-utils/install
487 $(INSTALL_DIR) $(1)/bin
488 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/.libs/{u,}mount $(1)/bin/
489 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/.libs/mountpoint $(1)/bin/
490 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/findmnt $(1)/bin/
491 endef
492
493 define Package/namei/install
494 $(INSTALL_DIR) $(1)/usr/bin/
495 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/namei $(1)/usr/bin/
496 endef
497
498 define Package/rename/install
499 $(INSTALL_DIR) $(1)/usr/bin/
500 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/rename $(1)/usr/bin/
501 endef
502
503 define Package/partx-utils/install
504 $(INSTALL_DIR) $(1)/usr/sbin
505 $(INSTALL_BIN) $(PKG_BUILD_DIR)/partx/.libs/partx $(1)/usr/sbin/
506 $(INSTALL_BIN) $(PKG_BUILD_DIR)/partx/addpart $(1)/usr/sbin/
507 $(INSTALL_BIN) $(PKG_BUILD_DIR)/partx/delpart $(1)/usr/sbin/
508 endef
509
510 define Package/script-utils/install
511 $(INSTALL_DIR) $(1)/usr/bin
512 $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/script $(1)/usr/bin/
513 $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/scriptreplay $(1)/usr/bin/
514 endef
515
516 define Package/setterm/install
517 $(INSTALL_DIR) $(1)/usr/bin
518 $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/setterm $(1)/usr/bin/
519 endef
520
521 define Package/sfdisk/install
522 $(INSTALL_DIR) $(1)/sbin
523 $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/sfdisk $(1)/sbin/
524 endef
525
526 define Package/swap-utils/install
527 $(INSTALL_DIR) $(1)/sbin
528 $(INSTALL_BIN) $(PKG_BUILD_DIR)/disk-utils/.libs/mkswap $(1)/sbin/
529 $(INSTALL_BIN) $(PKG_BUILD_DIR)/disk-utils/.libs/swaplabel $(1)/sbin/
530 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/.libs/swapon $(1)/sbin/
531 ln -sf swapon $(1)/sbin/swapoff
532 endef
533
534 define Package/uuidd/install
535 $(INSTALL_DIR) $(1)/usr/sbin
536 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/uuidd $(1)/usr/sbin/
537 endef
538
539 define Package/uuidgen/install
540 $(INSTALL_DIR) $(1)/usr/bin
541 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/uuidgen $(1)/usr/bin/
542 endef
543
544 define Package/wall/install
545 $(INSTALL_DIR) $(1)/usr/bin
546 $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/wall $(1)/usr/bin/
547 endef
548
549 define Package/whereis/install
550 $(INSTALL_DIR) $(1)/usr/bin
551 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/whereis $(1)/usr/bin/
552 endef
553
554 define Package/wipefs/install
555 $(INSTALL_DIR) $(1)/sbin
556 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/wipefs $(1)/sbin/
557 endef
558
559 $(eval $(call BuildPackage,libblkid))
560 $(eval $(call BuildPackage,libmount))
561 $(eval $(call BuildPackage,libuuid))
562 $(eval $(call BuildPackage,agetty))
563 $(eval $(call BuildPackage,blkid))
564 $(eval $(call BuildPackage,cal))
565 $(eval $(call BuildPackage,cfdisk))
566 $(eval $(call BuildPackage,dmesg))
567 $(eval $(call BuildPackage,fdisk))
568 $(eval $(call BuildPackage,findfs))
569 $(eval $(call BuildPackage,flock))
570 $(eval $(call BuildPackage,getopt))
571 $(eval $(call BuildPackage,hwclock))
572 $(eval $(call BuildPackage,logger))
573 $(eval $(call BuildPackage,look))
574 $(eval $(call BuildPackage,losetup))
575 $(eval $(call BuildPackage,lsblk))
576 $(eval $(call BuildPackage,mcookie))
577 $(eval $(call BuildPackage,mount-utils))
578 $(eval $(call BuildPackage,namei))
579 $(eval $(call BuildPackage,rename))
580 $(eval $(call BuildPackage,partx-utils))
581 $(eval $(call BuildPackage,script-utils))
582 $(eval $(call BuildPackage,setterm))
583 $(eval $(call BuildPackage,sfdisk))
584 $(eval $(call BuildPackage,swap-utils))
585 $(eval $(call BuildPackage,uuidd))
586 $(eval $(call BuildPackage,uuidgen))
587 $(eval $(call BuildPackage,wall))
588 $(eval $(call BuildPackage,whereis))
589 $(eval $(call BuildPackage,wipefs))