Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Dec 2019 19:07:42 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r519628 - in head/net/opentracker: . files
Message-ID:  <201912091907.xB9J7gbf014747@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Mon Dec  9 19:07:42 2019
New Revision: 519628
URL: https://svnweb.freebsd.org/changeset/ports/519628

Log:
  Build ipv6 and ipv4 versions together and package both.
  
  Based on a suggestion by mat to have the flavours not conflict.
  
  PR:		ports/239987
  Reported by:	papadavecn@gmail.com

Added:
  head/net/opentracker/files/opentracker-ipv6.in
     - copied, changed from r509495, head/net/opentracker/files/opentracker.in
Modified:
  head/net/opentracker/Makefile
  head/net/opentracker/files/opentracker.in
  head/net/opentracker/pkg-message
  head/net/opentracker/pkg-plist

Modified: head/net/opentracker/Makefile
==============================================================================
--- head/net/opentracker/Makefile	Mon Dec  9 18:58:14 2019	(r519627)
+++ head/net/opentracker/Makefile	Mon Dec  9 19:07:42 2019	(r519628)
@@ -2,6 +2,7 @@
 
 PORTNAME=	opentracker
 PORTVERSION=	0.2017.08.13
+PORTREVISION=	2
 CATEGORIES=	net
 MASTER_SITES=	http://www.bayofrum.net/dist/${PORTNAME}/ \
 
@@ -11,9 +12,9 @@ COMMENT=	Free lightweight bittorrent tracker using lib
 BUILD_DEPENDS=	${LOCALBASE}/lib/libowfat.a:devel/libowfat
 
 USES=		tar:bzip2
-USE_RC_SUBR=	${PORTNAME}
+USE_RC_SUBR=	${PORTNAME} ${PORTNAME}-ipv6
 
-OPTIONS_DEFINE= COMPRESSION_GZIP DEBUG_HTTPERROR FULLSCRAPE RESTRICT_STATS IPV6
+OPTIONS_DEFINE= COMPRESSION_GZIP DEBUG_HTTPERROR FULLSCRAPE RESTRICT_STATS
 OPTIONS_SINGLE=	ACCESSLIST
 OPTIONS_SINGLE_ACCESSLIST=	ACCESSLIST_OPEN ACCESSLIST_BLACK \
 				ACCESSLIST_WHITE
@@ -48,10 +49,6 @@ FEATURES+=-D_DEBUG_HTTPERROR
 FEATURES+=-DWANT_FULLSCRAPE
 .endif
 
-.if ${PORT_OPTIONS:MIPV6}
-FEATURES+=-DWANT_V6
-.endif
-
 .if ${PORT_OPTIONS:MRESTRICT_STATS}
 FEATURES+=-DWANT_RESTRICT_STATS
 .endif
@@ -60,11 +57,21 @@ MAKE_ENV+=FEATURES="${FEATURES}"
 
 post-patch:
 	@${FIND} ${WRKSRC} -name "*.orig" -delete
+	${LN} ${WRKSRC}/opentracker.c ${WRKSRC}/opentracker-ipv6.c
 
