6c5a6972f666da299a30d0009bbcd6e75d330fee
[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:=ftp://ftp.kernel.org/pub/linux/utils/$(PKG_NAME)/ \
17 http://ftp.kernel.org/pub/linux/utils/$(PKG_NAME)/ \
18 ftp://ftp.de.kernel.org/pub/linux/utils/$(PKG_NAME)/ \
19 http://ftp.de.kernel.org/pub/linux/utils/$(PKG_NAME)/
20 PKG_MD5SUM:=c261230b27fc0fbcc287c76884caf2d3
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/util-linux/Default
25 SECTION:=utils
26 CATEGORY:=Utilities
27 URL:=http://www.kernel.org/pub/linux/utils/util-linux/
28 endef
29
30 define Package/fdisk
31 $(call Package/util-linux/Default)
32 TITLE:=Partition table manipulation utility
33 DEPENDS:=@!LINUX_2_6_ETRAX
34 DESCRIPTION:=\
35 This package contains a utility for managing disk partition tables.
36 URL:=http://www.kernel.org/pub/linux/utils/util-linux/
37 endef
38
39 define Package/cfdisk
40 $(call Package/util-linux/Default)
41 TITLE:=Partition table manipulation utility
42 DEPENDS:=+libncurses @!LINUX_2_6_ETRAX
43 DESCRIPTION:=\
44 This package contains a utility for managing disk partition tables.
45 URL:=http://www.kernel.org/pub/linux/utils/util-linux/
46 endef
47
48 define Package/losetup
49 $(call Package/util-linux/Default)
50 TITLE:=Loopback devices setup and control utility
51 DEPENDS:=@!LINUX_2_6_ETRAX
52 DESCRIPTION:=\
53 This package contains a utility for managing loopback devices.
54 endef
55
56 define Package/swap-utils
57 $(call Package/util-linux/Default)
58 TITLE:=Swap space management utilities
59 DEPENDS:=@!LINUX_2_6_ETRAX
60 DESCRIPTION:=\
61 This package contains a collection of tools for managing swap space: \\\
62 - mkswap\\\
63 - swapon\\\
64 - swapoff
65 endef
66
67 define Package/hwclock
68 $(call Package/util-linux/Default)
69 TITLE:=Utilities for managing the hardware clock
70 DEPENDS:=@!LINUX_2_6_ETRAX
71 DESCRIPTION:=\
72 This package contains a utility for managing the hardware clock
73 endef
74
75 TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib
76 define Build/Compile
77 $(call Build/Compile/Default, \
78 OPT="$(TARGET_CFLAGS)" \
79 INSTALLSUID="install -m 4755" \
80 DESTDIR="$(PKG_INSTALL_DIR)" \
81 all install \
82 )
83 endef
84
85 define Package/Template
86 @if [ \! -f "$(PKG_INSTALL_DIR)/$(1)" ]; then \
87 rm -f $(PKG_BUILD_DIR)/.built; \
88 $(MAKE) $(PKG_BUILD_DIR)/.built; \
89 fi
90 $(INSTALL_DIR) $(2)
91 $(CP) $(PKG_INSTALL_DIR)/$(1) $(2)/
92 endef
93
94 define Package/fdisk/install
95 $(call Package/Template,sbin/fdisk,$(1)/usr/sbin)
96 endef
97
98 define Package/cfdisk/install
99 $(call Package/Template,sbin/cfdisk,$(1)/usr/sbin)
100 endef
101
102 define Package/losetup/install
103 $(call Package/Template,sbin/losetup,$(1)/usr/sbin)
104 endef
105
106 define Package/swap-utils/install
107 $(call Package/Template,sbin/mkswap,$(1)/usr/sbin)
108 $(call Package/Template,sbin/swapon,$(1)/usr/sbin)
109 $(call Package/Template,sbin/swapoff,$(1)/usr/sbin)
110 endef
111
112 define Package/hwclock/install
113 $(call Package/Template,sbin/hwclock,$(1)/usr/sbin)
114 endef
115
116 $(eval $(call BuildPackage,fdisk))
117 $(eval $(call BuildPackage,cfdisk))
118 $(eval $(call BuildPackage,losetup))
119 $(eval $(call BuildPackage,swap-utils))
120 $(eval $(call BuildPackage,hwclock))