Add chaosvpn

by Christopher J. Pilkington



git-svn-id: svn://svn.openwrt.org/openwrt/packages@22820 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
ryd 2010-08-26 22:27:08 +00:00
parent a4d6166917
commit d6434b1c39
2 changed files with 85 additions and 0 deletions

55
net/chaosvpn/Makefile Normal file
View File

@ -0,0 +1,55 @@
#
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: Makefile 12693 2008-09-25 10:47:39Z nico $
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=chaosvpn
PKG_VERSION:=2.0-rc11
PKG_MD5SUM:=8c5c9ee78151d521492ceeb41a812456
PKG_REV:=2.0-rc11
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=git://github.com/ryd/chaosvpn.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/chaosvpn
SECTION:=net
CATEGORY:=Network
TITLE:=Config generator for chaos vpn
MAINTAINER:=Christopher J. Pilkington <cjp@0x1.net>
URL:=http://github.com/ryd/chaosvpn
DEPENDS:=+tinc +kmod-tun +ip +libopenssl
endef
define Package/chaosvpn/description
Configure tincd for the chaosvpn network
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
COPT="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/lib" \
LIB="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib -Wl,-rpath-link,$(STAGING_DIR)/usr/lib"
endef
define Package/chaosvpn/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chaosvpn $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/tinc
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chaosvpn.conf $(1)/etc/tinc/chaosvpn.conf.sample
endef
$(eval $(call BuildPackage,chaosvpn))

View File

@ -0,0 +1,30 @@
--- a/Makefile 2010-07-17 14:20:07.000000000 -0400
+++ b/Makefile 2010-07-17 18:50:30.000000000 -0400
@@ -1,10 +1,7 @@
-CC?=gcc
-INCLUDES?=-I/usr/local/include
-LIBDIRS?=-L/usr/local/lib
-CFLAGS?=-std=c99 -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -Wall -g $(INCLUDES)
-LIB?=-lz -lcrypto
-LEX?=flex
-YACC?=yacc
+CC := gcc
+LIBS := -lssl -lz -lcrypto
+LEX := flex
+YACC := yacc
PREFIX?=/usr
TINCDIR?=/etc/tinc
@@ -21,10 +18,10 @@
GITDEBVERSION=$(shell debian/scripts/calcdebversion )
$(NAME): main.o $(OBJ) $(HEADERS)
- $(CC) -o $@ main.o $(OBJ) $(LIB) $(LIBDIRS)
+ $(CC) $(COPT) -o $@ main.o $(OBJ) $(LIBS) $(LIB)
%.o: %.c $(HEADERS)
- $(CC) $(CFLAGS) -o $(patsubst %.c,%.o,$<) -c $<
+ $(CC) $(COPT) -o $(patsubst %.c,%.o,$<) -c $<
lex.yy.o: lex.yy.c y.tab.h