more package submenus
[openwrt/svn-archive/archive.git] / package / util-linux / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=util-linux
12 PKG_VERSION:=2.12r
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/
17 PKG_MD5SUM:=c261230b27fc0fbcc287c76884caf2d3
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/util-linux/Default
22 SECTION:=utils
23 CATEGORY:=Utilities
24 DEPENDS:=@!TARGET_etrax
25 URL:=http://www.kernel.org/pub/linux/utils/util-linux/
26 endef
27
28 define Package/fdisk
29 $(call Package/util-linux/Default)
30 TITLE:=Partition table manipulation utility
31 SUBMENU=disc
32 endef
33
34 define Package/fdisk/description
35 This package contains a utility for managing disk partition tables.
36 endef
37
38 define Package/cfdisk
39 $(call Package/util-linux/Default)
40 TITLE:=Partition table manipulation utility
41 DEPENDS:= +libncurses
42 SUBMENU:=disc
43 endef
44
45 define Package/cfdisk/description
46 This package contains a utility for managing disk partition tables.
47 endef
48
49 define Package/losetup
50 $(call Package/util-linux/Default)
51 TITLE:=Loopback devices setup and control utility
52 endef
53
54 define Package/losetup/description
55 This package contains a utility for managing loopback devices.
56 endef
57
58 define Package/swap-utils
59 $(call Package/util-linux/Default)
60 TITLE:=Swap space management utilities
61 SUBMENU:=disc
62 endef
63
64 define Package/swap-utils/description
65 This package contains a collection of tools for managing swap space:
66 - mkswap
67 - swapon
68 - swapoff
69 endef
70
71 define Package/hwclock
72 $(call Package/util-linux/Default)
73 TITLE:=Utilities for managing the hardware clock
74 endef
75
76 define Package/hwclock/description
77 This package contains a utility for managing the hardware clock.
78 endef
79
80 define Build/Configure
81 # this is NOT GNU configure!
82 ( cd $(PKG_BUILD_DIR); \
83 CC="$(TARGET_CC)" \
84 CFLAGS="$(TARGET_CPPFLAGS)" \
85 LDFLAGS="$(TARGET_LDFLAGS)" \
86 ./configure \
87 );
88 endef
89
90 define Build/Compile
91 $(MAKE) -C $(PKG_BUILD_DIR) \
92 OPT="$(TARGET_CFLAGS)" \
93 INSTALLSUID="install -m 4755" \
94 DESTDIR="$(PKG_INSTALL_DIR)" \
95 all install
96 endef
97
98 define Package/Template
99 @if [ \! -f "$(PKG_INSTALL_DIR)/$(1)" ]; then \
100 rm -f $(PKG_BUILD_DIR)/.built; \
101 $(MAKE) $(PKG_BUILD_DIR)/.built; \
102 fi
103 $(INSTALL_DIR) $(2)
104 $(CP) $(PKG_INSTALL_DIR)/$(1) $(2)/
105 endef
106
107 define Package/fdisk/install
108 $(call Package/Template,sbin/fdisk,$(1)/usr/sbin)
109 endef
110
111 define Package/cfdisk/install
112 $(call Package/Template,sbin/cfdisk,$(1)/usr/sbin)
113 endef
114
115 define Package/losetup/install
116 $(call Package/Template,sbin/losetup,$(1)/usr/sbin)
117 endef
118
119 define Package/swap-utils/install
120 $(call Package/Template,sbin/mkswap,$(1)/usr/sbin)
121 $(call Package/Template,sbin/swapon,$(1)/usr/sbin)
122 $(call Package/Template,sbin/swapoff,$(1)/usr/sbin)
123 endef
124
125 define Package/hwclock/install
126 $(call Package/Template,sbin/hwclock,$(1)/usr/sbin)
127 endef
128
129 $(eval $(call BuildPackage,fdisk))
130 $(eval $(call BuildPackage,cfdisk))
131 $(eval $(call BuildPackage,losetup))
132 $(eval $(call BuildPackage,swap-utils))
133 $(eval $(call BuildPackage,hwclock))