1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-29 17:57:29 +02:00

Convert openvpn to new packaging style

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@893 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2005-05-14 20:21:34 +00:00
parent 811151c6ec
commit baa1468836
3 changed files with 54 additions and 56 deletions

View File

@ -20,4 +20,4 @@ config BR2_PACKAGE_OPENVPN_LZO
bool "Enable transparent compression (lzo)" bool "Enable transparent compression (lzo)"
default y default y
depends BR2_PACKAGE_OPENVPN depends BR2_PACKAGE_OPENVPN
select BR2_PACKAGE_LZO select BR2_PACKAGE_LIBLZO

View File

@ -9,10 +9,14 @@ PKG_MD5SUM:=7401faebc6baee9add32608709c54eec
PKG_SOURCE_URL:=http://openvpn.net/release @SF/openvpn PKG_SOURCE_URL:=http://openvpn.net/release @SF/openvpn
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_CAT:=zcat PKG_CAT:=zcat
PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(TOPDIR)/package/rules.mk
$(eval $(call PKG_template,OPENVPN,openvpn,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
PKG_DEPEND:="openssl, kmod-tun" PKG_DEPEND:="openssl, kmod-tun"
ifneq ($(BR2_PACKAGE_OPENVPN_LZO),y) ifneq ($(BR2_PACKAGE_OPENVPN_LZO),y)
@ -25,32 +29,34 @@ ifneq ($(BR2_PACKAGE_OPENVPN_SERVER),y)
DISABLE_SERVER:=--disable-server DISABLE_SERVER:=--disable-server
endif endif
$(DL_DIR)/$(PKG_SOURCE): $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
$(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL) (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
$(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
touch $(PKG_BUILD_DIR)/.unpacked
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
(cd $(PKG_BUILD_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \ $(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \ CFLAGS="$(strip $(TARGET_CFLAGS))" \
CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
./configure \ ./configure \
--target=$(GNU_TARGET_NAME) \ --target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--program-prefix="" \
--program-suffix="" \
--prefix=/usr \ --prefix=/usr \
--exec-prefix=/usr \ --exec-prefix=/usr \
--bindir=/usr/bin \ --bindir=/usr/bin \
--sbindir=/usr/sbin \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share \ --datadir=/usr/share \
--includedir=/usr/include \
--infodir=/usr/share/info \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--localstatedir=/var \ --localstatedir=/var \
--mandir=/usr/man \ --mandir=/usr/share/man \
--infodir=/usr/info \ --sbindir=/usr/sbin \
--program-prefix="" \ --sysconfdir=/etc \
$(DISABLE_LARGEFILE) \
$(DISABLE_NLS) \
--enable-shared \
--disable-static \
--disable-pthread \ --disable-pthread \
--disable-debug \ --disable-debug \
--disable-plugins \ --disable-plugins \
@ -62,26 +68,18 @@ $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
); );
touch $(PKG_BUILD_DIR)/.configured touch $(PKG_BUILD_DIR)/.configured
$(PKG_BUILD_DIR)/openvpn: $(PKG_BUILD_DIR)/.configured $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE) -C $(PKG_BUILD_DIR)
mkdir -p $(PKG_INSTALL_DIR)
$(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
install
touch $(PKG_BUILD_DIR)/.built
$(PKG_IPK): $(PKG_BUILD_DIR)/openvpn $(IPKG_OPENVPN):
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) install -d -m0755 $(IDIR_OPENVPN)/usr/sbin
echo "Depends: $(PKG_DEPEND)" >> $(PKG_IPK_DIR)/CONTROL/control cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(IDIR_OPENVPN)/usr/sbin/
mkdir -p $(PKG_IPK_DIR)/usr/sbin $(RSTRIP) $(IDIR_OPENVPN)
cp $(PKG_BUILD_DIR)/openvpn $(PKG_IPK_DIR)/usr/sbin/ echo "Depends: $(PKG_DEPEND)" >> $(IDIR_OPENVPN)/CONTROL/control
$(STRIP) $(PKG_IPK_DIR)/usr/sbin/* $(IPKG_BUILD) $(IDIR_OPENVPN) $(PACKAGE_DIR)
mkdir -p $(PACKAGE_DIR)
$(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/openvpn.list: $(PKG_IPK)
$(IPKG) install $(PKG_IPK)
source: $(DL_DIR)/$(PKG_SOURCE)
prepare: $(PKG_BUILD_DIR)/.unpacked
compile: $(PKG_IPK)
install: $(IPKG_STATE_DIR)/info/openvpn.list
clean:
rm -rf $(PKG_BUILD_DIR)
rm -f $(PKG_IPK)