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