Branch oldpackages for 14.07
[14.07/packages.git] / utils / time / Makefile
1 #
2 # Copyright (C) 2011 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:=time
11 PKG_VERSION:=1.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@GNU/time
16 PKG_MD5SUM:=e38d2b8b34b1ca259cf7b053caac32b3
17
18 PKG_FIXUP:=autoreconf
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/time
24   SECTION:=utils
25   CATEGORY:=Utilities
26   TITLE:=The GNU time utility
27   URL:=http://www.gnu.org/software/time/
28 endef
29
30 define Package/time/description
31   `time' is a program that measures many of the CPU resources, such as time and
32   memory, that other programs use.  The GNU version can format the output in
33   arbitrary ways by using a printf-style format string to include various
34   resource measurements.  Some systems do not provide much information about
35   program resource use; `time' reports unavailable information as zero values.
36 endef
37
38 define Package/time/preinst
39 #!/bin/sh
40 if [ -e $${IPKG_INSTROOT}/usr/bin/time ]; then
41   rm $${IPKG_INSTROOT}/usr/bin/time;
42 fi
43 endef
44
45 define Package/time/install
46         $(INSTALL_DIR) $(1)/usr/bin
47         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/time $(1)/usr/bin/
48 endef
49
50 define Package/time/postrm
51 #!/bin/sh
52 ln -sf ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/time
53 $${IPKG_INSTROOT}/usr/bin/time 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/time
54 exit 0
55 endef
56
57 $(eval $(call BuildPackage,time))