add SIOCSIWFRAG and SIOCSIWRTS
[openwrt.git] / package / openswan / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=openswan
6 PKG_VERSION:=2.3.1dr6
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=x
9
10 PKG_SOURCE_URL:=http://www.openswan.org/download
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
13 PKG_CAT:=zcat
14 PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
15 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
16
17 $(DL_DIR)/$(PKG_SOURCE):
18 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
19
20 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE)
21 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
22 $(PATCH) $(PKG_BUILD_DIR) ./patches
23 touch $(PKG_BUILD_DIR)/.patched
24
25 FLAGS := $(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/linux/include -L$(STAGING_DIR)/usr/lib -I$(STAGING_DIR)/usr/include
26
27 $(PKG_BUILD_DIR)/$(PKG_NAME): $(PKG_BUILD_DIR)/.patched
28 $(MAKE) -C $(PKG_BUILD_DIR) \
29 $(TARGET_CONFIGURE_OPTS) \
30 KERNELSRC="$(LINUX_DIR)" \
31 ARCH="mips" \
32 USERCOMPILE="$(FLAGS)" \
33 module
34 $(MAKE) -C $(PKG_BUILD_DIR) \
35 $(TARGET_CONFIGURE_OPTS) \
36 KERNELSRC="$(LINUX_DIR)" \
37 ARCH="mips" \
38 USERCOMPILE="$(FLAGS)" \
39 EXTRA_INCLUDE="-I$(STAGING_DIR)/usr/include" \
40 EXTRA_LIBS="-L$(STAGING_DIR)/usr/lib" \
41 IPSECDIR="/usr/lib/ipsec" \
42 INC_USRLOCAL="/usr" \
43 programs
44
45 $(PKG_IPK): $(PKG_BUILD_DIR)/$(PKG_NAME)
46 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
47 $(MAKE) -C $(PKG_BUILD_DIR) \
48 $(TARGET_CONFIGURE_OPTS) \
49 DESTDIR="$(PKG_IPK_DIR)" \
50 KERNELSRC="$(LINUX_DIR)" \
51 ARCH="mips" \
52 USERCOMPILE="$(FLAGS)" \
53 IPSECDIR="/usr/lib/ipsec" \
54 INC_USRLOCAL="/usr" \
55 install
56 -$(STRIP) $(PKG_IPK_DIR)/usr/lib/ipsec/*
57 -$(STRIP) $(PKG_IPK_DIR)/usr/libexec/ipsec/*
58 rm -rf $(PKG_IPK_DIR)/usr/share
59 rm -rf $(PKG_IPK_DIR)/usr/man
60 rm -rf $(PKG_IPK_DIR)/etc/rc.d/rc*.d
61 mkdir -p $(PKG_IPK_DIR)/etc/init.d
62 ln -sf ../rc.d/init.d/ipsec $(PKG_IPK_DIR)/etc/init.d/S60ipsec
63 mkdir -p $(PKG_IPK_DIR)/lib/modules/$(LINUX_VERSION)
64 cp $(PKG_BUILD_DIR)/modobj/ipsec.o $(PKG_IPK_DIR)/lib/modules/$(LINUX_VERSION)/
65 mkdir -p $(PACKAGE_DIR)
66 find $(PKG_BUILD_DIR) -name \*.old | xargs rm -rf
67 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
68
69 $(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
70 $(IPKG) install $(PKG_IPK)
71
72 source: $(DL_DIR)/$(PKG_SOURCE)
73 prepare: $(PKG_BUILD_DIR)/.patched
74 compile: $(PKG_IPK)
75 install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
76
77 clean:
78 rm -rf $(PKG_BUILD_DIR)
79 rm -f $(PKG_IPK)
This page took 0.05031 seconds and 5 git commands to generate.