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