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