uboot-envtools: update to 2012.04.01
[openwrt.git] / package / uboot-envtools / Makefile
1 #
2 # Copyright (C) 2006-2012 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:=uboot-envtools
11 PKG_DISTNAME:=u-boot
12 PKG_VERSION:=2012.04.01
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
17 PKG_MD5SUM:=192bb231082d9159fb6e16de3039b6b2
18 PKG_BUILD_DEPENDS:=zlib
19
20 include $(INCLUDE_DIR)/package.mk
21
22 TAR_OPTIONS+= --strip-components=3 -C $(PKG_BUILD_DIR) $(PKG_DISTNAME)-$(PKG_VERSION)/tools/env
23
24 define Package/uboot-envtools
25   SECTION:=utils
26   CATEGORY:=Utilities
27   TITLE:=read/modify U-Boot bootloader environment
28   URL:=http://www.denx.de/wiki/U-Boot
29   MENU:=1
30 endef
31
32 define Package/uboot-envtools/config
33         menu "Configuration"
34         depends on PACKAGE_uboot-envtools
35
36         config PACKAGE_uboot-envtools_setenv_symlink
37                 bool "Create fw_setenv symlink"
38                 default n
39                 help
40                 With this option selected you will be able to edit U-Boot bootloader environment.
41  
42         endmenu
43 endef
44
45 define Package/uboot-envtools/description
46  This package includes tools to read and modify U-Boot bootloader environment.
47 endef
48
49 define Build/Prepare
50         mkdir -p $(PKG_BUILD_DIR)
51         tar xvjf $(DL_DIR)/$(PKG_SOURCE) --strip-components=2 -C $(PKG_BUILD_DIR) $(PKG_DISTNAME)-$(PKG_VERSION)/lib/crc32.c
52         $(call Build/Prepare/Default)
53 endef
54
55 define Package/uboot-envtools/conffiles
56 /etc/config/ubootenv
57 /etc/fw_env.config
58 endef
59
60 define Package/uboot-envtools/install
61         $(INSTALL_DIR) $(1)/usr/sbin
62         $(INSTALL_BIN) $(PKG_BUILD_DIR)/fw_printenv $(1)/usr/sbin
63 ifneq ($(CONFIG_PACKAGE_uboot-envtools_setenv_symlink),)
64         ln -s fw_printenv $(1)/usr/sbin/fw_setenv
65 endif
66         $(INSTALL_DIR) $(1)/lib
67         $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
68 ifneq ($(CONFIG_TARGET_ar71xx),)
69         $(INSTALL_DIR) $(1)/etc/uci-defaults
70         $(INSTALL_BIN) ./files/ar71xx $(1)/etc/uci-defaults/uboot-envtools
71 endif
72 ifneq ($(CONFIG_TARGET_lantiq),)
73         $(INSTALL_DIR) $(1)/etc/uci-defaults
74         $(INSTALL_BIN) ./files/lantiq $(1)/etc/uci-defaults/uboot-envtools
75 endif
76 endef
77
78 $(eval $(call BuildPackage,uboot-envtools))