Changes between Version 2 and Version 3 of OpenvpnDevelPackageForOpenWRT


Ignore:
Timestamp:
08/03/10 17:16:22 (14 years ago)
Author:
Gert Döring
Comment:

openvpn-devel is in the wrt tree now - remove Makefile, explain building from feed

Legend:

Unmodified
Added
Removed
Modified
  • OpenvpnDevelPackageForOpenWRT

    v2 v3  
    66
    77If you want IPv6 support or any of the other features in the development tree, you have to build your own package, based on the openvpn-devel sources.  Given that OpenWRT packages are not for standard i386/amd64 CPUs but usually some sort of MIPS system, you need a cross-compilation environment and special tools - but that's all already provided by the OpenWRT folks, so you just need to add a few bits to add your own package.
     8
     9Update: 2010/08/03: there is an openvpn-devel package in the official OpenWRT package tree.  So far it's not available as binary, so this document explains how to checkout the source tree and build from there.
    810
    911= how to build =
     
    2224}}}
    2325
    24  3. now add a directory for "openvpn-devel" (the package tree has "openvpn" already), and copy a few files from the existing openvpn package (we're lazy):
     26 3. check that the openvpn-devel version that is included is the one that you want to build
     27
    2528  {{{
    26 backfire$ cd package
    27 backfire/package$ mkdir openvpn_devel
    28 backfire/package$ cd openvpn_devel
    29 backfire/package/openvpn_devel$ cp -r ../feeds/packages/openvpn/files .
    30 backfire/package/openvpn_devel$
     29backfire$ cd package/feeds/packages/openvpn-devel
     30backfire/package/feeds/packages/openvpn-devel$ grep ^PKG_VERSION Makefile
     31PKG_VERSION:=201026
    3132}}}
    3233
    33   (you could pick any name you want for the package directory, but it's useful to be consistent with the definitions in the Makefile itself)
    34 
    35  4. copy-paste the following text to a file named "Makefile" in this directory:
    36   {{{
    37 #
    38 # Makefile for openvpn-devel package for OpenWRT
    39 #
    40 
    41 include $(TOPDIR)/rules.mk
    42 
    43 PKG_NAME:=openvpn_devel
    44 # this is "2010, week 26"
    45 PKG_VERSION:=201026
    46 # BUILD_DIR has to accomodate path naming of source tarball
    47 PKG_BUILD_DIR:=$(BUILD_DIR)/openvpn-devel
    48 PKG_RELEASE:=1
    49 
    50 PKG_SOURCE:=openvpn-$(PKG_VERSION).tar.gz
    51 PKG_SOURCE_URL:=ftp://ftp.secure-computing.net/pub/FreeBSD/ports/openvpRCE")
    52 # MD5 check disabled for now - but if you want to be sure that you have the right
    53 # package, calculate MD5 sum with "md5sum openvpn-201026.tar.gz" and add here
    54 # PKG_MD5SUM:=424e7ae5de6430374e97c9e458ee45d5
    55 
    56 PKG_INSTALL:=1
    57 
    58 include $(INCLUDE_DIR)/package.mk
    59 
    60 define Package/openvpn_devel
    61   SECTION:=net
    62   CATEGORY:=Network
    63   DEPENDS:=+kmod-tun +kmod-ipv6 +libopenssl +liblzo +ip
    64   TITLE:=Open source VPN solution using SSL - DEVEL VERSION
    65   URL:=http://openvpn.net
    66   SUBMENU:=VPN
    67 endef
    68 
    69 define Package/openvpn_devel/conffiles
    70 /etc/config/openvpn
    71 endef
    72 
    73 define Package/openvpn_devel/description
    74          Open source VPN solution using SSL - DEVEL VERSION, Week $(PKG_VERSION)
    75 endef
    76 
    77 define Build/Configure
    78         $(call Build/Configure/Default, \
    79                 --disable-pthread \
    80                 --disable-debug \
    81                 --disable-plugins \
    82                 --enable-management \
    83                 --disable-socks \
    84                 --enable-password-save \
    85                 --enable-iproute2 \
    86                 --with-iproute-path=/usr/sbin/ip \
    87                 ,\
    88                 ac_cv_func_epoll_create=no \
    89         )
    90 endef
    91 
    92 define Package/openvpn_devel/install
    93         $(INSTALL_DIR) $(1)/usr/sbin
    94         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(1)/usr/sbin/
    95         $(INSTALL_DIR) $(1)/etc/init.d/
    96         $(INSTALL_BIN) files/openvpn.init $(1)/etc/init.d/openvpn
    97         $(INSTALL_DIR) $(1)/etc/config
    98         $(INSTALL_CONF) files/openvpn.config $(1)/etc/config/openvpn
    99         $(INSTALL_DIR) $(1)/etc/openvpn
    100 endef
    101 
    102 $(eval $(call BuildPackage,openvpn_devel))
     34  this number is the "week 26 of the year 2010", which is the tarball that we're building from.  If you change that, do not forget to update the PKG_MD5SUM line in the Makefile, otherwise building will fail (checksum error).  If you're lazy, just remove the PKG_MD5SUM line (this will disable checksumming the downloaded tar archive).
    10335
    10436
    105 }}}
    106 
    107  5. go back to the top level directory and run the config scripts:
     37 4. go back to the top level directory and run the config scripts:
    10838{{{
    109 backfire/package/openvpn_devel$ cd ../..
     39backfire/package/feeds/packages/openvpn-devel$ cd ../../../..
    11040backfire$ make defconfig
    11141backfire$ make menuconfig
     
    11747
    11848
    119  6. run "make" and wait... - this will take a long time, building the C compiler (for cross-building to MIPS cpu) and the target system's C library etc. first.
     49 5. run "make" and wait... - this will take a long time, building the C compiler (for cross-building to MIPS cpu) and the target system's C library etc. first.
    12050
    12151{{{
     
    12555 make[3] -C target/linux compile
    12656...
    127  make[3] -C package/zlib compile
    128  make[3] -C package/openssl compile
    129  make[3] -C package/iproute2 compile
     57 make[3] -C feeds/packages/libs/lzo compile
    13058 make[3] -C package/iptables compile
     59 make[3] -C package/opkg compile
    13160 make[3] -C package/firewall compile
     61 make[3] -C package/crda compile
    13262 make[3] -C package/hostapd compile
    133  make[3] -C package/kernel compile
    134  make[3] -C package/mtd compile
    135  make[3] -C package/openvpn_devel compile   <<<<< :-)
    136  make[3] -C package/opkg compile
     63 make[3] -C feeds/packages/net/openvpn-devel compile   <<<<< :-)
    13764...
    13865 make[3] package/preconfig
     
    14370}}}
    14471
    145  7. now you have an openvpn_devel package in ./bin/ar71xx/packages/
     72 6. now you have an openvpn-devel package in ./bin/ar71xx/packages/
    14673
    14774{{{
    14875backfire$ ls -l bin/ar71xx/packages/
    14976...
    150 -rw-r--r-- 1 gert users 182075 27. Jun 16:03 openvpn_devel_201026-1_ar71xx.ipk
     77-rw-r--r-- 1 gert users 182075 27. Jun 16:03 openvpn-devel_201026-1_ar71xx.ipk
    15178...
    15279}}}
     
    16289Inflating http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/Packages.gz.
    16390Updated list of available packages in /var/opkg-lists/packages.
    164 root@openwrt:/tmp# wget http:<myserver>/openvpn_devel_201026-1_ar71xx.ipk
     91root@openwrt:/tmp# wget http:<myserver>/openvpn-devel_201026-1_ar71xx.ipk
    16592...
    16693root@openwrt:/tmp$ opkg install openvpn*ipk
     
    184111Configuring libopenssl.
    185112Configuring liblzo.
    186 Configuring openvpn_devel.
     113Configuring openvpn-devel.
    187114root@OpenWrt:/tmp# openvpn |head -2
    188115OpenVPN testing-f0b02a9dfab6 mips-openwrt-linux [SSL] [LZO2] [MH] [PF_INET6] [IPv6 payload 20100307-1] built on Jun 27 2010