public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/siproxd/files/, net-misc/siproxd/
@ 2016-05-04  1:02 Austin English
  0 siblings, 0 replies; only message in thread
From: Austin English @ 2016-05-04  1:02 UTC (permalink / raw
  To: gentoo-commits

commit:     0f1a5374b9792e20672f222fc38b2cbb8b5ef5f8
Author:     Austin English <wizardedit <AT> gentoo <DOT> org>
AuthorDate: Wed May  4 00:48:20 2016 +0000
Commit:     Austin English <wizardedit <AT> gentoo <DOT> org>
CommitDate: Wed May  4 00:48:20 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f1a5374

net-misc/siproxd: use #!/sbin/openrc-run instead of #!/sbin/runscript

Gentoo-Bug: https://bugs.gentoo.org/573846

Package-Manager: portage-2.2.26

 net-misc/siproxd/files/siproxd.rc6       |   4 +-
 net-misc/siproxd/files/siproxd.rc7       |  31 ---------
 net-misc/siproxd/files/siproxd.rc8       |   4 +-
 net-misc/siproxd/siproxd-0.8.0-r3.ebuild | 109 ++++++++++++++++++++++++++++++
 net-misc/siproxd/siproxd-0.8.1-r2.ebuild | 110 +++++++++++++++++++++++++++++++
 5 files changed, 223 insertions(+), 35 deletions(-)

diff --git a/net-misc/siproxd/files/siproxd.rc6 b/net-misc/siproxd/files/siproxd.rc6
index 9d7fae7..63ffe15 100644
--- a/net-misc/siproxd/files/siproxd.rc6
+++ b/net-misc/siproxd/files/siproxd.rc6
@@ -1,5 +1,5 @@
-#!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 

diff --git a/net-misc/siproxd/files/siproxd.rc7 b/net-misc/siproxd/files/siproxd.rc7
deleted file mode 100644
index 88ba033..0000000
--- a/net-misc/siproxd/files/siproxd.rc7
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-depend() {
-	need net
-}
-
-check_config() {
-	if [[ ! -f /etc/siproxd.conf ]]; then
-		eerror "Please create /etc/siproxd.conf first!"
-		return 1
-	fi
-	return 0
-}
-
-start() {
-	check_config || return 1
-	checkpath -q -d /var/run/siproxd -o siproxd:siproxd
-	ebegin "Starting siproxd"
-	start-stop-daemon --start --exec /usr/sbin/siproxd -- \
-		-p /var/run/siproxd/siproxd.pid -c /etc/siproxd.conf
-	eend $?
-}
-
-stop() {
-	ebegin "Stopping siproxd"
-	start-stop-daemon --stop --pidfile /var/run/siproxd/siproxd.pid
-	eend $?
-}

diff --git a/net-misc/siproxd/files/siproxd.rc8 b/net-misc/siproxd/files/siproxd.rc8
index d85b32f..146fefb 100644
--- a/net-misc/siproxd/files/siproxd.rc8
+++ b/net-misc/siproxd/files/siproxd.rc8
@@ -1,5 +1,5 @@
-#!/sbin/runscript
-# Copyright 1999-2014 Gentoo Foundation
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 

diff --git a/net-misc/siproxd/siproxd-0.8.0-r3.ebuild b/net-misc/siproxd/siproxd-0.8.0-r3.ebuild
new file mode 100644
index 0000000..211c605
--- /dev/null
+++ b/net-misc/siproxd/siproxd-0.8.0-r3.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils autotools user
+
+DESCRIPTION="A proxy/masquerading daemon for the SIP protocol"
+HOMEPAGE="http://siproxd.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="examples doc static"
+# TODO: debug can be used but dmalloc is breaking the build
+# upstream has been contacted, see bug 2649238 in their bugtracker
+
+RDEPEND=">=net-libs/libosip-3.0.0
+	<net-libs/libosip-4.0.0"
+#	debug? ( dev-libs/dmalloc[threads] )"
+DEPEND="${RDEPEND}
+	>=sys-devel/libtool-2.4
+	doc? ( app-text/docbook-sgml-utils
+		app-text/docbook-sgml-dtd:4.2 )"
+# docbook-sgml-utils is for building doc
+# docbook-sgml-dtd is for the doc dtd even if docbook-sgml-utils depends on it
+
+pkg_setup() {
+	enewgroup siproxd
+	enewuser siproxd -1 -1 /dev/null siproxd
+}
+
+src_prepare() {
+	default
+
+	# make the daemon run as user 'siproxd' by default
+	sed -i -e "s:nobody:siproxd:" doc/siproxd.conf.example \
+		|| die "patching doc/siproxd.conf.example failed"
+	# do not fail when building with external libltdl
+	sed -i 's/libltdl //' Makefile.am || die "patching Makefile failed"
+	epatch "${FILESDIR}/${PN}-libtool-2.4.patch"
+	# do not crash when building with external libltdl, bug 308495
+	sed -i 's|"../libltdl/ltdl.h"|<ltdl.h>|' src/plugins.h || die "patching plugins.h failed"
+
+	eautoreconf
+}
+
+src_configure() {
+	# static-libosip2 make it link statically against libosip2
+	# static build static version of plugins, forced to true
+	econf \
+		$(use_enable doc) \
+		$(use_enable static static-libosip2) \
+		--enable-static
+		#$(use debug && use_enable debug dmalloc) \
+
+	# statically linked plugins to libosip2 causes a shared lib linking with
+	# static lib (gcc seems not to like it : portable issue it says).
+	# there was also DT_TEXREL issue and stripping of static plugins failed
+	# so shared lib has to be used for plugins
+	# upstream has been contacted, see bug 2649351 in their bugtracker
+	if use static; then
+		sed -i -r -e \
+			"s:LIBS =(.*)( \/[^ ]*libosip[^ ]*\.a)( \/[^ ]*libosip[^ ]*\.a)(.*):LIBS_STATIC =\1\2\3\4\nLIBS = \1\4 -losip2 -losipparser2:" \
+			src/Makefile || die "patching src/Makefile failed"
+		sed -i -e \
+			"s:\$(siproxd_LDADD) \$(LIBS):\$(siproxd_LDADD) \$(LIBS_STATIC):" \
+			src/Makefile || die "patching src/Makefile failed"
+	fi
+}
+
+src_install() {
+	einstall
+
+	newinitd "${FILESDIR}"/${PN}.rc6 ${PN}
+
+	dodoc AUTHORS ChangeLog NEWS README RELNOTES TODO \
+		doc/FAQ doc/FLI4L_HOWTO.txt doc/KNOWN_BUGS
+
+	if use doc; then
+		dodoc doc/RFC3261_compliance.txt
+		# auto-generated doc is not auto-installed
+		# upstream has been contacted, see bug 2649333 in their bugtracker
+		dohtml -r doc/html/
+		# pdf is not build all the time
+		if has_version app-text/docbook-sgml-utils[jadetex]; then
+			dodoc doc/pdf/*.pdf
+		fi
+	fi
+
+	if use examples; then
+		docinto examples
+		dodoc doc/sample_*.txt
+	fi
+
+	# set up siproxd directories
+	keepdir /var/{lib,run}/${PN}
+	fowners siproxd:siproxd /var/{lib,run}/${PN}
+}
+
+pkg_postinst() {
+	if use static; then
+		elog "static USE flag does not build a _fully_ statically linked binary"
+		elog "only libosip2 and libosipparser2 are statically linked"
+		elog "In addition, plugins are dynamically linked with those libs"
+	fi
+}

diff --git a/net-misc/siproxd/siproxd-0.8.1-r2.ebuild b/net-misc/siproxd/siproxd-0.8.1-r2.ebuild
new file mode 100644
index 0000000..15e884f
--- /dev/null
+++ b/net-misc/siproxd/siproxd-0.8.1-r2.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools user
+
+DESCRIPTION="A proxy/masquerading daemon for the SIP protocol"
+HOMEPAGE="http://siproxd.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples doc static"
+# TODO: debug can be used but dmalloc is breaking the build
+# upstream has been contacted, see bug 2649238 in their bugtracker
+
+RDEPEND=">=net-libs/libosip-3.0.0
+	<net-libs/libosip-4.0.0"
+#	debug? ( dev-libs/dmalloc[threads] )"
+DEPEND="${RDEPEND}
+	>=sys-devel/libtool-2.4
+	doc? ( app-text/docbook-sgml-utils
+		app-text/docbook-sgml-dtd:4.2 )"
+# docbook-sgml-utils is for building doc
+# docbook-sgml-dtd is for the doc dtd even if docbook-sgml-utils depends on it
+
+pkg_setup() {
+	enewgroup siproxd
+	enewuser siproxd -1 -1 /dev/null siproxd
+}
+
+src_prepare() {
+	# make the daemon run as user 'siproxd' by default
+	sed -i -e "s:nobody:siproxd:" doc/siproxd.conf.example \
+		|| die "patching doc/siproxd.conf.example failed"
+	# do not fail when building with external libltdl
+	sed -i 's/libltdl //' Makefile.am || die "patching Makefile failed"
+	epatch "${FILESDIR}/${PN}-libtool-2.4.patch"
+	# do not crash when building with external libltdl, bug 308495
+	sed -i 's|"../libltdl/ltdl.h"|<ltdl.h>|' src/plugins.h || die "patching plugins.h failed"
+
+	epatch "${FILESDIR}/${PN}-0.8.1-amd64_static_build.patch" #380835
+
+	eautoreconf
+}
+
+src_configure() {
+	# static-libosip2 make it link statically against libosip2
+	# static build static version of plugins, forced to true
+	econf \
+		$(use_enable doc) \
+		$(use_enable static static-libosip2) \
+		$(use_enable !static shared) \
+		--enable-static
+		#$(use debug && use_enable debug dmalloc) \
+
+	# statically linked plugins to libosip2 causes a shared lib linking with
+	# static lib (gcc seems not to like it : portable issue it says).
+	# there was also DT_TEXREL issue and stripping of static plugins failed
+	# so shared lib has to be used for plugins
+	# upstream has been contacted, see bug 2649351 in their bugtracker
+	if use static; then
+		sed -i -r -e \
+			"s:LIBS =(.*)( \/[^ ]*libosip[^ ]*\.a)( \/[^ ]*libosip[^ ]*\.a)(.*):LIBS_STATIC =\1\2\3\4\nLIBS = \1\4 -losip2 -losipparser2:" \
+			src/Makefile || die "patching src/Makefile failed"
+		sed -i -e \
+			"s:\$(siproxd_LDADD) \$(LIBS):\$(siproxd_LDADD) \$(LIBS_STATIC):" \
+			src/Makefile || die "patching src/Makefile failed"
+	fi
+}
+
+src_install() {
+	default
+
+	newinitd "${FILESDIR}"/${PN}.rc8 ${PN}
+
+	dodoc AUTHORS ChangeLog NEWS README RELNOTES TODO \
+		doc/FAQ doc/FLI4L_HOWTO.txt doc/KNOWN_BUGS
+
+	if use doc; then
+		dodoc doc/RFC3261_compliance.txt
+		# auto-generated doc is not auto-installed
+		# upstream has been contacted, see bug 2649333 in their bugtracker
+		dohtml -r doc/html/
+		# pdf is not build all the time
+		if has_version 'app-text/docbook-sgml-utils[jadetex]' ; then
+			dodoc doc/pdf/*.pdf
+		fi
+	fi
+
+	if use examples; then
+		docinto examples
+		dodoc doc/sample_*.txt
+	fi
+
+	# set up siproxd directories
+	keepdir /var/lib/${PN}
+	fowners siproxd:siproxd /var/lib/${PN}
+}
+
+pkg_postinst() {
+	if use static; then
+		elog "static USE flag does not build a _fully_ statically linked binary"
+		elog "only libosip2 and libosipparser2 are statically linked"
+		elog "In addition, plugins are dynamically linked with those libs"
+	fi
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-04  1:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04  1:02 [gentoo-commits] repo/gentoo:master commit in: net-misc/siproxd/files/, net-misc/siproxd/ Austin English

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox