Makefile 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  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.2
  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:=54ba880f1d66782c2287ee2c898520e9
  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/libmount/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
  175. to the syslog system log module
  176. endef
  177. define Package/look
  178. $(call Package/util-linux/Default)
  179. TITLE:=display lines beginning with a given string
  180. endef
  181. define Package/look/description
  182. look utility displays any lines in file which contain string
  183. endef
  184. define Package/losetup
  185. $(call Package/util-linux/Default)
  186. TITLE:=set up and control loop devices
  187. endef
  188. define Package/losetup/description
  189. losetup is used to associate loop devices with regular files or block devices,
  190. to detach loop devices and to query the status of a loop device
  191. endef
  192. define Package/lsblk
  193. $(call Package/util-linux/Default)
  194. TITLE:=list block devices
  195. DEPENDS:= +libblkid +libuuid
  196. SUBMENU=disc
  197. endef
  198. define Package/lsblk/description
  199. lsblk lists information about all or the specified block devices
  200. endef
  201. define Package/mcookie
  202. $(call Package/util-linux/Default)
  203. TITLE:=generate magic cookies for xauth
  204. endef
  205. define Package/mcookie/description
  206. mcookie generates a 128-bit random hexadecimal number for use with the X
  207. authority system
  208. endef
  209. define Package/mount-utils
  210. $(call Package/util-linux/Default)
  211. TITLE:=related (u)mount utilities
  212. DEPENDS+= +libblkid +libmount +libuuid
  213. endef
  214. define Package/mount-utils/description
  215. contains: mount, umount, findmnt
  216. endef
  217. define Package/namei
  218. $(call Package/util-linux/Default)
  219. TITLE:=follow a pathname until a terminal point is found
  220. endef
  221. define Package/namei/description
  222. namei uses its arguments as pathnames to any type of Unix file (symlinks,
  223. files, directories, and so forth)
  224. endef
  225. define Package/rename
  226. $(call Package/util-linux/Default)
  227. TITLE:=rename files
  228. endef
  229. define Package/rename/description
  230. rename will rename the specified files by replacing the first occurrence of
  231. expression in their name by replacement
  232. endef
  233. define Package/partx-utils
  234. $(call Package/util-linux/Default)
  235. TITLE:=inform kernel about the presence and numbering of on-disk partitions
  236. DEPENDS:= +libblkid +libuuid
  237. SUBMENU=disc
  238. endef
  239. define Package/partx-utils/description
  240. contains partx, addpart, delpart
  241. endef
  242. define Package/script-utils
  243. $(call Package/util-linux/Default)
  244. TITLE:=make and replay typescript of terminal session
  245. SUBMENU=Terminal
  246. endef
  247. define Package/script-utils/description
  248. contains: script, scriptreplay
  249. endef
  250. define Package/setterm
  251. $(call Package/util-linux/Default)
  252. TITLE:=set terminal attributes
  253. SUBMENU:=Terminal
  254. endef
  255. define Package/setterm/description
  256. setterm writes to standard output a character string that will invoke the
  257. specified terminal capabilities
  258. endef
  259. define Package/sfdisk
  260. $(call Package/util-linux/Default)
  261. TITLE:=partition table manipulator for Linux
  262. SUBMENU=disc
  263. endef
  264. define Package/sfdisk/description
  265. list the size of a partition, list the partitions on a device, check the
  266. partitions on a device and repartition a device
  267. endef
  268. define Package/swap-utils
  269. $(call Package/util-linux/Default)
  270. TITLE:=swap space management utilities
  271. DEPENDS+= +libblkid +libuuid
  272. SUBMENU:=disc
  273. endef
  274. define Package/swap-utils/description
  275. contains: mkswap, swaplabel, swapon, swapoff
  276. endef
  277. define Package/uuidd
  278. $(call Package/util-linux/Default)
  279. TITLE:=UUID generation daemon
  280. DEPENDS:= +libuuid
  281. endef
  282. define Package/uuidd/description
  283. The uuidd daemon is used by the UUID library to generate universally unique
  284. identifiers (UUIDs), especially time-based UUIDs, in a secure and
  285. guaranteed-unique fashion, even in the face of large numbers of threads
  286. running on different CPUs trying to grab UUIDs.
  287. endef
  288. define Package/uuidgen
  289. $(call Package/util-linux/Default)
  290. TITLE:=create a new UUID value
  291. DEPENDS:= +libuuid
  292. endef
  293. define Package/uuidgen/description
  294. The uuidgen program creates (and prints) a new universally unique identifier
  295. (UUID) using the libuuid library. The new UUID can reasonably be considered
  296. unique among all UUIDs created on the local system, and among UUIDs created on
  297. other systems in the past and in the future.
  298. endef
  299. define Package/wall
  300. $(call Package/util-linux/Default)
  301. TITLE:=send a message to everybody's terminal
  302. SUBMENU=Terminal
  303. endef
  304. define Package/wall/description
  305. wall sends a message to everybody logged in with their mesg permission
  306. set to yes
  307. endef
  308. define Package/whereis
  309. $(call Package/util-linux/Default)
  310. TITLE:=locate the binary, source, and manual page files for a command
  311. endef
  312. define Package/whereis/description
  313. whereis locates source/binary and manuals sections for specified files
  314. endef
  315. define Package/wipefs
  316. $(call Package/util-linux/Default)
  317. TITLE:=wipe a signature from a device
  318. DEPENDS:= +libblkid +libuuid
  319. SUBMENU:=disc
  320. endef
  321. define Package/wipefs/description
  322. wipefs can erase filesystem, raid or partition table signatures (magic
  323. strings) from the specified device to make the signature invisible for
  324. libblkid.
  325. endef
  326. define Package/libblkid/install
  327. $(INSTALL_DIR) $(1)/usr/lib
  328. $(CP) $(PKG_BUILD_DIR)/libblkid/src/.libs/libblkid.so.* $(1)/usr/lib/
  329. endef
  330. define Package/libmount/install
  331. $(INSTALL_DIR) $(1)/usr/lib
  332. $(CP) $(PKG_BUILD_DIR)/libmount/src/.libs/libmount.so.* $(1)/usr/lib/
  333. endef
  334. define Package/libuuid/install
  335. $(INSTALL_DIR) $(1)/usr/lib
  336. $(CP) $(PKG_BUILD_DIR)/libuuid/src/.libs/libuuid.so.* $(1)/usr/lib/
  337. endef
  338. define Package/agetty/install
  339. $(INSTALL_DIR) $(1)/sbin
  340. $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/agetty $(1)/sbin/
  341. endef
  342. define Package/blkid/install
  343. $(INSTALL_DIR) $(1)/sbin
  344. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/blkid $(1)/sbin/
  345. endef
  346. define Package/cal/install
  347. $(INSTALL_DIR) $(1)/usr/bin
  348. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/cal $(1)/usr/bin/
  349. endef
  350. define Package/cfdisk/install
  351. $(INSTALL_DIR) $(1)/sbin
  352. $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/.libs/cfdisk $(1)/sbin/
  353. endef
  354. define Package/fdisk/install
  355. $(INSTALL_DIR) $(1)/sbin
  356. $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/.libs/fdisk $(1)/sbin/
  357. endef
  358. define Package/findfs/install
  359. $(INSTALL_DIR) $(1)/sbin
  360. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/findfs $(1)/sbin/
  361. endef
  362. define Package/flock/install
  363. $(INSTALL_DIR) $(1)/usr/bin
  364. $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/flock $(1)/usr/bin/
  365. endef
  366. define Package/getopt/install
  367. $(INSTALL_DIR) $(1)/usr/bin
  368. $(INSTALL_BIN) $(PKG_BUILD_DIR)/getopt/getopt $(1)/usr/bin/
  369. endef
  370. define Package/hwclock/install
  371. $(INSTALL_DIR) $(1)/sbin
  372. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hwclock/hwclock $(1)/sbin/
  373. endef
  374. define Package/logger/install
  375. $(INSTALL_DIR) $(1)/usr/bin
  376. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/logger $(1)/usr/bin/
  377. endef
  378. define Package/look/install
  379. $(INSTALL_DIR) $(1)/usr/bin
  380. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/look $(1)/usr/bin/
  381. endef
  382. define Package/losetup/install
  383. $(INSTALL_DIR) $(1)/sbin
  384. $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/losetup $(1)/sbin/
  385. endef
  386. define Package/lsblk/install
  387. $(INSTALL_DIR) $(1)/bin
  388. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/lsblk $(1)/bin/
  389. endef
  390. define Package/mcookie/install
  391. $(INSTALL_DIR) $(1)/usr/bin
  392. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/mcookie $(1)/usr/bin/
  393. endef
  394. define Package/mount-utils/install
  395. $(INSTALL_DIR) $(1)/bin
  396. $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/.libs/{u,}mount $(1)/bin/
  397. $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/.libs/mountpoint $(1)/bin/
  398. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/findmnt $(1)/bin/
  399. endef
  400. define Package/namei/install
  401. $(INSTALL_DIR) $(1)/usr/bin/
  402. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/namei $(1)/usr/bin/
  403. endef
  404. define Package/rename/install
  405. $(INSTALL_DIR) $(1)/usr/bin/
  406. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/rename $(1)/usr/bin/
  407. endef
  408. define Package/partx-utils/install
  409. $(INSTALL_DIR) $(1)/usr/sbin
  410. $(INSTALL_BIN) $(PKG_BUILD_DIR)/partx/.libs/partx $(1)/usr/sbin/
  411. $(INSTALL_BIN) $(PKG_BUILD_DIR)/partx/addpart $(1)/usr/sbin/
  412. $(INSTALL_BIN) $(PKG_BUILD_DIR)/partx/delpart $(1)/usr/sbin/
  413. endef
  414. define Package/script-utils/install
  415. $(INSTALL_DIR) $(1)/usr/bin
  416. $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/script $(1)/usr/bin/
  417. $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/scriptreplay $(1)/usr/bin/
  418. endef
  419. define Package/setterm/install
  420. $(INSTALL_DIR) $(1)/usr/bin
  421. $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/setterm $(1)/usr/bin/
  422. endef
  423. define Package/sfdisk/install
  424. $(INSTALL_DIR) $(1)/sbin
  425. $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/sfdisk $(1)/sbin/
  426. endef
  427. define Package/swap-utils/install
  428. $(INSTALL_DIR) $(1)/sbin
  429. $(INSTALL_BIN) $(PKG_BUILD_DIR)/disk-utils/.libs/mkswap $(1)/sbin/
  430. $(INSTALL_BIN) $(PKG_BUILD_DIR)/disk-utils/.libs/swaplabel $(1)/sbin/
  431. $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/.libs/swapon $(1)/sbin/
  432. ln -sf swapon $(1)/sbin/swapoff
  433. endef
  434. define Package/uuidd/install
  435. $(INSTALL_DIR) $(1)/usr/sbin
  436. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/uuidd $(1)/usr/sbin/
  437. endef
  438. define Package/uuidgen/install
  439. $(INSTALL_DIR) $(1)/usr/bin
  440. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/uuidgen $(1)/usr/bin/
  441. endef
  442. define Package/wall/install
  443. $(INSTALL_DIR) $(1)/usr/bin
  444. $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/wall $(1)/usr/bin/
  445. endef
  446. define Package/whereis/install
  447. $(INSTALL_DIR) $(1)/usr/bin
  448. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/whereis $(1)/usr/bin/
  449. endef
  450. define Package/wipefs/install
  451. $(INSTALL_DIR) $(1)/sbin
  452. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc-utils/.libs/wipefs $(1)/sbin/
  453. endef
  454. $(eval $(call BuildPackage,libblkid))
  455. $(eval $(call BuildPackage,libmount))
  456. $(eval $(call BuildPackage,libuuid))
  457. $(eval $(call BuildPackage,agetty))
  458. $(eval $(call BuildPackage,blkid))
  459. $(eval $(call BuildPackage,cal))
  460. $(eval $(call BuildPackage,cfdisk))
  461. $(eval $(call BuildPackage,dmesg))
  462. $(eval $(call BuildPackage,fdisk))
  463. $(eval $(call BuildPackage,findfs))
  464. $(eval $(call BuildPackage,flock))
  465. $(eval $(call BuildPackage,getopt))
  466. $(eval $(call BuildPackage,hwclock))
  467. $(eval $(call BuildPackage,logger))
  468. $(eval $(call BuildPackage,look))
  469. $(eval $(call BuildPackage,losetup))
  470. $(eval $(call BuildPackage,lsblk))
  471. $(eval $(call BuildPackage,mcookie))
  472. $(eval $(call BuildPackage,mount-utils))
  473. $(eval $(call BuildPackage,namei))
  474. $(eval $(call BuildPackage,rename))
  475. $(eval $(call BuildPackage,partx-utils))
  476. $(eval $(call BuildPackage,script-utils))
  477. $(eval $(call BuildPackage,setterm))
  478. $(eval $(call BuildPackage,sfdisk))
  479. $(eval $(call BuildPackage,swap-utils))
  480. $(eval $(call BuildPackage,uuidd))
  481. $(eval $(call BuildPackage,uuidgen))
  482. $(eval $(call BuildPackage,wall))
  483. $(eval $(call BuildPackage,whereis))
  484. $(eval $(call BuildPackage,wipefs))