Makefile 16 KB

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