util-linux: add prlimit command.
[openwrt/staging/dedeckeh.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/prlimit
307 $(call Package/util-linux/Default)
308 TITLE:=get and set process resource limits
309 DEPENDS:= +libsmartcols
310 endef
311
312 define Package/prlimit/description
313 Given a process id and one or more resources, prlimit tries to retrieve
314 and/or modify the limits.
315 endef
316
317 define Package/rename
318 $(call Package/util-linux/Default)
319 TITLE:=rename files
320 endef
321
322 define Package/rename/description
323 rename will rename the specified files by replacing the first occurrence of
324 expression in their name by replacement
325 endef
326
327 define Package/partx-utils
328 $(call Package/util-linux/Default)
329 TITLE:=inform kernel about the presence and numbering of on-disk partitions
330 DEPENDS:= +libblkid +libsmartcols
331 SUBMENU=disc
332 endef
333
334 define Package/partx-utils/description
335 contains partx, addpart, delpart
336 endef
337
338 define Package/script-utils
339 $(call Package/util-linux/Default)
340 TITLE:=make and replay typescript of terminal session
341 SUBMENU=Terminal
342 endef
343
344 define Package/script-utils/description
345 contains: script, scriptreplay
346 endef
347
348 define Package/setterm
349 $(call Package/util-linux/Default)
350 TITLE:=set terminal attributes
351 DEPENDS:= +libncurses
352 SUBMENU:=Terminal
353 endef
354
355 define Package/setterm/description
356 setterm writes to standard output a character string that will invoke the
357 specified terminal capabilities
358 endef
359
360 define Package/sfdisk
361 $(call Package/util-linux/Default)
362 TITLE:=partition table manipulator for Linux
363 SUBMENU=disc
364 endef
365
366 define Package/sfdisk/description
367 list the size of a partition, list the partitions on a device, check the
368 partitions on a device and repartition a device
369 endef
370
371 define Package/swap-utils
372 $(call Package/util-linux/Default)
373 TITLE:=swap space management utilities
374 DEPENDS+= +libblkid
375 SUBMENU:=disc
376 endef
377
378 define Package/swap-utils/description
379 contains: mkswap, swaplabel
380 endef
381
382 define Package/uuidd
383 $(call Package/util-linux/Default)
384 TITLE:=UUID generation daemon
385 DEPENDS:= +libuuid
386 endef
387
388 define Package/uuidd/description
389 The uuidd daemon is used by the UUID library to generate universally unique
390 identifiers (UUIDs), especially time-based UUIDs, in a secure and
391 guaranteed-unique fashion, even in the face of large numbers of threads
392 running on different CPUs trying to grab UUIDs.
393 endef
394
395 define Package/uuidgen
396 $(call Package/util-linux/Default)
397 TITLE:=create a new UUID value
398 DEPENDS:= +libuuid
399 endef
400
401 define Package/uuidgen/description
402 The uuidgen program creates (and prints) a new universally unique identifier
403 (UUID) using the libuuid library. The new UUID can reasonably be considered
404 unique among all UUIDs created on the local system, and among UUIDs created on
405 other systems in the past and in the future.
406 endef
407
408 define Package/wall
409 $(call Package/util-linux/Default)
410 TITLE:=send a message to everybody's terminal
411 SUBMENU=Terminal
412 endef
413
414 define Package/wall/description
415 wall sends a message to everybody logged in with their mesg permission
416 set to yes
417 endef
418
419 define Package/whereis
420 $(call Package/util-linux/Default)
421 TITLE:=locate the binary, source, and manual page files for a command
422 endef
423
424 define Package/whereis/description
425 whereis locates source/binary and manuals sections for specified files
426 endef
427
428 define Package/wipefs
429 $(call Package/util-linux/Default)
430 TITLE:=wipe a signature from a device
431 DEPENDS:= +libblkid
432 SUBMENU:=disc
433 endef
434
435 define Package/wipefs/description
436 wipefs can erase filesystem, raid or partition table signatures (magic
437 strings) from the specified device to make the signature invisible for
438 libblkid.
439 endef
440
441 define Package/libblkid/install
442 $(INSTALL_DIR) $(1)/usr/lib
443 $(CP) $(PKG_BUILD_DIR)/.libs/libblkid.so* $(1)/usr/lib/
444 endef
445
446 define Package/libmount/install
447 $(INSTALL_DIR) $(1)/usr/lib
448 $(CP) $(PKG_BUILD_DIR)/.libs/libmount.so* $(1)/usr/lib/
449 endef
450
451 define Package/libsmartcols/install
452 $(INSTALL_DIR) $(1)/usr/lib
453 $(CP) $(PKG_BUILD_DIR)/.libs/libsmartcols.so* $(1)/usr/lib/
454 endef
455
456 define Package/libuuid/install
457 $(INSTALL_DIR) $(1)/usr/lib
458 $(CP) $(PKG_BUILD_DIR)/.libs/libuuid.so* $(1)/usr/lib/
459 endef
460
461 define Package/agetty/install
462 $(INSTALL_DIR) $(1)/usr/sbin
463 $(INSTALL_BIN) $(PKG_BUILD_DIR)/agetty $(1)/usr/sbin/
464 endef
465
466 define Package/blkid/install
467 $(INSTALL_DIR) $(1)/usr/sbin
468 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/blkid $(1)/usr/sbin/
469 endef
470
471 define Package/cal/install
472 $(INSTALL_DIR) $(1)/usr/bin
473 $(INSTALL_BIN) $(PKG_BUILD_DIR)/cal $(1)/usr/bin/
474 endef
475
476 define Package/cfdisk/install
477 $(INSTALL_DIR) $(1)/usr/sbin
478 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/cfdisk $(1)/usr/sbin/
479 endef
480
481 define Package/dmesg/install
482 $(INSTALL_DIR) $(1)/usr/sbin
483 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dmesg $(1)/usr/sbin/
484 endef
485
486 define Package/fdisk/install
487 $(INSTALL_DIR) $(1)/usr/sbin
488 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/fdisk $(1)/usr/sbin/
489 endef
490
491 define Package/findfs/install
492 $(INSTALL_DIR) $(1)/usr/sbin
493 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/findfs $(1)/usr/sbin/
494 endef
495
496 define Package/flock/install
497 $(INSTALL_DIR) $(1)/usr/bin
498 $(INSTALL_BIN) $(PKG_BUILD_DIR)/flock $(1)/usr/bin/
499 endef
500
501 define Package/getopt/install
502 $(INSTALL_DIR) $(1)/usr/bin
503 $(INSTALL_BIN) $(PKG_BUILD_DIR)/getopt $(1)/usr/bin/
504 endef
505
506 define Package/hwclock/install
507 $(INSTALL_DIR) $(1)/usr/sbin
508 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hwclock $(1)/usr/sbin/
509 endef
510
511 define Package/logger/install
512 $(INSTALL_DIR) $(1)/usr/bin
513 $(INSTALL_BIN) $(PKG_BUILD_DIR)/logger $(1)/usr/bin/
514 endef
515
516 define Package/look/install
517 $(INSTALL_DIR) $(1)/usr/bin
518 $(INSTALL_BIN) $(PKG_BUILD_DIR)/look $(1)/usr/bin/
519 endef
520
521 define Package/losetup/install
522 $(INSTALL_DIR) $(1)/usr/sbin
523 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/losetup $(1)/usr/sbin/
524 endef
525
526 define Package/lsblk/install
527 $(INSTALL_DIR) $(1)/usr/bin
528 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/lsblk $(1)/usr/bin/
529 endef
530
531 define Package/mcookie/install
532 $(INSTALL_DIR) $(1)/usr/bin
533 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mcookie $(1)/usr/bin/
534 endef
535
536 define Package/mount-utils/install
537 $(INSTALL_DIR) $(1)/usr/bin
538 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/{u,}mount $(1)/usr/bin/
539 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/mountpoint $(1)/usr/bin/
540 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/findmnt $(1)/usr/bin/
541 endef
542
543 define Package/namei/install
544 $(INSTALL_DIR) $(1)/usr/bin
545 $(INSTALL_BIN) $(PKG_BUILD_DIR)/namei $(1)/usr/bin/
546 endef
547
548 define Package/prlimit/install
549 $(INSTALL_DIR) $(1)/usr/bin
550 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/prlimit $(1)/usr/bin/
551 endef
552
553 define Package/rename/install
554 $(INSTALL_DIR) $(1)/usr/bin
555 $(INSTALL_BIN) $(PKG_BUILD_DIR)/rename $(1)/usr/bin/
556 endef
557
558 define Package/partx-utils/install
559 $(INSTALL_DIR) $(1)/usr/sbin
560 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/partx $(1)/usr/sbin/
561 $(INSTALL_BIN) $(PKG_BUILD_DIR)/addpart $(1)/usr/sbin/
562 $(INSTALL_BIN) $(PKG_BUILD_DIR)/delpart $(1)/usr/sbin/
563 endef
564
565 define Package/script-utils/install
566 $(INSTALL_DIR) $(1)/usr/bin
567 $(INSTALL_BIN) $(PKG_BUILD_DIR)/script $(1)/usr/bin/
568 $(INSTALL_BIN) $(PKG_BUILD_DIR)/scriptreplay $(1)/usr/bin/
569 endef
570
571 define Package/setterm/install
572 $(INSTALL_DIR) $(1)/usr/bin
573 $(INSTALL_BIN) $(PKG_BUILD_DIR)/setterm $(1)/usr/bin/
574 endef
575
576 define Package/sfdisk/install
577 $(INSTALL_DIR) $(1)/usr/sbin
578 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sfdisk $(1)/usr/sbin/
579 endef
580
581 define Package/swap-utils/install
582 $(INSTALL_DIR) $(1)/usr/sbin
583 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/mkswap $(1)/usr/sbin/
584 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/swaplabel $(1)/usr/sbin/
585 endef
586
587 define Package/uuidd/install
588 $(INSTALL_DIR) $(1)/usr/sbin
589 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/uuidd $(1)/usr/sbin/
590 endef
591
592 define Package/uuidgen/install
593 $(INSTALL_DIR) $(1)/usr/bin
594 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/uuidgen $(1)/usr/bin/
595 endef
596
597 define Package/wall/install
598 $(INSTALL_DIR) $(1)/usr/bin
599 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wall $(1)/usr/bin/
600 endef
601
602 define Package/whereis/install
603 $(INSTALL_DIR) $(1)/usr/bin
604 $(INSTALL_BIN) $(PKG_BUILD_DIR)/whereis $(1)/usr/bin/
605 endef
606
607 define Package/wipefs/install
608 $(INSTALL_DIR) $(1)/usr/sbin
609 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/wipefs $(1)/usr/sbin/
610 endef
611
612 $(eval $(call BuildPackage,libblkid))
613 $(eval $(call BuildPackage,libmount))
614 $(eval $(call BuildPackage,libsmartcols))
615 $(eval $(call BuildPackage,libuuid))
616 $(eval $(call BuildPackage,agetty))
617 $(eval $(call BuildPackage,blkid))
618 $(eval $(call BuildPackage,cal))
619 $(eval $(call BuildPackage,cfdisk))
620 $(eval $(call BuildPackage,dmesg))
621 $(eval $(call BuildPackage,fdisk))
622 $(eval $(call BuildPackage,findfs))
623 $(eval $(call BuildPackage,flock))
624 $(eval $(call BuildPackage,getopt))
625 $(eval $(call BuildPackage,hwclock))
626 $(eval $(call BuildPackage,logger))
627 $(eval $(call BuildPackage,look))
628 $(eval $(call BuildPackage,losetup))
629 $(eval $(call BuildPackage,lsblk))
630 $(eval $(call BuildPackage,mcookie))
631 $(eval $(call BuildPackage,mount-utils))
632 $(eval $(call BuildPackage,namei))
633 $(eval $(call BuildPackage,prlimit))
634 $(eval $(call BuildPackage,rename))
635 $(eval $(call BuildPackage,partx-utils))
636 $(eval $(call BuildPackage,script-utils))
637 $(eval $(call BuildPackage,setterm))
638 $(eval $(call BuildPackage,sfdisk))
639 $(eval $(call BuildPackage,swap-utils))
640 $(eval $(call BuildPackage,uuidd))
641 $(eval $(call BuildPackage,uuidgen))
642 $(eval $(call BuildPackage,wall))
643 $(eval $(call BuildPackage,whereis))
644 $(eval $(call BuildPackage,wipefs))