packages/restund: update to 0.3.0 (thanks to Alfred E. Heggestad), make it modular, use start-stop-daemon
git-svn-id: svn://svn.openwrt.org/openwrt/packages@28757 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
3711b2a6b3
commit
b511f9d210
@ -1,54 +1,114 @@
|
|||||||
#
|
#
|
||||||
# Makefile
|
# Copyright (C) 2010-2011 OpenWrt.org
|
||||||
#
|
|
||||||
# Copyright (C) 2010 Alfred E. Heggestad
|
# Copyright (C) 2010 Alfred E. Heggestad
|
||||||
#
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=restund
|
PKG_NAME:=restund
|
||||||
PKG_VERSION:=0.2.0
|
PKG_VERSION:=0.3.0
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=http://www.creytiv.com/pub/
|
PKG_SOURCE_URL:=http://www.creytiv.com/pub/
|
||||||
PKG_MD5SUM:=b8fa2ab40d7952fd78c5d72ab1742232
|
PKG_MD5SUM:=e82bdb994b26b8c16d799b3dc8dd0008
|
||||||
|
|
||||||
|
restund-mods:= \
|
||||||
|
mysql \
|
||||||
|
|
||||||
|
PKG_CONFIG_DEPENDS:= \
|
||||||
|
$(patsubst %,CONFIG_PACKAGE_restund-mod-%,$(restund-mods)) \
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/restund
|
define Package/restund/Default
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
DEPENDS:=+libre @BROKEN
|
SUBMENU:=Telephony
|
||||||
TITLE:=libre stun server
|
|
||||||
URL:=http://www.creytiv.com/
|
URL:=http://www.creytiv.com/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
#PKG_MAKE_OPTS += USE_MYSQL=
|
define Package/restund
|
||||||
|
$(call Package/restund/Default)
|
||||||
|
TITLE:=Modular STUN/TURN server
|
||||||
|
DEPENDS:=+libre +libpthread
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
restund-mod-mysql := USE_MYSQL
|
||||||
|
|
||||||
|
RESTUND_MOD_OPTIONS:= \
|
||||||
|
$(foreach m,$(restund-mods),$(restund-mod-$(m))=$(if $(CONFIG_PACKAGE_restund-mod-$(m)),1))
|
||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||||
LIBRE_MK=$(STAGING_DIR)/usr/share/re/re.mk \
|
LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \
|
||||||
LIBRE_INC=$(STAGING_DIR)/usr/include/re \
|
LIBRE_INC="$(STAGING_DIR)/usr/include/re" \
|
||||||
|
LIBRE_SO="$(STAGING_DIR)/usr/lib" \
|
||||||
CC="$(TARGET_CC)" \
|
CC="$(TARGET_CC)" \
|
||||||
CFLAGS="$(TARGET_CFLAGS)" \
|
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||||
$(PKG_MAKE_OPTS) \
|
|
||||||
SYSROOT="$(TOOLCHAIN_DIR)" \
|
SYSROOT="$(TOOLCHAIN_DIR)" \
|
||||||
SYSROOT_ALT="$(STAGING_DIR)/usr" \
|
SYSROOT_ALT="$(STAGING_DIR)/usr" \
|
||||||
RELEASE=1 \
|
RELEASE=1 \
|
||||||
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||||
|
OS="linux" \
|
||||||
|
$(RESTUND_MOD_OPTIONS) \
|
||||||
all install
|
all install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/restund/install
|
define Package/restund/install
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/restund $(1)/usr/sbin/
|
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/restund $(1)/usr/sbin/
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/$(PKG_NAME)/modules
|
$(INSTALL_DIR) $(1)/usr/lib/restund/modules
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/modules/*.so $(1)/usr/lib/$(PKG_NAME)/modules/.
|
$(CP) \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/restund/modules/auth.so \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/restund/modules/binding.so \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/restund/modules/stat.so \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/restund/modules/status.so \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/restund/modules/syslog.so \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/restund/modules/turn.so \
|
||||||
|
$(1)/usr/lib/restund/modules/
|
||||||
$(INSTALL_DIR) $(1)/etc
|
$(INSTALL_DIR) $(1)/etc
|
||||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/etc/restund.conf $(1)/etc/
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/etc/restund.conf $(1)/etc/
|
||||||
|
$(SED) \
|
||||||
|
's|^\(module_path\)\([ \t]\+\).*$$$$|\1\2/usr/lib/restund/modules|g' \
|
||||||
|
$(1)/etc/restund.conf
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) ./files/restund.init $(1)/etc/init.d/restund
|
$(INSTALL_BIN) ./files/restund.init $(1)/etc/init.d/restund
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# 1. Name
|
||||||
|
# 2. Title
|
||||||
|
# 3. Files
|
||||||
|
# 4. Depends
|
||||||
|
#
|
||||||
|
define BuildPlugin
|
||||||
|
|
||||||
|
define Package/restund-mod-$(1)
|
||||||
|
$$(call Package/restund/Default)
|
||||||
|
TITLE:= restund $(2) module
|
||||||
|
DEPENDS:= restund $(4)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/restund-mod-$(1)/install
|
||||||
|
[ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/restund/modules
|
||||||
|
for f in $(3); do \
|
||||||
|
$(CP) \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/restund/modules/$$$$$$$${f}.so \
|
||||||
|
$$(1)/usr/lib/restund/modules/ ; \
|
||||||
|
done
|
||||||
|
endef
|
||||||
|
|
||||||
|
$$(eval $$(call BuildPackage,restund-mod-$(1)))
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,restund))
|
$(eval $(call BuildPackage,restund))
|
||||||
|
|
||||||
|
$(eval $(call BuildPlugin,mysql,MySQL database backend,mysql_ser,+PACKAGE_restund-mod-mysql:libmysqlclient))
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
#
|
#
|
||||||
|
# Copyright (C) 2010-2011 OpenWrt.org
|
||||||
# Copyright (C) 2010 Alfred E. Heggestad
|
# Copyright (C) 2010 Alfred E. Heggestad
|
||||||
#
|
#
|
||||||
|
|
||||||
START=60
|
START=60
|
||||||
BIN=restund
|
BIN=restund
|
||||||
DEFAULT=/etc/default/$BIN
|
|
||||||
OPTIONS=
|
OPTIONS=
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
[ -f $DEFAULT ] && . $DEFAULT
|
start-stop-daemon -S -q -x $BIN -- $OPTIONS
|
||||||
$BIN $OPTIONS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
killall $BIN
|
start-stop-daemon -K -q -x $BIN
|
||||||
}
|
}
|
||||||
|
38
net/restund/patches/101-cross.patch
Normal file
38
net/restund/patches/101-cross.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -18,6 +18,7 @@ VERSION := $(VER_MAJOR).$(VER_MINOR).$
|
||||||
|
MODULES := binding auth turn stat status
|
||||||
|
MODULES += $(EXTRA_MODULES)
|
||||||
|
|
||||||
|
+ifndef LIBRE_MK
|
||||||
|
LIBRE_MK := $(shell [ -f ../re/mk/re.mk ] && \
|
||||||
|
echo "../re/mk/re.mk")
|
||||||
|
ifeq ($(LIBRE_MK),)
|
||||||
|
@@ -28,19 +29,27 @@ ifeq ($(LIBRE_MK),)
|
||||||
|
LIBRE_MK := $(shell [ -f /usr/local/share/re/re.mk ] && \
|
||||||
|
echo "/usr/local/share/re/re.mk")
|
||||||
|
endif
|
||||||
|
+endif
|
||||||
|
|
||||||
|
include $(LIBRE_MK)
|
||||||
|
|
||||||
|
# Optional syslog module
|
||||||
|
+ifndef USE_SYSLOG
|
||||||
|
ifneq ($(OS),win32)
|
||||||
|
+USE_SYSLOG := 1
|
||||||
|
+endif
|
||||||
|
+endif
|
||||||
|
+ifneq ($(USE_SYSLOG),)
|
||||||
|
MODULES += syslog
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Optional MySQL client module
|
||||||
|
+ifndef USE_MYSQL
|
||||||
|
USE_MYSQL := $(shell [ -f $(SYSROOT)/include/mysql/mysql.h ] || \
|
||||||
|
[ -f $(SYSROOT)/local/include/mysql/mysql.h ] || \
|
||||||
|
[ -f $(SYSROOT_ALT)/include/mysql/mysql.h ] || \
|
||||||
|
[ -f $(SYSROOT_ALT)/include/mysql5/mysql/mysql.h ] && echo "1")
|
||||||
|
+endif
|
||||||
|
ifneq ($(USE_MYSQL),)
|
||||||
|
MODULES += mysql_ser
|
||||||
|
endif
|
Loading…
x
Reference in New Issue
Block a user