########################################## # openvpn package for PADS ########################################## #Check if we are using WARP board ifeq ($(strip $(PADS_WARP)),y) #Define version of your package OPENVPN_VER=2.1.1 #Define where your packaging will be compiled OPENVPN_DIR=$(BUILD_DIR)/openvpn-$(OPENVPN_VER) #Define the name of package to be downloaded OPENVPN_SOURCE=openvpn-$(OPENVPN_VER).zip #Define the distribution site OPENVPN_SITE=http://openvpn.net/release/ #Define a method to uncompress downloaded package OPENVPN_UNZIP=unzip endif OPENVPN_CONFIGURE_OPTS=--host=powerpc-linux \ --target=powerpc-linux \ $(OPENVPN_LZO_FLAGS) \ --with-lzo-headers=$(TARGET_DIR)/usr/include/lzo \ --with-lzo-lib=$(TARGET_DIR)/usr/lib/ ifeq ($(ARCH),) ARCH := powerpc endif export CROSS_COMPILE=ppc_4xxFP- #Rule to define how to obtain your package (wget in this case) $(DL_DIR)/$(OPENVPN_SOURCE): $(WGET) -P $(DL_DIR) $(OPENVPN_SITE)/$(OPENVPN_SOURCE) #Uncompress your package, then mark the directory with ".unpacked" file $(OPENVPN_DIR)/.unpacked: $(DL_DIR)/$(OPENVPN_SOURCE) $(OPENVPN_UNZIP) $(DL_DIR)/$(OPENVPN_SOURCE) -d $(BUILD_DIR) touch $(OPENVPN_DIR)/.unpacked # Configure the package, once done, mark the folder with ".configured" $(OPENVPN_DIR)/.configured: $(OPENVPN_DIR)/.unpacked cd $(OPENVPN_DIR); ./configure $(OPENVPN_CONFIGURE_OPTS) $(OPENVPN_LZO_FLAGS) touch $(OPENVPN_DIR)/.configured #Compile and install openvpn: $(OPENVPN_DIR)/.configured $(MAKE) -C $(OPENVPN_DIR) mkdir -p $(PERSISTENT_STORAGE)/etc cd $(TARGET_DIR)/etc; ln -sf /persistent/openvpn cp $(OPENVPN_DIR)/sample-config-files/client.conf $(PERSISTENT_STORAGE)/etc/openvpn cd $(OPENVPN_DIR); install -c -m 755 -o root -g 0 openvpn $(TARGET_DIR)/usr/local/sbin # from ./linux/Documentation/networking/tuntap.txt if [ ! -f $(TARGET_DIR)/dev/net/tun ]; then \ mkdir -p $(TARGET_DIR)/dev/net; \ mknod $(TARGET_DIR)/dev/net/tun c 10 200; \ chmod 0666 $(TARGET_DIR)/dev/net/tun; \ fi openvpn-configure: $(OPENVPN_DIR)/.configured #If you want to start over.. openvpn-clean: rm -f $(OPENVPN_DIR)/.configured $(MAKE) -C $(OPENVPN_DIR) clean openvpn-distclean: rm -f $(OPENVPN_DIR)/.configured $(MAKE) -C $(OPENVPN_DIR) distclean openvpn-config: $(OPENVPN_DIR)/.configured #This section will bring it up to defaults openvpn-dirclean: $(RM) -rf $(OPENVPN_DIR) ################################################ # # Toplevel Makefile options # ################################################# # Over here we check for "y" on our package and add it to the list of targets. # If your app requires other packages, please specify them here ifeq ($(strip $(PADS_PACKAGE_OPENVPN)),y) TARGETS+=lzo openvpn endif