add file type autodetection for the unpack command and nuke PKG_CAT:= in lots of...
[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:=1
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   DESCRIPTION:=\
34         This package contains an utility for managing disk partition tables.
35   URL:=http://www.kernel.org/pub/linux/utils/util-linux/
36 endef
37
38 define Package/losetup
39   $(call Package/util-linux/Default)
40   TITLE:=Loopback devices setup and control utility
41   DESCRIPTION:=\
42         This package contains an utility for managing loopback devices.
43 endef
44
45 define Package/swap-utils
46   $(call Package/util-linux/Default)
47   TITLE:=Swap space management utilities
48   DESCRIPTION:=\
49         This package contains a collection of tools for managing swap space: \\\
50         - mkswap\\\
51         - swapon\\\
52         - swapoff
53 endef
54
55 TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib
56 define Build/Compile
57         $(call Build/Compile/Default, \
58                 OPT="$(TARGET_CFLAGS)" \
59                 INSTALLSUID="install -m 4755" \
60                 DESTDIR="$(PKG_INSTALL_DIR)" \
61                 all install \
62         )
63 endef
64
65 define Package/Template
66         @if [ \! -f "$(PKG_INSTALL_DIR)/$(1)" ]; then \
67                 rm -f $(PKG_BUILD_DIR)/.built; \
68                 $(MAKE) $(PKG_BUILD_DIR)/.built; \
69         fi
70         $(INSTALL_DIR) $(2)
71         $(CP) $(PKG_INSTALL_DIR)/$(1) $(2)/
72 endef
73
74 define Package/fdisk/install
75         $(call Package/Template,sbin/fdisk,$(1)/usr/sbin)
76 endef
77
78 define Package/losetup/install
79         $(call Package/Template,sbin/losetup,$(1)/usr/sbin)
80 endef
81
82 define Package/swap-utils/install
83         $(call Package/Template,sbin/mkswap,$(1)/usr/sbin)
84         $(call Package/Template,sbin/swapon,$(1)/usr/sbin)
85         $(call Package/Template,sbin/swapoff,$(1)/usr/sbin)
86 endef
87
88 $(eval $(call BuildPackage,fdisk))
89 $(eval $(call BuildPackage,losetup))
90 $(eval $(call BuildPackage,swap-utils))