source: packages/net/baresip/Makefile @ 28756

Last change on this file since 28756 was 28756, checked in by nico, 5 years ago

packages/baresip: update to 0.3.0 (thanks to Alfred E. Heggestad), make it modular, use start-stop-daemon

File size: 4.4 KB
Line 
1#
2# Copyright (C) 2010-2011 OpenWrt.org
3# Copyright (C) 2010 Alfred E. Heggestad
4#
5# This is free software, licensed under the GNU General Public License v2.
6# See /LICENSE for more information.
7#
8
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=baresip
12PKG_VERSION:=0.3.0
13PKG_RELEASE:=1
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_SOURCE_URL:=http://www.creytiv.com/pub/
17PKG_MD5SUM:=871b876195b67c1147b60d2b663dba05
18
19baresip-mods:= \
20        alsa \
21        avcodec \
22        avformat \
23        cons \
24        evdev \
25        g711 \
26        g722 \
27        oss \
28        sdl \
29        speex \
30        stdio \
31        uuid \
32        v4l \
33        v4l2 \
34
35PKG_CONFIG_DEPENDS:= \
36        $(patsubst %,CONFIG_PACKAGE_baresip-mod-%,$(baresip-mods)) \
37
38include $(INCLUDE_DIR)/package.mk
39
40define Package/baresip/Default
41  SECTION:=net
42  CATEGORY:=Network
43  SUBMENU:=Telephony
44  URL:=http://www.creytiv.com/
45endef
46
47define Package/baresip
48$(call Package/baresip/Default)
49  TITLE:=Portable and modular SIP User-Agent with A/V support
50  DEPENDS:=+libre +librem +libpthread
51endef
52
53
54baresip-mod-alsa      := USE_ALSA
55baresip-mod-avcodec   := USE_FFMPEG
56baresip-mod-avformat  := USE_FFMPEG_AVFORMAT
57baresip-mod-cons      := USE_CONS
58baresip-mod-evdev     := USE_EVDEV
59baresip-mod-g711      := USE_G711
60baresip-mod-g722      := USE_G722
61baresip-mod-oss       := USE_OSS
62baresip-mod-sdl       := USE_SDL
63baresip-mod-speex     := USE_SPEEX
64baresip-mod-stdio     := USE_STDIO
65baresip-mod-uuid      := USE_UUID
66baresip-mod-v4l       := USE_V4L
67baresip-mod-v4l2      := USE_V4L2
68
69BARESIP_MOD_OPTIONS:= \
70        MOD_AUTODETECT= \
71        $(foreach m,$(baresip-mods),$(baresip-mod-$(m))=$(if $(CONFIG_PACKAGE_baresip-mod-$(m)),1))
72
73define Build/Compile
74        $(MAKE) -C $(PKG_BUILD_DIR) \
75                LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \
76                LIBRE_INC="$(STAGING_DIR)/usr/include/re" \
77                LIBRE_SO="$(STAGING_DIR)/usr/lib" \
78                LIBREM_PATH="../rem" \
79                CC="$(TARGET_CC)" \
80                DESTDIR="$(PKG_INSTALL_DIR)" \
81                EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \
82                SYSROOT="$(TOOLCHAIN_DIR)" \
83                SYSROOT_ALT="$(STAGING_DIR)/usr" \
84                RELEASE=1 \
85                CROSS_COMPILE="$(TARGET_CROSS)" \
86                OS="linux" \
87                $(BARESIP_MOD_OPTIONS) \
88                all install
89endef
90
91define Package/baresip/install
92        $(INSTALL_DIR) $(1)/usr/bin
93        $(CP) $(PKG_INSTALL_DIR)/usr/bin/baresip $(1)/usr/bin/
94        $(INSTALL_DIR) $(1)/usr/lib/baresip/modules
95        $(CP) \
96                $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/ice.so \
97                $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/stun.so \
98                $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/turn.so \
99                $(1)/usr/lib/baresip/modules/.
100        $(INSTALL_DIR) $(1)/usr/share/baresip
101        $(CP) $(PKG_INSTALL_DIR)/usr/share/baresip/* $(1)/usr/share/baresip/.
102        $(INSTALL_DIR) $(1)/etc/init.d
103        $(INSTALL_BIN) ./files/baresip.init $(1)/etc/init.d/baresip
104endef
105
106
107#
108# 1. Name
109# 2. Title
110# 3. Files
111# 4. Depends
112#
113define BuildPlugin
114
115  define Package/baresip-mod-$(1)
116    $$(call Package/baresip/Default)
117    TITLE:= baresip $(2) module
118    DEPENDS:= baresip $(4)
119  endef
120
121  define Package/baresip-mod-$(1)/install
122        [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/baresip/modules
123        for f in $(3); do \
124                $(CP) \
125                        $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/$$$$$$$${f}.so \
126                        $$(1)/usr/lib/baresip/modules/ ; \
127        done
128  endef
129
130  $$(eval $$(call BuildPackage,baresip-mod-$(1)))
131endef
132
133
134$(eval $(call BuildPackage,baresip))
135
136$(eval $(call BuildPlugin,alsa,ALSA audio driver,alsa,+PACKAGE_baresip-mod-alsa:alsa-lib))
137$(eval $(call BuildPlugin,avcodec,FFmpeg video codecs,avcodec,+PACKAGE_baresip-mod-avcodec:libffmpeg))
138$(eval $(call BuildPlugin,avformat,FFmpeg video source,avformat,+PACKAGE_baresip-mod-avformat:libffmpeg))
139$(eval $(call BuildPlugin,cons,console UI,cons,))
140$(eval $(call BuildPlugin,evdev,input event device UI,evdev,))
141$(eval $(call BuildPlugin,g711,G.711 audio codec,g711,))
142$(eval $(call BuildPlugin,g722,G.722 audio codec,g722,+PACKAGE_baresip-mod-g722:libspandsp))
143$(eval $(call BuildPlugin,sdl,SDL video display,sdl,+libsdl))
144$(eval $(call BuildPlugin,oss,OSS audio driver,oss,))
145$(eval $(call BuildPlugin,speex,Speex audio codec,speex,+PACKAGE_baresip-mod-speex:libspeex))
146$(eval $(call BuildPlugin,stdio,standard I/O UI,stdio,))
147$(eval $(call BuildPlugin,uuid,UUID,uuid,+libuuid))
148$(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)))
149$(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)))
Note: See TracBrowser for help on using the repository browser.