94c59c824671bd36b776f9b3fa54c6a5a48693eb
[openwrt-10.03/.git] / tools / sed / 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 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=sed
10 PKG_VERSION:=4.1.2
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/$(PKG_NAME)
14 PKG_MD5SUM:=928f0e06422f414091917401f1a834d0
15 PKG_CAT:=zcat
16
17 PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
18
19 include $(INCLUDE_DIR)/host-build.mk
20
21 define Build/Configure
22         (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
23                 SHELL="$(BASH)" \
24                 ./configure \
25                 --prefix=$(STAGING_DIR) \
26                 --prefix=/usr \
27         );
28 endef
29
30 define Build/Compile
31         $(MAKE) -C $(PKG_BUILD_DIR) SHELL="$(BASH)"
32 endef
33
34 define Build/Install
35         @if [ -L $(STAGING_DIR)/bin/sed ] ; then \
36                 rm -f $(STAGING_DIR)/bin/sed; fi;
37         @if [ ! -f $(STAGING_DIR)/bin/sed -o $(STAGING_DIR)/bin/sed -ot $(PKG_BUILD_DIR)/sed/sed ]; then \
38             set -x; \
39             mkdir -p $(STAGING_DIR)/bin; \
40             $(MAKE) DESTDIR=$(STAGING_DIR) -C $(PKG_BUILD_DIR) install; \
41             mv $(STAGING_DIR)/usr/bin/sed $(STAGING_DIR)/bin/; \
42             rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/usr/info \
43                     $(STAGING_DIR)/usr/man $(STAGING_DIR)/usr/share/doc; \
44         fi
45 endef
46
47 $(eval $(call HostBuild))