+do-build:
+	${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_WRKSRC} -DWANT_V6 \
+		BINARY=opentracker-ipv6
+	${MAKE_CMD} -C ${BUILD_WRKSRC} clean
+	${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_WRKSRC}
+
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME}-ipv6 ${STAGEDIR}${PREFIX}/bin/
 	${MKDIR} ${STAGEDIR}${ETCDIR}
 	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf.sample \
 		${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample
+	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf.sample \
+		${STAGEDIR}${ETCDIR}/${PORTNAME}-ipv6.conf.sample
 
 .include <bsd.port.mk>

Copied and modified: head/net/opentracker/files/opentracker-ipv6.in (from r509495, head/net/opentracker/files/opentracker.in)
==============================================================================
--- head/net/opentracker/files/opentracker.in	Wed Aug 21 07:47:44 2019	(r509495, copy source)
+++ head/net/opentracker/files/opentracker-ipv6.in	Mon Dec  9 19:07:42 2019	(r519628)
@@ -1,29 +1,33 @@
 #!/bin/sh
-
-# PROVIDE: opentracker
+#
+# $FreeBSD$
+#
+# PROVIDE: opentracker_ipv6
 # REQUIRE: LOGIN
+# KEYWORD: shutdown
 
 # Add the following lines to /etc/rc.conf or /etc/rc.conf.local to
 # enable opentracker:
-# opentracker_enable (bool):	Set to "NO" by default.
-# opentracker_config (path):	Set to 
-#				"%%PREFIX%%/etc/opentracker/opentracker.conf"
+# opentracker_ipv6_enable (bool):	Set to "NO" by default.
+# opentracker_ipv6_config (path):	Set to 
+#			"%%PREFIX%%/etc/opentracker/opentracker-ipv6.conf"
 #				by default
 
 . /etc/rc.subr
 
-name="opentracker"
-rcvar=opentracker_enable
+name=opentracker_ipv6
+rcvar=opentracker_ipv6_enable
+desc="Lightweight Bittorrent tracker"
 
 load_rc_config $name
 
-: ${opentracker_enable="NO"}
-: ${opentracker_config="%%PREFIX%%/etc/opentracker/opentracker.conf"}
+: ${opentracker_ipv6_enable:=NO}
+: ${opentracker_ipv6_config:="%%PREFIX%%/etc/opentracker/opentracker-ipv6.conf"}
 
-command="/usr/sbin/daemon"
-command_args="-p /var/run/opentracker.pid %%PREFIX%%/bin/opentracker -f ${opentracker_config}"
-procname="%%PREFIX%%/bin/opentracker"
-pidfile="/var/run/opentracker.pid"
-required_files=${opentracker_config}
+command=/usr/sbin/daemon
+pidfile=/var/run/opentracker-ipv6.pid
+command_args="-p $pidfile %%PREFIX%%/bin/opentracker-ipv6 -f ${opentracker_ipv6_config}"
+procname="%%PREFIX%%/bin/opentracker-ipv6"
+required_files=${opentracker_ipv6_config}
 
-run_rc_command "$1"
+run_rc_command $1

Modified: head/net/opentracker/files/opentracker.in
==============================================================================
--- head/net/opentracker/files/opentracker.in	Mon Dec  9 18:58:14 2019	(r519627)
+++ head/net/opentracker/files/opentracker.in	Mon Dec  9 19:07:42 2019	(r519628)
@@ -1,29 +1,33 @@
 #!/bin/sh
-
+#
+# $FreeBSD$
+#
 # PROVIDE: opentracker
 # REQUIRE: LOGIN
+# KEYWORD: shutdown
 
 # Add the following lines to /etc/rc.conf or /etc/rc.conf.local to
 # enable opentracker:
 # opentracker_enable (bool):	Set to "NO" by default.
 # opentracker_config (path):	Set to 
-#				"%%PREFIX%%/etc/opentracker/opentracker.conf"
-#				by default
+#			"%%PREFIX%%/etc/opentracker/opentracker.conf"
+#			by default
 
 . /etc/rc.subr
 
-name="opentracker"
+name=opentracker
 rcvar=opentracker_enable
+desc="Lightweight Bittorrent tracker"
 
 load_rc_config $name
 
-: ${opentracker_enable="NO"}
-: ${opentracker_config="%%PREFIX%%/etc/opentracker/opentracker.conf"}
+: ${opentracker_enable:=NO}
+: ${opentracker_config:="%%PREFIX%%/etc/opentracker/opentracker-ipv6.conf"}
 
-command="/usr/sbin/daemon"
-command_args="-p /var/run/opentracker.pid %%PREFIX%%/bin/opentracker -f ${opentracker_config}"
+command=/usr/sbin/daemon
+pidfile=/var/run/opentracker.pid
+command_args="-p $pidfile %%PREFIX%%/bin/opentracker -f ${opentracker_config}"
 procname="%%PREFIX%%/bin/opentracker"
-pidfile="/var/run/opentracker.pid"
 required_files=${opentracker_config}
 
-run_rc_command "$1"
+run_rc_command $1

Modified: head/net/opentracker/pkg-message
==============================================================================
--- head/net/opentracker/pkg-message	Mon Dec  9 18:58:14 2019	(r519627)
+++ head/net/opentracker/pkg-message	Mon Dec  9 19:07:42 2019	(r519628)
@@ -16,5 +16,13 @@ sysctl kern.ipc.nmbclusters=32768
 sysctl net.inet.tcp.msl=10000
 sysctl kern.maxfiles=10240
 EOM
+
+In order to enable opentracker at boot time;
+
+# sysrc opentracker_enable=yes
+
+Or
+
+# sysrc opentracker_ipv6_enable=yes
 }
 ]

Modified: head/net/opentracker/pkg-plist
==============================================================================
--- head/net/opentracker/pkg-plist	Mon Dec  9 18:58:14 2019	(r519627)
+++ head/net/opentracker/pkg-plist	Mon Dec  9 19:07:42 2019	(r519628)
@@ -1,2 +1,4 @@
 bin/opentracker
+bin/opentracker-ipv6
 @sample %%ETCDIR%%/opentracker.conf.sample
+@sample %%ETCDIR%%/opentracker-ipv6.conf.sample



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912091907.xB9J7gbf014747>