summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhauke <hauke@pkgsrc.org>2018-11-14 15:25:28 +0000
committerhauke <hauke@pkgsrc.org>2018-11-14 15:25:28 +0000
commit14ad1a29f851b7f8bb1f949e45af9a787ffb03b3 (patch)
tree303d7c9c74a61a8b9777df974b28d3d2152061d3
parent2c970ba2db36193becf2467b928588bf46e0ed3c (diff)
downloadpkgsrc-14ad1a29f851b7f8bb1f949e45af9a787ffb03b3.tar.gz
Siproxd is a proxy daemon for the SIP protocol. It handles
registrations of SIP clients on a private IP network, and rewrites the SIP message bodies to make SIP connections work via a NAT firewall. Imported from wip/siproxd.
-rw-r--r--net/Makefile3
-rw-r--r--net/siproxd/DESCR4
-rw-r--r--net/siproxd/MESSAGE7
-rw-r--r--net/siproxd/Makefile75
-rw-r--r--net/siproxd/PLIST25
-rw-r--r--net/siproxd/distinfo10
-rw-r--r--net/siproxd/files/siproxd.sh41
-rw-r--r--net/siproxd/hacks.mk17
-rw-r--r--net/siproxd/patches/patch-doc_Makefile.in21
-rw-r--r--net/siproxd/patches/patch-doc_siproxd.conf.example60
-rw-r--r--net/siproxd/patches/patch-src_plugins.h20
-rw-r--r--net/siproxd/patches/patch-src_rtpproxy.h11
12 files changed, 293 insertions, 1 deletions
diff --git a/net/Makefile b/net/Makefile
index df11151355b..7c0fc3b3c98 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1232 2018/10/23 03:18:06 riastradh Exp $
+# $NetBSD: Makefile,v 1.1233 2018/11/14 15:25:28 hauke Exp $
#
COMMENT= Networking tools
@@ -790,6 +790,7 @@ SUBDIR+= sendfile
SUBDIR+= ser
SUBDIR+= sharity-light
SUBDIR+= sipcalc
+SUBDIR+= siproxd
SUBDIR+= sipsak
SUBDIR+= sitescooper
SUBDIR+= slurm
diff --git a/net/siproxd/DESCR b/net/siproxd/DESCR
new file mode 100644
index 00000000000..93c858379e5
--- /dev/null
+++ b/net/siproxd/DESCR
@@ -0,0 +1,4 @@
+Siproxd is a proxy/masquerading daemon for the SIP protocol. It handles
+registrations of SIP clients on a private IP network and performs rewriting
+of the SIP message bodies to make SIP connections work via a masquerading
+firewall (NAT).
diff --git a/net/siproxd/MESSAGE b/net/siproxd/MESSAGE
new file mode 100644
index 00000000000..cc7c90a8e70
--- /dev/null
+++ b/net/siproxd/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2018/11/14 15:25:28 hauke Exp $
+
+To run siproxd chrooted on NetBSD, in ${PKG_SYSCONFDIR}/siproxd.conf
+set 'chrootjail', and in /etc/rc.conf set 'siproxd_chrootdir' accordingly.
+
+===========================================================================
diff --git a/net/siproxd/Makefile b/net/siproxd/Makefile
new file mode 100644
index 00000000000..638bbae2691
--- /dev/null
+++ b/net/siproxd/Makefile
@@ -0,0 +1,75 @@
+# $NetBSD: Makefile,v 1.1 2018/11/14 15:25:28 hauke Exp $
+
+DISTNAME= siproxd-0.8.2
+PKGREVISION= 2
+CATEGORIES= net
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=siproxd/}
+
+MAINTAINER= schwarz@NetBSD.org
+HOMEPAGE= http://siproxd.sourceforge.net/
+COMMENT= Session Initiation Protocol Application-Level Gateway (SIP ALG)
+LICENSE= gnu-gpl-v2
+
+GNU_CONFIGURE= YES
+USE_TOOLS+= gmake
+
+.include "../../mk/bsd.prefs.mk"
+
+BUILD_DEFS+= VARBASE
+
+SIPROXD_USER?= siproxd
+SIPROXD_GROUP?= siproxd
+SIPROXD_HOME?= ${VARBASE}/chroot/siproxd
+
+PKG_GROUPS= ${SIPROXD_GROUP}
+PKG_USERS= ${SIPROXD_USER}:${SIPROXD_GROUP}
+
+PKG_GECOS.${SIPROXD_USER}= SIP proxy
+PKG_HOME.${SIPROXD_USER}= ${SIPROXD_HOME}
+
+PKG_GROUPS_VARS+= SIPROXD_GROUP
+PKG_USERS_VARS+= SIPROXD_USER
+
+FILES_SUBST+= SIPROXD_USER=${SIPROXD_USER:Q}
+FILES_SUBST+= SIPROXD_GROUP=${SIPROXD_GROUP:Q}
+FILES_SUBST+= SIPROXD_HOME=${SIPROXD_HOME:Q}
+
+RCD_SCRIPTS+= siproxd
+PKG_SYSCONFSUBDIR= siproxd
+
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+= --with-libosip-prefix=${BUILDLINK_PREFIX.libosip2}
+
+DOCDIR= share/doc/siproxd
+EGDIR= share/examples/siproxd
+
+CONF_FILES= ${PREFIX}/${EGDIR}/siproxd.conf.example \
+ ${PKG_SYSCONFDIR}/siproxd.conf
+CONF_FILES+= ${PREFIX}/${EGDIR}/siproxd_passwd.cfg \
+ ${PKG_SYSCONFDIR}/siproxd_passwd.cfg
+
+OWN_DIRS+= ${SIPROXD_HOME}
+
+INSTALLATION_DIRS= sbin ${DOCDIR} ${EGDIR}
+
+SUBST_CLASSES+= paths
+SUBST_STAGE.paths= pre-configure
+SUBST_FILES.paths= doc/siproxd.conf.example
+SUBST_MESSAGE.paths= performing pathname substitutions
+SUBST_VARS.paths= VARBASE PREFIX PKG_SYSCONFDIR SIPROXD_USER SIPROXD_HOME
+
+post-install:
+.for ff in README RELNOTES doc/FAQ doc/KNOWN_BUGS doc/RFC3261_compliance.txt
+ ${INSTALL_DATA} ${WRKSRC}/${ff} ${DESTDIR}${PREFIX}/${DOCDIR}/
+.endfor
+.for ff in sample_asterisk.txt sample_cfg_budgetone.txt sample_cfg_x-lite.txt
+ ${INSTALL_DATA} ${WRKSRC}/doc/${ff} ${DESTDIR}${PREFIX}/${EGDIR}/
+.endfor
+
+.include "../../mk/pthread.buildlink3.mk"
+# siproxd's configure does not check for PTHREAD_LDFLAGS
+PTHREAD_LIBS+= ${PTHREAD_LDFLAGS}
+
+.include "../../devel/libosip/buildlink3.mk"
+.include "../../devel/libltdl/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/siproxd/PLIST b/net/siproxd/PLIST
new file mode 100644
index 00000000000..8cf92245fce
--- /dev/null
+++ b/net/siproxd/PLIST
@@ -0,0 +1,25 @@
+@comment $NetBSD: PLIST,v 1.1 2018/11/14 15:25:28 hauke Exp $
+lib/siproxd/plugin_codecfilter.la
+lib/siproxd/plugin_defaulttarget.la
+lib/siproxd/plugin_demo.la
+lib/siproxd/plugin_fix_DTAG.la
+lib/siproxd/plugin_fix_bogus_via.la
+lib/siproxd/plugin_fix_fbox_anoncall.la
+lib/siproxd/plugin_logcall.la
+lib/siproxd/plugin_prefix.la
+lib/siproxd/plugin_regex.la
+lib/siproxd/plugin_shortdial.la
+lib/siproxd/plugin_siptrunk.la
+lib/siproxd/plugin_stripheader.la
+lib/siproxd/plugin_stun.la
+sbin/siproxd
+share/doc/siproxd/FAQ
+share/doc/siproxd/KNOWN_BUGS
+share/doc/siproxd/README
+share/doc/siproxd/RELNOTES
+share/doc/siproxd/RFC3261_compliance.txt
+share/examples/siproxd/sample_asterisk.txt
+share/examples/siproxd/sample_cfg_budgetone.txt
+share/examples/siproxd/sample_cfg_x-lite.txt
+share/examples/siproxd/siproxd.conf.example
+share/examples/siproxd/siproxd_passwd.cfg
diff --git a/net/siproxd/distinfo b/net/siproxd/distinfo
new file mode 100644
index 00000000000..9f70c5b4907
--- /dev/null
+++ b/net/siproxd/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1 2018/11/14 15:25:28 hauke Exp $
+
+SHA1 (siproxd-0.8.2.tar.gz) = 065a72695a1182970a8f457a8c51809145f90ed4
+RMD160 (siproxd-0.8.2.tar.gz) = 57c76ef20ee4e9f1c5910526ed8e72129587a17e
+SHA512 (siproxd-0.8.2.tar.gz) = 25bc4fd4353574fff3253b06f75ad17435d993270780b9f3c8e520c982587247adb7794563083c349aee95e1fa2b0255187c8baa5ec3d72db39b67787f5a85b3
+Size (siproxd-0.8.2.tar.gz) = 846148 bytes
+SHA1 (patch-doc_Makefile.in) = 5cbd0460e12609f0551959e266ce4b9ca37c7559
+SHA1 (patch-doc_siproxd.conf.example) = 74be8af2124ec65e8f125ee81dedf666fd032088
+SHA1 (patch-src_plugins.h) = 678f5c87e8695137c3f9290f55b3070d5262e247
+SHA1 (patch-src_rtpproxy.h) = 4189e1fa35e878ba836eb860a7143515f51aa5c1
diff --git a/net/siproxd/files/siproxd.sh b/net/siproxd/files/siproxd.sh
new file mode 100644
index 00000000000..27a60330928
--- /dev/null
+++ b/net/siproxd/files/siproxd.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $NetBSD: siproxd.sh,v 1.1 2018/11/14 15:25:28 hauke Exp $
+#
+
+# PROVIDE: siproxd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: chrootdir
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="siproxd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+pidfile="@VARBASE@/run/${name}/${name}.pid"
+required_files="@PKG_SYSCONFDIR@/siproxd.conf"
+start_precmd="siproxd_precmd"
+
+siproxd_precmd()
+{
+ rc_flags="-p ${pidfile} $rc_flags"
+
+ local piddir="$(dirname "${pidfile}")"
+
+ # Make sure @VARBASE@/run/siproxd exists
+ mkdir -p "${siproxd_chrootdir}${piddir}"
+ chown @SIPROXD_USER@:@SIPROXD_GROUP@ "${siproxd_chrootdir}${piddir}"
+
+ # If chrooted, provide a link to the pid and registrations file
+ # Note: siproxd chroots itself, if so configured
+
+ if [ -n "${siproxd_chrootdir}" ]; then
+ ln -snf "${siproxd_chrootdir}${piddir}" "${piddir}"
+ fi
+
+ return 0
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/siproxd/hacks.mk b/net/siproxd/hacks.mk
new file mode 100644
index 00000000000..a99d813c8c5
--- /dev/null
+++ b/net/siproxd/hacks.mk
@@ -0,0 +1,17 @@
+# $NetBSD: hacks.mk,v 1.1 2018/11/14 15:25:28 hauke Exp $
+
+.if !defined(SIPROXD_HACKS_MK)
+SIPROXD_HACKS_MK= # defined
+
+### [Sunday January 7 15:09:27 MET 2007 : schwarz]
+### Solaris (prior to Solaris 9) has inet_ntop in llib-lresolv,
+### but proper header files and some defines are missing
+###
+.if ${OPSYS} == "SunOS"
+. if ${OS_VERSION} < 5.9
+PKG_HACKS+= no-proper-inet_ntop
+CONFIGURE_ENV+= ac_cv_func_inet_ntop="no"
+. endif
+.endif
+
+.endif
diff --git a/net/siproxd/patches/patch-doc_Makefile.in b/net/siproxd/patches/patch-doc_Makefile.in
new file mode 100644
index 00000000000..08c85b6be36
--- /dev/null
+++ b/net/siproxd/patches/patch-doc_Makefile.in
@@ -0,0 +1,21 @@
+$NetBSD: patch-doc_Makefile.in,v 1.1 2018/11/14 15:25:28 hauke Exp $
+
+DESTDIR support for configuration files
+
+--- doc/Makefile.in.orig 2012-04-06 22:58:58.000000000 +0200
++++ doc/Makefile.in 2012-04-06 22:59:04.000000000 +0200
+@@ -547,10 +547,10 @@
+ # install local data
+ #
+ install-data-local:
+- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+- $(INSTALL_DATA) $(srcdir)/siproxd.conf.example $(DESTDIR)$(sysconfdir)/
+- $(INSTALL_DATA) $(srcdir)/siproxd_passwd.cfg $(DESTDIR)$(sysconfdir)/
+- chmod 600 $(DESTDIR)$(sysconfdir)/siproxd_passwd.cfg
++ $(mkinstalldirs) $(DESTDIR)$(prefix)/share/examples/siproxd
++ $(INSTALL_DATA) $(srcdir)/siproxd.conf.example $(DESTDIR)$(prefix)/share/examples/siproxd/
++ $(INSTALL_DATA) $(srcdir)/siproxd_passwd.cfg $(DESTDIR)$(prefix)/share/examples/siproxd/
++ chmod 600 $(DESTDIR)$(prefix)/share/examples/siproxd/siproxd_passwd.cfg
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
+ @have_docbook2pdf_TRUE@ $(INSTALL_DATA) $(srcdir)/pdf/* $(DESTDIR)$(docdir)/
+ @have_docbook2html_TRUE@ $(INSTALL_DATA) $(srcdir)/html/* $(DESTDIR)$(docdir)/
diff --git a/net/siproxd/patches/patch-doc_siproxd.conf.example b/net/siproxd/patches/patch-doc_siproxd.conf.example
new file mode 100644
index 00000000000..a970095f533
--- /dev/null
+++ b/net/siproxd/patches/patch-doc_siproxd.conf.example
@@ -0,0 +1,60 @@
+$NetBSD: patch-doc_siproxd.conf.example,v 1.1 2018/11/14 15:25:28 hauke Exp $
+
+Substitute path and user information.
+
+--- doc/siproxd.conf.example.orig 2016-03-25 18:44:51.000000000 +0000
++++ doc/siproxd.conf.example
+@@ -1,5 +1,5 @@
+ #
+-# /etc/siproxd.conf - siproxd configuration file
++# @PKG_SYSCONFDIR@/siproxd.conf - siproxd configuration file
+ #
+ # !! This is a sample file, adapt it to your needs before using it !!
+ #
+@@ -78,8 +78,8 @@ silence_log = 1
+ # Secure Enviroment settings:
+ # user: uid/gid to switch to after startup
+ # chrootjail: path to chroot to (chroot jail)
+-user = nobody
+-#chrootjail = /var/lib/siproxd/
++user = @SIPROXD_USER@
++#chrootjail = @SIPROXD_HOME@/
+
+ ######################################################################
+ # Memory settings
+@@ -100,7 +100,7 @@ user = nobody
+ # the specified directory path does exist!
+ # Note: If running in chroot jail, this path starts relative
+ # to the jail.
+-registration_file = /var/lib/siproxd/siproxd_registrations
++registration_file = @VARBASE@/run/siproxd/siproxd_registrations
+
+ ######################################################################
+ # Automatically save current registrations every 'n' seconds
+@@ -113,7 +113,7 @@ autosave_registrations = 300
+ # This file holds the PID of the main thread of siproxd.
+ # Note: If running in chroot jail, this path starts relative
+ # to the jail.
+-pid_file = /var/run/siproxd/siproxd.pid
++pid_file = @VARBASE@/run/siproxd/siproxd.pid
+
+ ######################################################################
+ # global switch to control the RTP proxy behaviour
+@@ -213,7 +213,7 @@ tcp_keepalive = 20
+ #
+ # OR use individual per user passwords stored in a file
+ #
+-#proxy_auth_pwfile = /etc/siproxd_passwd.cfg
++#proxy_auth_pwfile = @PKG_SYSCONFDIR@/siproxd_passwd.cfg
+ #
+ # 'proxy_auth_pwfile' has precedence over 'proxy_auth_passwd'
+
+@@ -323,7 +323,7 @@ debug_port = 0
+ # the processing order is given by the load order.
+ #
+ # plugin_dir: MUST be terminated with '/'
+-plugindir=/usr/lib/siproxd/
++plugindir=@PREFIX@/lib/siproxd/
+ #
+ # List of plugins to load. MUST use the .la file extension!
+ #load_plugin=plugin_demo.la
diff --git a/net/siproxd/patches/patch-src_plugins.h b/net/siproxd/patches/patch-src_plugins.h
new file mode 100644
index 00000000000..856a0c4fb16
--- /dev/null
+++ b/net/siproxd/patches/patch-src_plugins.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_plugins.h,v 1.1 2018/11/14 15:25:28 hauke Exp $
+
+using libtool 2.x
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/siproxd/files/siproxd-libtool-2.4.patch?view=markup
+
+--- src/plugins.h.orig 2015-10-15 15:29:20.000000000 +0200
++++ src/plugins.h 2017-04-03 22:25:39.000000000 +0200
+@@ -41,6 +41,12 @@
+
+ /* Plugins must return STS_SUCCESS / SUCCESS_FAILURE */
+
++#ifndef lt__PROGRAM__LTX_preloaded_symbols
++#define lt__PROGRAM__LTX_preloaded_symbols lt_libltdl_LTX_preloaded_symbols
++#endif
++#ifndef lt_libltdl_LTX_preloaded_symbols
++extern LT_DLSYM_CONST lt_dlsymlist lt__PROGRAM__LTX_preloaded_symbols[];
++#endif
+
+ /*
+ * Processing stages for Plugins
diff --git a/net/siproxd/patches/patch-src_rtpproxy.h b/net/siproxd/patches/patch-src_rtpproxy.h
new file mode 100644
index 00000000000..e66b064bae3
--- /dev/null
+++ b/net/siproxd/patches/patch-src_rtpproxy.h
@@ -0,0 +1,11 @@
+$NetBSD: patch-src_rtpproxy.h,v 1.1 2018/11/14 15:25:28 hauke Exp $
+
+Missing sys/time.h for struct timeval
+
+--- src/rtpproxy.h.orig 2011-05-28 15:47:15.000000000 +0000
++++ src/rtpproxy.h
+@@ -22,2 +22,4 @@
+
++#include <sys/time.h>
++
+ #define CALLIDNUM_SIZE 256