- 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)
+ ARCH="$(LINUX_KARCH)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ USERCOMPILE="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/linux/include -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib " \
+ AS="$(TARGET_CC) -c $(TARGET_CFLAGS)" \
+ module
+endef
+
+define Package/kmod-openswan/install
+ mkdir -p $(1)/lib/modules/$(LINUX_VERSION)
+ $(CP) $(PKG_BUILD_DIR)/modobj*/ipsec.$(LINUX_KMOD_SUFFIX) \
+ $(1)/lib/modules/$(LINUX_VERSION)/
+endef
+
+$(eval $(call BuildPackage,kmod-openswan))