packages/baresip: 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@28756 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
8e8a94399f
commit
3711b2a6b3
@ -1,97 +1,149 @@
|
|||||||
#
|
#
|
||||||
# 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:=baresip
|
PKG_NAME:=baresip
|
||||||
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:=c4e160463b2bfb2e326e916089da1c4f
|
PKG_MD5SUM:=871b876195b67c1147b60d2b663dba05
|
||||||
|
|
||||||
|
baresip-mods:= \
|
||||||
|
alsa \
|
||||||
|
avcodec \
|
||||||
|
avformat \
|
||||||
|
cons \
|
||||||
|
evdev \
|
||||||
|
g711 \
|
||||||
|
g722 \
|
||||||
|
oss \
|
||||||
|
sdl \
|
||||||
|
speex \
|
||||||
|
stdio \
|
||||||
|
uuid \
|
||||||
|
v4l \
|
||||||
|
v4l2 \
|
||||||
|
|
||||||
|
PKG_CONFIG_DEPENDS:= \
|
||||||
|
$(patsubst %,CONFIG_PACKAGE_baresip-mod-%,$(baresip-mods)) \
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
EXTRA_DEPS :=
|
define Package/baresip/Default
|
||||||
|
|
||||||
|
|
||||||
BARESIP_MODULES :=
|
|
||||||
|
|
||||||
|
|
||||||
define Package/baresip/config
|
|
||||||
source "$(SOURCE)/Config.in"
|
|
||||||
endef
|
|
||||||
|
|
||||||
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_ALSA),)
|
|
||||||
BARESIP_MODULES += USE_ALSA=1
|
|
||||||
endif
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_AVCODEC),)
|
|
||||||
BARESIP_MODULES += USE_FFMPEG=1 USE_FFMPEG_AVFORMAT=
|
|
||||||
endif
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_G711),)
|
|
||||||
BARESIP_MODULES += USE_G711=1
|
|
||||||
endif
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_G722),)
|
|
||||||
BARESIP_MODULES += USE_G722=1
|
|
||||||
endif
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_OSS),)
|
|
||||||
BARESIP_MODULES += USE_OSS=1
|
|
||||||
endif
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_SDL),)
|
|
||||||
BARESIP_MODULES += USE_SDL=1
|
|
||||||
endif
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_SPEEX),)
|
|
||||||
BARESIP_MODULES += USE_SPEEX=1
|
|
||||||
endif
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_V4L),)
|
|
||||||
BARESIP_MODULES += USE_V4L=1
|
|
||||||
endif
|
|
||||||
ifneq ($(CONFIG_BARESIP_MODULE_V4L2),)
|
|
||||||
BARESIP_MODULES += USE_V4L2=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
define Package/baresip
|
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
SUBMENU:=Telephony
|
SUBMENU:=Telephony
|
||||||
DEPENDS:=+libre +libpthread $(EXTRA_DEPS)
|
|
||||||
TITLE:=baresip Barebone SIP useragent
|
|
||||||
URL:=http://www.creytiv.com/
|
URL:=http://www.creytiv.com/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/baresip
|
||||||
|
$(call Package/baresip/Default)
|
||||||
|
TITLE:=Portable and modular SIP User-Agent with A/V support
|
||||||
|
DEPENDS:=+libre +librem +libpthread
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
baresip-mod-alsa := USE_ALSA
|
||||||
|
baresip-mod-avcodec := USE_FFMPEG
|
||||||
|
baresip-mod-avformat := USE_FFMPEG_AVFORMAT
|
||||||
|
baresip-mod-cons := USE_CONS
|
||||||
|
baresip-mod-evdev := USE_EVDEV
|
||||||
|
baresip-mod-g711 := USE_G711
|
||||||
|
baresip-mod-g722 := USE_G722
|
||||||
|
baresip-mod-oss := USE_OSS
|
||||||
|
baresip-mod-sdl := USE_SDL
|
||||||
|
baresip-mod-speex := USE_SPEEX
|
||||||
|
baresip-mod-stdio := USE_STDIO
|
||||||
|
baresip-mod-uuid := USE_UUID
|
||||||
|
baresip-mod-v4l := USE_V4L
|
||||||
|
baresip-mod-v4l2 := USE_V4L2
|
||||||
|
|
||||||
|
BARESIP_MOD_OPTIONS:= \
|
||||||
|
MOD_AUTODETECT= \
|
||||||
|
$(foreach m,$(baresip-mods),$(baresip-mod-$(m))=$(if $(CONFIG_PACKAGE_baresip-mod-$(m)),1))
|
||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||||
LIBRE_MK=../re-$(PKG_VERSION)/mk/re.mk \
|
LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \
|
||||||
LIBRE_INC=../re-$(PKG_VERSION)/include \
|
LIBRE_INC="$(STAGING_DIR)/usr/include/re" \
|
||||||
LIBRE_SO=$(STAGING_DIR)/usr/lib/libre.so \
|
LIBRE_SO="$(STAGING_DIR)/usr/lib" \
|
||||||
MOD_AUTODETECT= \
|
LIBREM_PATH="../rem" \
|
||||||
USE_STDIO=1 USE_CONS=1 USE_EVDEV=1 \
|
|
||||||
$(BARESIP_MODULES) \
|
|
||||||
CC="$(TARGET_CC)" \
|
CC="$(TARGET_CC)" \
|
||||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||||
EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \
|
EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \
|
||||||
$(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" \
|
||||||
|
$(BARESIP_MOD_OPTIONS) \
|
||||||
all install
|
all install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/baresip/install
|
define Package/baresip/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/baresip $(1)/usr/bin/
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/baresip $(1)/usr/bin/
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/baresip/modules
|
$(INSTALL_DIR) $(1)/usr/lib/baresip/modules
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/*.so $(1)/usr/lib/baresip/modules/.
|
$(CP) \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/baresip/modules/ice.so \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/baresip/modules/stun.so \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/baresip/modules/turn.so \
|
||||||
|
$(1)/usr/lib/baresip/modules/.
|
||||||
$(INSTALL_DIR) $(1)/usr/share/baresip
|
$(INSTALL_DIR) $(1)/usr/share/baresip
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/baresip/* $(1)/usr/share/baresip/.
|
$(CP) $(PKG_INSTALL_DIR)/usr/share/baresip/* $(1)/usr/share/baresip/.
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) ./files/baresip.init $(1)/etc/init.d/baresip
|
$(INSTALL_BIN) ./files/baresip.init $(1)/etc/init.d/baresip
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# 1. Name
|
||||||
|
# 2. Title
|
||||||
|
# 3. Files
|
||||||
|
# 4. Depends
|
||||||
|
#
|
||||||
|
define BuildPlugin
|
||||||
|
|
||||||
|
define Package/baresip-mod-$(1)
|
||||||
|
$$(call Package/baresip/Default)
|
||||||
|
TITLE:= baresip $(2) module
|
||||||
|
DEPENDS:= baresip $(4)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/baresip-mod-$(1)/install
|
||||||
|
[ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/baresip/modules
|
||||||
|
for f in $(3); do \
|
||||||
|
$(CP) \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/baresip/modules/$$$$$$$${f}.so \
|
||||||
|
$$(1)/usr/lib/baresip/modules/ ; \
|
||||||
|
done
|
||||||
|
endef
|
||||||
|
|
||||||
|
$$(eval $$(call BuildPackage,baresip-mod-$(1)))
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,baresip))
|
$(eval $(call BuildPackage,baresip))
|
||||||
|
|
||||||
|
$(eval $(call BuildPlugin,alsa,ALSA audio driver,alsa,+PACKAGE_baresip-mod-alsa:alsa-lib))
|
||||||
|
$(eval $(call BuildPlugin,avcodec,FFmpeg video codecs,avcodec,+PACKAGE_baresip-mod-avcodec:libffmpeg))
|
||||||
|
$(eval $(call BuildPlugin,avformat,FFmpeg video source,avformat,+PACKAGE_baresip-mod-avformat:libffmpeg))
|
||||||
|
$(eval $(call BuildPlugin,cons,console UI,cons,))
|
||||||
|
$(eval $(call BuildPlugin,evdev,input event device UI,evdev,))
|
||||||
|
$(eval $(call BuildPlugin,g711,G.711 audio codec,g711,))
|
||||||
|
$(eval $(call BuildPlugin,g722,G.722 audio codec,g722,+PACKAGE_baresip-mod-g722:libspandsp))
|
||||||
|
$(eval $(call BuildPlugin,sdl,SDL video display,sdl,+libsdl))
|
||||||
|
$(eval $(call BuildPlugin,oss,OSS audio driver,oss,))
|
||||||
|
$(eval $(call BuildPlugin,speex,Speex audio codec,speex,+PACKAGE_baresip-mod-speex:libspeex))
|
||||||
|
$(eval $(call BuildPlugin,stdio,standard I/O UI,stdio,))
|
||||||
|
$(eval $(call BuildPlugin,uuid,UUID,uuid,+libuuid))
|
||||||
|
$(eval $(call BuildPlugin,v4l,Video4Linux video source,v4l,+PACKAGE_baresip-mod-v4l:libv4l @(LINUX_2_6_30||LINUX_2_6_31||LINUX_2_6_32||LINUX_2_6_33||LINUX_2_6_34||LINUX_2_6_35||LINUX_2_6_36||LINUX_2_6_37)))
|
||||||
|
$(eval $(call BuildPlugin,v4l2,Video4Linux2 video source,v4l2,+PACKAGE_baresip-mod-v4l2:libv4l @(LINUX_2_6_30||LINUX_2_6_31||LINUX_2_6_32||LINUX_2_6_33||LINUX_2_6_34||LINUX_2_6_35||LINUX_2_6_36||LINUX_2_6_37)))
|
||||||
|
@ -1,19 +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=92
|
START=92
|
||||||
BIN=baresip
|
BIN=baresip
|
||||||
DEFAULT=/etc/default/$BIN
|
|
||||||
OPTIONS=-d
|
OPTIONS=-d
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
11
net/baresip/patches/100-loginname.patch
Normal file
11
net/baresip/patches/100-loginname.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- a/src/os.c
|
||||||
|
+++ b/src/os.c
|
||||||
|
@@ -100,7 +100,7 @@ static int get_home_unix(char *path, uin
|
||||||
|
struct passwd *pw;
|
||||||
|
char *loginname = NULL;
|
||||||
|
|
||||||
|
- loginname = getenv("LOGNAME");
|
||||||
|
+ loginname = getenv("USER");
|
||||||
|
if (!loginname) {
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
loginname = getlogin();
|
25
net/baresip/patches/101-cross.patch
Normal file
25
net/baresip/patches/101-cross.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -15,6 +15,7 @@ USE_VIDEO := 1
|
||||||
|
PROJECT := baresip
|
||||||
|
VERSION := 0.3.0
|
||||||
|
|
||||||
|
+ifndef LIBRE_MK
|
||||||
|
LIBRE_MK := $(shell [ -f ../re/mk/re.mk ] && \
|
||||||
|
echo "../re/mk/re.mk")
|
||||||
|
ifeq ($(LIBRE_MK),)
|
||||||
|
@@ -29,11 +30,14 @@ 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)
|
||||||
|
include mk/modules.mk
|
||||||
|
|
||||||
|
+ifndef LIBREM_PATH
|
||||||
|
LIBREM_PATH := $(shell [ -d ../rem ] && echo "../rem")
|
||||||
|
+endif
|
||||||
|
|
||||||
|
|
||||||
|
CFLAGS += -I. -Iinclude -I$(LIBRE_INC) -I$(SYSROOT)/include
|
Loading…
x
Reference in New Issue
Block a user