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