Index: net-p2p/transmission/Makefile =================================================================== --- net-p2p/transmission/Makefile +++ net-p2p/transmission/Makefile @@ -1,18 +1,216 @@ # $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 + +# Still need to figure out how to add LICENSE per FLAVOR +# since some of the FLAVORS do have more permissive LICENSE. +# Alternativelly, if possible, use LICENSE_GROUP then. +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING + +# 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= libcurl.so:ftp/curl \ + libdht.so:devel/jech-dht \ + libb64.so:converters/libb64 \ + libevent.so:devel/libevent \ + libnatpmp.so:net/libnatpmp \ + libutp.so:net/libutp \ + libminiupnpc.so:net/miniupnpc +. endif + +GTK_LIB_DEPENDS= libdbus-glib-1.so:devel/dbus-glib \ + libnotify.so:devel/libnotify +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+= desktop-file-utils gettext pathfix +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 rcc_build uic_build \ + corelib dbus gui 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@} +EXTRA_PATCHES= ${PATCHDIR}/disable-web +GNU_CONFIGURE= yes +. 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 + +DOCS= AUTHORS NEWS README +DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX} + +# Still need to understand how patch work for FLAVORS. For some reason they +# fail to apply to every FLAVOR; however removing them already allow to the +# -web FLAVOR build. +. if ${FLAVOR} != web +general-patch: + @${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} ${REINPLACE_CMD} -e \ + 's|noinst_PROGRAMS = |noinst_PROGRAMS = #|g' +. if ${FLAVOR} != gtk + @${REINPLACE_CMD} -e '/#define DISABLE_GETTEXT/s,/\* \(.*\) \*/,\1,' \ + ${WRKSRC}/libtransmission/utils.h +. endif + @${REINPLACE_CMD} -e \ + 's|rt_clock_gettime=yes|rt_clock_gettime=no|g ; \ + s|" == "|" = "|g' \ + ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's|doc \\| \\|g' \ + ${WRKSRC}/Makefile.in +. if ${FLAVOR} != cli + @${REINPLACE_CMD} -e 's|utils \\|\\|g' \ + ${WRKSRC}/Makefile.in +. endif +# Don't conflict with patches but force system libraries + @${REINPLACE_CMD} -e 's|third-party \\|\\|g' \ + ${WRKSRC}/Makefile.in + @${REINPLACE_CMD} \ + -e 's|third-party/[^ ]*Makefile||g' \ + ${WRKSRC}/configure + +post-patch: general-patch + +general-install: + + (cd ${WRKSRC} && ${COPYTREE_SHARE} \ + "${DOCS}" ${STAGEDIR}${DOCSDIR}) + +post-install: general-install + +. endif + +# Install -web stuff +. if ${FLAVOR} == web +post-extract: + @${FIND} ${WRKSRC}/web -name Makefile.* -delete + @${FIND} ${WRKSRC}/web -name .git* -delete + +do-install: + ${MKDIR} ${STAGEDIR}${DATADIR}/web + (cd ${WRKSRC}/web && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}/web) +. endif + + + + + -RUN_DEPENDS= transmission-cli:net-p2p/transmission-cli \ - transmission-daemon:net-p2p/transmission-daemon \ - transmission-gtk:net-p2p/transmission-gtk -CONFLICTS_INSTALL= ${PORTNAME}${PKGNAMESUFFIX}-2.[56]* -USES= metaport .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,18 @@ +--- Makefile.am.orig 2018-03-17 00:12:13 UTC ++++ Makefile.am +@@ -16,7 +16,6 @@ if BUILD_MAC + endif + + SUBDIRS = \ +- extras \ + third-party \ + libtransmission \ + utils \ +@@ -24,7 +23,6 @@ SUBDIRS = \ + $(CLI_DIR) \ + $(GTK_DIR) \ + $(MAC_DIR) \ +- web + + 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