diff options
author | crees <crees@FreeBSD.org> | 2019-12-10 03:07:42 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2019-12-10 03:07:42 +0800 |
commit | 8d094deebb02efed4fccc49f182411a69ff440ea (patch) | |
tree | 6788b34917e6ade821c360c2e80e76bd4e8df4aa /net | |
parent | bb0b43f8809579b6fc0594233be1ccdba3aff2d6 (diff) | |
download | freebsd-ports-gnome-8d094deebb02efed4fccc49f182411a69ff440ea.tar.gz freebsd-ports-gnome-8d094deebb02efed4fccc49f182411a69ff440ea.tar.zst freebsd-ports-gnome-8d094deebb02efed4fccc49f182411a69ff440ea.zip |
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
Diffstat (limited to 'net')
-rw-r--r-- | net/opentracker/Makefile | 21 | ||||
-rw-r--r-- | net/opentracker/files/opentracker-ipv6.in | 33 | ||||
-rw-r--r-- | net/opentracker/files/opentracker.in | 24 | ||||
-rw-r--r-- | net/opentracker/pkg-message | 8 | ||||
-rw-r--r-- | net/opentracker/pkg-plist | 2 |
5 files changed, 71 insertions, 17 deletions
diff --git a/net/opentracker/Makefile b/net/opentracker/Makefile index 65c60e265c54..88b4219f8580 100644 --- a/net/opentracker/Makefile +++ b/net/opentracker/Makefile @@ -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 libowfat 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> diff --git a/net/opentracker/files/opentracker-ipv6.in b/net/opentracker/files/opentracker-ipv6.in new file mode 100644 index 000000000000..0daea2686734 --- /dev/null +++ b/net/opentracker/files/opentracker-ipv6.in @@ -0,0 +1,33 @@ +#!/bin/sh +# +# $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_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_ipv6 +rcvar=opentracker_ipv6_enable +desc="Lightweight Bittorrent tracker" + +load_rc_config $name + +: ${opentracker_ipv6_enable:=NO} +: ${opentracker_ipv6_config:="%%PREFIX%%/etc/opentracker/opentracker-ipv6.conf"} + +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 diff --git a/net/opentracker/files/opentracker.in b/net/opentracker/files/opentracker.in index dd3381f1af8d..3ddf9e7972ce 100644 --- a/net/opentracker/files/opentracker.in +++ b/net/opentracker/files/opentracker.in @@ -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 diff --git a/net/opentracker/pkg-message b/net/opentracker/pkg-message index 80b22806519e..1fc8c19e44e3 100644 --- a/net/opentracker/pkg-message +++ b/net/opentracker/pkg-message @@ -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 } ] diff --git a/net/opentracker/pkg-plist b/net/opentracker/pkg-plist index 865816c0227c..0ad006917720 100644 --- a/net/opentracker/pkg-plist +++ b/net/opentracker/pkg-plist @@ -1,2 +1,4 @@ bin/opentracker +bin/opentracker-ipv6 @sample %%ETCDIR%%/opentracker.conf.sample +@sample %%ETCDIR%%/opentracker-ipv6.conf.sample |