- DESTDIR="$(IDIR_OPENSWAN)" \
- KERNELSRC="$(LINUX_DIR)" \
- ARCH="mips" \
- USERCOMPILE="$(FLAGS)" \
- IPSECDIR="/usr/lib/ipsec" \
- INC_USRLOCAL="/usr" \
- install
- -$(STRIP) $(IDIR_OPENSWAN)/usr/lib/ipsec/*
- -$(STRIP) $(IDIR_OPENSWAN)/usr/libexec/ipsec/*
- rm -rf $(IDIR_OPENSWAN)/usr/share
- rm -rf $(IDIR_OPENSWAN)/usr/man
- rm -rf $(IDIR_OPENSWAN)/var
- rm -rf $(IDIR_OPENSWAN)/etc/rc.d/rc*.d
- mkdir -p $(IDIR_OPENSWAN)/etc/init.d
- ln -sf ../rc.d/init.d/ipsec $(IDIR_OPENSWAN)/etc/init.d/S60ipsec
- find $(PKG_BUILD_DIR) -name \*.old | xargs rm -rf
- mkdir -p $(PACKAGE_DIR)
- $(IPKG_BUILD) $(IDIR_OPENSWAN) $(PACKAGE_DIR)
+ $(PKG_MAKE_OPTS) \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ DESTDIR="$(PKG_INSTALL_DIR)" \
+ programs module install
+endef
+
+define Package/openswan/install
+ $(CP) $(PKG_INSTALL_DIR)/* $(1)
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(CP) ./files/ipsec.init $(1)/etc/init.d/ipsec
+ rm -rf $(1)/usr/share
+ rm -rf $(1)/usr/man
+ rm -rf $(1)/var
+ rm -rf $(1)/etc/rc.d
+ find $(1) -name \*.old | xargs rm -rf
+endef
+
+$(eval $(call BuildPackage,openswan))
+$(eval $(call KernelPackage,openswan))