Index: net-p2p/transmission/Makefile =================================================================== --- net-p2p/transmission/Makefile +++ net-p2p/transmission/Makefile @@ -1,18 +1,154 @@ # $FreeBSD$ PORTNAME= transmission -PORTVERSION= 2.93 +DISTVERSION= 2.93 CATEGORIES= net-p2p +PKGNAMESUFFIX= -${FLAVOR} MAINTAINER= crees@FreeBSD.org -COMMENT= Meta-port for Transmission BitTorrent client +COMMENT= Transmission is a fast, easy, and free BitTorrent client -RUN_DEPENDS= transmission-cli:net-p2p/transmission-cli \ - transmission-daemon:net-p2p/transmission-daemon \ - transmission-gtk:net-p2p/transmission-gtk +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING -CONFLICTS_INSTALL= ${PORTNAME}${PKGNAMESUFFIX}-2.[56]* +# FLAVOR should come after LIB_DEPENDS but I couldn't find a +# workaround to the web FLAVOR which does not have LIB_DEPENDS. +FLAVORS= cli daemon gtk qt4 qt5 web +FLAVOR?= ${FLAVORS:[1]} + +. if ${FLAVOR} != web +LIB_DEPENDS= libb64.so:converters/libb64 \ + libcurl.so:ftp/curl \ + libdht.so:devel/jech-dht \ + libminiupnpc.so:net/miniupnpc \ + libnatpmp.so:net/libnatpmp \ + libutp.so:net/libutp \ + libevent.so:devel/libevent +. endif + +GTK_LIB_DEPENDS= libnotify.so:devel/libnotify \ + libdbus-glib-1.so:devel/dbus-glib +QT4_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ + libfreetype.so:print/freetype2 +QT5_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ + libfreetype.so:print/freetype2 +GTK_RUN_DEPENDS= xdg-open:devel/xdg-utils + +USES= cpe gmake iconv libtool localbase pkgconfig +USE_GITHUB= yes + +. if ${FLAVOR} == daemon +USE_RC_SUBR= transmission +USERS= transmission +GROUPS= transmission +. endif + +. if ${FLAVOR} == gtk +USES+= gettext pathfix desktop-file-utils +USE_GNOME= cairo gtk30 intlhack +INSTALLS_ICONS= yes +. endif + +. if ${FLAVOR} == qt4 +USES+= compiler:c++11-lib desktop-file-utils +USE_QT4= moc_build qmake_build uic_build rcc_build \ + corelib gui dbus network xml +QT_NONSTANDARD= yes +. endif + +. if ${FLAVOR} == qt5 +USES+= compiler:c++11-lib desktop-file-utils +USE_QT5= buildtools_build qmake_build core dbus gui network widgets +QT_NONSTANDARD= yes +. endif + +. if ${FLAVOR} == web +USES= cpe +PORTDATA= web +NO_BUILD= yes +. endif + +. if ${FLAVOR} != web +LIBS+= ${ICONV_LIB} +CONFIGURE_ENV= ${ICONV_LIB:C@.+@ac_cv_func_iconv=yes@} +GNU_CONFIGURE= yes +EXTRA_PATCHES= ${PATCHDIR}/disable-web +. endif + +CPE_VENDOR= transmissionb +EXTRACT_AFTER_ARGS= --no-same-owner --no-same-permissions --exclude third-party + +# Setting CONFIGURE_ARGS only. +. if ${FLAVOR} != web +CONFIGURE_ARGS= --without-inotify \ + --enable-external-b64 \ + --enable-external-dht \ + --enable-external-natpmp +. endif + +. if ${FLAVOR} == cli +CONF_ARGS+= --enable-cli \ + --disable-daemon \ + --without-gtk \ + --disable-mac \ + --disable-nls +. endif + +. if ${FLAVOR} == daemon +CONF_ARGS+= --disable-cli \ + --enable-daemon \ + --without-gtk \ + --disable-mac \ + --disable-nls +. endif + +. if ${FLAVOR} == gtk +CONF_ARGS+= --disable-cli \ + --disable-daemon \ + --with-gtk \ + --disable-mac \ + --enable-nls +. endif + +. if ${FLAVOR} == qt4 +CONF_ARGS= --disable-cli \ + --disable-daemon \ + --without-gtk \ + --disable-mac \ + --disable-nls +. endif + +. if ${FLAVOR} == qt5 +CONF_ARGS+= --disable-cli \ + --disable-daemon \ + --without-gtk \ + --disable-mac \ + --disable-nls +. endif + +# Setting OPTIONS +. if ${FLAVOR} != web +OPTIONS_DEFINE= DOCS LITE +OPTIONS_DEFAULT= OPENSSL +OPTIONS_SINGLE= SSL +OPTIONS_SINGLE_SSL= OPENSSL POLARSSL WOLFSSL + +LITE_CONFIGURE_ENABLE= lightweight + +OPENSSL_USES= ssl +OPENSSL_CONFIGURE_ENV= OPENSSL_CFLAGS="-I${OPENSSLINC}" \ + OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto" +OPENSSL_CONFIGURE_ON= --with-crypto=openssl + +POLARSSL_LIB_DEPENDS= libpolarssl.so:security/polarssl13 +POLARSSL_CONFIGURE_ON= --with-crypto=polarssl + +WOLFSSL_LIB_DEPENDS= libwolfssl.so:security/wolfssl +WOLFSSL_CONFIGURE_ON= --with-crypto=cyassl +WOLFSSL_BROKEN= Requires security/wolfssl built with --enable-arc4 +. endif -USES= metaport +DOCS= AUTHORS NEWS README +DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX} .include Index: net-p2p/transmission/distinfo =================================================================== --- /dev/null +++ net-p2p/transmission/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1521071450 +SHA256 (transmission-transmission-2.93_GH0.tar.gz) = 870ea21a2803c141126bb3f2da4e9acab8db7c0b403a64f685f410b629497a8a +SIZE (transmission-transmission-2.93_GH0.tar.gz) = 6341015 Index: net-p2p/transmission/files/disable-web =================================================================== --- /dev/null +++ net-p2p/transmission/files/disable-web @@ -0,0 +1,19 @@ +--- Makefile.in.orig 2010-10-23 15:56:02.000000000 -0500 ++++ Makefile.in 2010-10-23 15:56:55.000000000 -0500 +@@ -303,15 +303,13 @@ + @BUILD_GTK_TRUE@GTK_DIR = gtk po + @BUILD_MAC_TRUE@MAC_DIR = macosx + SUBDIRS = \ +- extras \ + third-party \ + libtransmission \ + utils \ + $(DAEMON_DIR) \ + $(CLI_DIR) \ + $(GTK_DIR) \ +- $(MAC_DIR) \ +- web ++ $(MAC_DIR) + + EXTRA_DIST = \ + qt \ Index: net-p2p/transmission/files/patch-configure =================================================================== --- /dev/null +++ net-p2p/transmission/files/patch-configure @@ -0,0 +1,20 @@ +--- configure.orig 2016-03-06 20:24:37 UTC ++++ configure +@@ -19348,7 +19348,7 @@ $as_echo_n "checking µTP... " >&6; } + build_utp="no" + + ac_save_LIBS="$LIBS" +-LIBS="-lutp" ++LIBS="-lutp $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +@@ -19423,7 +19423,7 @@ $as_echo "$build_utp" >&6; } + + + ac_save_LIBS="$LIBS" +-LIBS="-lminiupnpc" ++LIBS="-lminiupnpc $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking system miniupnpc library" >&5 + $as_echo_n "checking system miniupnpc library... " >&6; } + Index: net-p2p/transmission/files/patch-fix-with-libressl =================================================================== --- /dev/null +++ net-p2p/transmission/files/patch-fix-with-libressl @@ -0,0 +1,23 @@ +--- libtransmission/crypto-utils-openssl.c.orig 2018-03-01 00:44:45 UTC ++++ libtransmission/crypto-utils-openssl.c +@@ -147,7 +147,7 @@ tr_sha1_final (tr_sha1_ctx_t handle, + **** + ***/ + +-#if OPENSSL_VERSION_NUMBER < 0x0090802fL ++#if OPENSSL_VERSION_NUMBER < 0x0090802fL || defined(LIBRESSL_VERSION_NUMBER) + + static EVP_CIPHER_CTX * + openssl_evp_cipher_context_new (void) +@@ -230,7 +230,7 @@ tr_rc4_process (tr_rc4_ctx_t handle, + **** + ***/ + +-#if OPENSSL_VERSION_NUMBER < 0x10100000 ++#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER) + static inline int + DH_set0_pqg (DH * dh, + BIGNUM * p, + + + Index: net-p2p/transmission/files/patch-fix_without_ipv6 =================================================================== --- /dev/null +++ net-p2p/transmission/files/patch-fix_without_ipv6 @@ -0,0 +1,11 @@ +--- libtransmission/fdlimit.c.orig 2015-07-01 00:54:41 UTC ++++ libtransmission/fdlimit.c +@@ -517,7 +517,7 @@ tr_fdSocketCreate (tr_session * session, + + if (gFd->peerCount < session->peerLimit) + if ((s = socket (domain, type, 0)) == TR_BAD_SOCKET) +- if (sockerrno != EAFNOSUPPORT) ++ if (sockerrno != EPROTONOSUPPORT) + { + char err_buf[512]; + tr_logAddError (_("Couldn't create socket: %s"), Index: net-p2p/transmission/files/patch-qt_Application.h =================================================================== --- /dev/null +++ net-p2p/transmission/files/patch-qt_Application.h @@ -0,0 +1,10 @@ +--- qt/Application.h.orig 2018-03-15 01:22:31 UTC ++++ qt/Application.h +@@ -10,6 +10,7 @@ + #ifndef QTR_APPLICATION_H + #define QTR_APPLICATION_H + ++#include + #include + #include + #include Index: net-p2p/transmission/files/patch-qt_qtr.pro =================================================================== --- /dev/null +++ net-p2p/transmission/files/patch-qt_qtr.pro @@ -0,0 +1,20 @@ +--- qt/qtr.pro.orig 2018-03-15 01:20:06 UTC ++++ qt/qtr.pro +@@ -8,7 +8,7 @@ target.path = /bin + INSTALLS += target + + unix: INSTALLS += man +-man.path = /share/man/man1/ ++man.path = /man/man1/ + man.files = transmission-qt.1 + + CONFIG += qt thread debug link_pkgconfig c++11 warn_on +@@ -34,7 +34,7 @@ LIBS += $${DHT_LIBS} + LIBS += $${LIBB64_LIBS} + LIBS += $${LIBUPNP_LIBS} + LIBS += $${LIBNATPMP_LIBS} +-unix: LIBS += -L$${EVENT_TOP}/lib -lz -lrt ++unix: LIBS += -L$${EVENT_TOP}/lib -lz -levent_core -levent_extra + win32:LIBS += -levent-2.0 -lws2_32 -lintl + win32:LIBS += -lidn -liconv -lwldap32 -liphlpapi + Index: net-p2p/transmission/files/transmission.in =================================================================== --- /dev/null +++ net-p2p/transmission/files/transmission.in @@ -0,0 +1,80 @@ +#!/bin/sh +# +# $FreeBSD: head/net-p2p/transmission-cli/files/transmission.in 373348 2014-11-24 18:51:26Z crees $ +# +# PROVIDE: transmission +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable this service: +# +# transmission_enable: Set to NO by default. Set it to YES to enable it. +# transmission_watch_dir: Directory for torrent files to download +# automatically. Off by default unless you add +# a path. +# transmission_conf_dir: Directory where transmission configuration +# data is stored. +# Default: %%PREFIX%%/etc/transmission/home +# transmission_download_dir: Directory to store downloaded data. +# Default: %%PREFIX%%/etc/transmission/home/Downloads +# transmission_user: The user account transmission daemon runs as what +# you want it to be. It uses 'transmission' user by +# default. +# transmission_web_home: Use alternative directory for the web interface +# files, such as javascript, html and graphics. +# transmission_chown: By default, transmission checks and fixes the +# permissions for its home directory. If this +# causes problems, set this variable to no. +# + +. /etc/rc.subr + +name=transmission +rcvar=transmission_enable + +load_rc_config $name + +: ${transmission_enable:=NO} +: ${transmission_conf_dir=%%PREFIX%%/etc/transmission/home} +: ${transmission_download_dir=%%PREFIX%%/etc/transmission/home/Downloads} +: ${transmission_user:=transmission} +transmission_group=${transmission_group:-$transmission_user} +: ${transmission_chown:=yes} + +command=%%PREFIX%%/bin/transmission-daemon +pidfile=/var/run/transmission/daemon.pid +extra_commands=reload +start_precmd=transmission_prestart + +transmission_flags=" \ + ${transmission_watch_dir:+-c ${transmission_watch_dir}} \ + ${transmission_conf_dir:+-g ${transmission_conf_dir}} \ + ${transmission_download_dir:+-w ${transmission_download_dir}} \ + ${pidfile:+-x $pidfile} \ + ${transmission_flags}" + +transmission_prestart() +{ + install -d -o $transmission_user ${pidfile%/*} + if checkyesno transmission_chown; then + mkdir -p $transmission_conf_dir $transmission_download_dir + chown $transmission_user:$transmission_group $transmission_download_dir + chown -R $transmission_user:$transmission_group $transmission_conf_dir + chgrp $transmission_group $transmission_conf_dir + chmod 750 $transmission_conf_dir + fi + if [ -n "$transmission_web_home" ]; then + TRANSMISSION_WEB_HOME=$transmission_web_home + export TRANSMISSION_WEB_HOME + fi +} + +# Unfortunately there was a typo in a previous version, which may have +# left some people with /var/run/transmission/damon.pid . Deal with +# this for a few months at least, until everyone will have restarted +# transmission +if [ ! -f $pidfile -a -f /var/run/transmission/damon.pid ]; then + pidfile=/var/run/transmission/damon.pid +fi + +run_rc_command $1