[package] util-linux: move and update
[openwrt.git] / package / util-linux / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=util-linux
11 PKG_VERSION:=2.20.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.20
16 PKG_MD5SUM:=fcd18041c5390178b1aadc2fd298bee8
17
18 PKG_BUILD_PARALLEL:=1
19 PKG_BUILD_DEPENDS=e2fsprogs libncurses
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/util-linux/Default
24   SECTION:=utils
25   CATEGORY:=Utilities
26   URL:=http://www.kernel.org/pub/linux/utils/util-linux/
27 endef
28
29 CONFIGURE_VARS += \
30         scanf_cv_type_modifier="ms"
31
32 CONFIGURE_ARGS += \
33         --disable-nls \
34         --disable-tls
35
36 define Package/cfdisk
37 $(call Package/util-linux/Default)
38   SUBMENU:=disc
39   TITLE:=Partition table manipulation utility
40   DEPENDS:= +libncurses
41 endef
42
43 define Package/cfdisk/description
44  This package contains a utility for managing disk partition tables.
45 endef
46
47 define Package/fdisk
48 $(call Package/util-linux/Default)
49   TITLE:=Partition table manipulation utility
50   SUBMENU=disc
51 endef
52
53 define Package/fdisk/description
54  This package contains a utility for managing disk partition tables.
55 endef
56
57 define Package/sfdisk
58 $(call Package/util-linux/Default)
59   TITLE:=Partition table manipulation utility (Command-line)
60   SUBMENU=disc
61 endef
62
63 define Package/sfdisk/description
64  This package contains a utility for managing disk partition tables using command-line only.
65 endef
66
67 define Package/getopt
68 $(call Package/util-linux/Default)
69   TITLE:=Tool for parsing command parameters
70 endef
71
72 define Package/getopt/description
73  getopt is a program to help shell scripts parse command-line parameters.
74 endef
75
76 define Package/hwclock
77 $(call Package/util-linux/Default)
78   TITLE:=Utilities for managing the hardware clock
79 endef
80
81 define Package/hwclock/description
82  This package contains a utility for managing the hardware clock.
83 endef
84
85 define Package/losetup
86 $(call Package/util-linux/Default)
87   TITLE:=Loopback devices setup and control utility
88 endef
89
90 define Package/losetup/description
91  This package contains a utility for managing loopback devices.
92 endef
93
94 define Package/swap-utils
95 $(call Package/util-linux/Default)
96   SUBMENU:=disc
97   TITLE:=Swap space management utilities
98   DEPENDS+= +libblkid +libuuid
99 endef
100
101 define Package/swap-utils/description
102  This package contains a collection of tools for managing swap space:
103  - mkswap
104  - swapon
105  - swapoff
106 endef
107
108 define Package/mount-utils
109 $(call Package/util-linux/Default)
110   TITLE:=Devices mount/unmounting utilities
111   DEPENDS+= +libblkid +libuuid
112 endef
113
114 define Package/mount-utils/description
115  This package contains utilities to mount/unmount devices.
116 endef
117
118 define Package/flock
119 $(call Package/util-linux/Default)
120   TITLE:=Manage file locks from shell scripts
121 endef
122
123 define Package/flock/description
124   This package contains a utility for managing file locks from shell scripts.
125 endef
126
127 define Package/setterm
128 $(call Package/util-linux/Default)
129   TITLE:=Tool for setting terminal attributes
130   SUBMENU:=Terminal
131   DEPENDS:= +libncurses
132 endef
133
134 define Package/setterm/description
135   This package contains a utility for setting terminal attributes.
136 endef
137
138 define Package/script
139 $(call Package/util-linux/Default)
140   TITLE:=Make typescript of terminal session
141   SUBMENU=Terminal
142 endef
143
144 define Package/script/description
145  Script makes a typescript of everything printed on your terminal.
146 endef
147
148 define Build/Compile
149         $(MAKE) -C $(PKG_BUILD_DIR)/disk-utils mkswap
150         $(MAKE) -C $(PKG_BUILD_DIR)/fdisk cfdisk fdisk sfdisk
151         $(MAKE) -C $(PKG_BUILD_DIR)/getopt getopt
152         $(MAKE) -C $(PKG_BUILD_DIR)/hwclock hwclock
153         $(MAKE) -C $(PKG_BUILD_DIR)/mount losetup mount swapon umount
154         $(MAKE) -C $(PKG_BUILD_DIR)/sys-utils flock
155         $(MAKE) -C $(PKG_BUILD_DIR)/term-utils setterm script
156 endef
157
158 define Package/cfdisk/install
159         $(INSTALL_DIR) $(1)/sbin
160         $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/cfdisk $(1)/sbin/
161 endef
162
163 define Package/fdisk/install
164         $(INSTALL_DIR) $(1)/sbin
165         $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/fdisk $(1)/sbin/
166 endef
167
168 define Package/sfdisk/install
169         $(INSTALL_DIR) $(1)/usr/sbin
170         $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/sfdisk $(1)/usr/sbin/
171 endef
172
173 define Package/getopt/install
174         $(INSTALL_DIR) $(1)/usr/bin
175         $(INSTALL_BIN) $(PKG_BUILD_DIR)/getopt/getopt $(1)/usr/bin/
176 endef
177
178 define Package/hwclock/install
179         $(INSTALL_DIR) $(1)/sbin
180         $(INSTALL_BIN) $(PKG_BUILD_DIR)/hwclock/hwclock $(1)/sbin/
181 endef
182
183 define Package/losetup/install
184         $(INSTALL_DIR) $(1)/sbin
185         $(INSTALL_BIN) $(PKG_BUILD_DIR)/mount/losetup $(1)/sbin/
186 endef
187
188 define Package/swap-utils/install
189         $(INSTALL_DIR) $(1)/sbin
190         $(INSTALL_BIN) $(PKG_BUILD_DIR)/disk-utils/mkswap $(PKG_BUILD_DIR)/mount/swapon $(1)/sbin/
191         ln -sf swapon $(1)/sbin/swapoff
192 endef
193
194 define Package/mount-utils/install
195         $(INSTALL_DIR) $(1)/bin/
196         $(INSTALL_BIN) $(PKG_BUILD_DIR)/mount/{u,}mount $(1)/bin
197 endef
198
199 define Package/flock/install
200         $(INSTALL_DIR) $(1)/usr/bin
201         $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/flock $(1)/usr/bin/
202 endef
203
204 define Package/setterm/install
205         $(INSTALL_DIR) $(1)/usr/bin
206         $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/setterm $(1)/usr/bin/
207 endef
208
209 define Package/script/install
210         $(INSTALL_DIR) $(1)/usr/bin
211         $(INSTALL_BIN) $(PKG_BUILD_DIR)/term-utils/script $(1)/usr/bin/
212 endef
213
214 $(eval $(call BuildPackage,cfdisk))
215 $(eval $(call BuildPackage,fdisk))
216 $(eval $(call BuildPackage,sfdisk))
217 $(eval $(call BuildPackage,getopt))
218 $(eval $(call BuildPackage,hwclock))
219 $(eval $(call BuildPackage,losetup))
220 $(eval $(call BuildPackage,swap-utils))
221 $(eval $(call BuildPackage,mount-utils))
222 $(eval $(call BuildPackage,flock))
223 $(eval $(call BuildPackage,setterm))
224 $(eval $(call BuildPackage,script))