3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=3dcf1cd7efcbe8db3148fc288d429db1
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
)
14 PKG_IPK
:=$(PACKAGE_DIR
)/$(PKG_NAME
)_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
15 PKG_IPK_DIR
:=$(PKG_BUILD_DIR
)/ipkg
17 $(DL_DIR
)/$(PKG_SOURCE
):
18 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(PKG_SOURCE
) $(PKG_MD5SUM
) $(PKG_SOURCE_URL
)
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
25 FLAGS
:= $(TARGET_CFLAGS
) -I
$(PKG_BUILD_DIR
)/linux
/include -L
$(STAGING_DIR
)/usr
/lib
-I
$(STAGING_DIR
)/usr
/include
27 $(PKG_BUILD_DIR
)/$(PKG_NAME
): $(PKG_BUILD_DIR
)/.patched
28 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
29 $(TARGET_CONFIGURE_OPTS
) \
30 KERNELSRC
="$(LINUX_DIR)" \
32 USERCOMPILE
="$(FLAGS)" \
34 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
35 $(TARGET_CONFIGURE_OPTS
) \
36 KERNELSRC
="$(LINUX_DIR)" \
38 USERCOMPILE
="$(FLAGS)" \
39 EXTRA_INCLUDE
="-I$(STAGING_DIR)/usr/include" \
40 EXTRA_LIBS
="-L$(STAGING_DIR)/usr/lib" \
41 IPSECDIR
="/usr/lib/ipsec" \
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)" \
52 USERCOMPILE
="$(FLAGS)" \
53 IPSECDIR
="/usr/lib/ipsec" \
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
)/var
61 rm -rf
$(PKG_IPK_DIR
)/etc
/rc.d
/rc
*.d
62 mkdir
-p
$(PKG_IPK_DIR
)/etc
/init.d
63 ln
-sf ..
/rc.d
/init.d
/ipsec
$(PKG_IPK_DIR
)/etc
/init.d
/S60ipsec
64 mkdir
-p
$(PKG_IPK_DIR
)/lib
/modules
/$(LINUX_VERSION
)
65 cp
$(PKG_BUILD_DIR
)/modobj
/ipsec.o
$(PKG_IPK_DIR
)/lib
/modules
/$(LINUX_VERSION
)/
66 $(TARGET_CROSS
)strip --remove-section
=.comment
--remove-section
=.note \
67 $(PKG_IPK_DIR
)/lib
/modules
/$(LINUX_VERSION
)/ipsec.o
68 mkdir
-p
$(PACKAGE_DIR
)
69 find
$(PKG_BUILD_DIR
) -name \
*.old | xargs
rm -rf
70 $(IPKG_BUILD
) $(PKG_IPK_DIR
) $(PACKAGE_DIR
)
72 $(IPKG_STATE_DIR
)/info/$(PKG_NAME
).list
: $(PKG_IPK
)
73 $(IPKG
) install $(PKG_IPK
)
75 source
: $(DL_DIR
)/$(PKG_SOURCE
)
76 prepare
: $(PKG_BUILD_DIR
)/.patched
78 install: $(IPKG_STATE_DIR
)/info/$(PKG_NAME
).list
81 rm -rf
$(PKG_BUILD_DIR
)