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