Changeset View
Standalone View
net-p2p/transmission/Makefile
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= transmission | PORTNAME= transmission | ||||
PORTVERSION= 2.93 | DISTVERSION= 2.93 | ||||
PORTREVISION= 1 | |||||
CATEGORIES= net-p2p | CATEGORIES= net-p2p | ||||
PKGNAMESUFFIX= -${FLAVOR} | |||||
MAINTAINER= crees@FreeBSD.org | 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 \ | LICENSE= GPLv2 | ||||
transmission-daemon:net-p2p/transmission-daemon \ | LICENSE_FILE= ${WRKSRC}/COPYING | ||||
transmission-gtk:net-p2p/transmission-gtk | |||||
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]} | |||||
adridg: The web flavor (assuming it's just the files in web/) is GPLv2-only, for instance. You could… | |||||
Done Inline ActionsI will let this LICENSE issue for when I manage to the last. :o) Thanks rigoletto: I will let this LICENSE issue for when I manage to the last. :o)
Thanks | |||||
USES= metaport | .if ${FLAVOR} != web | ||||
LIB_DEPENDS= libcurl.so:ftp/curl \ | |||||
libdht.so:devel/jech-dht \ | |||||
Done Inline Actions^ what's the issue with web? tcberner: ^ what's the issue with `web`? | |||||
Done Inline ActionsThe web does not have any LIB_DEPENDS, if I do not isolate the "general" LIB_DEPENDS with . if ${FLAVOR} != web they will be all built when building transmission-web instead of just packing the /web data. And the ${FLAVOR} seem to just work after setting FLAVORS: EDIT: Error: Port is broken rigoletto: The web does not have any LIB_DEPENDS, if I do not isolate the "general" LIB_DEPENDS with
. | |||||
libb64.so:converters/libb64 \ | |||||
libevent.so:devel/libevent \ | |||||
Done Inline ActionsIf FLAVOR is needed to set LIB_DEPENDS, then so be it (otherwise you get the silly-but-it-follows-the-rules setup LIB_DEPENDS=<brank>, followed by adding to it depending on the flavor). adridg: If FLAVOR is needed to set LIB_DEPENDS, then so be it (otherwise you get the silly-but-it… | |||||
Done Inline ActionsThis just changed the message to: WARN: Makefile: extra item placed in the *_DEPENDS section, for example, "FLAVORS". I will let the FLAVORS before LIB_DEPENDS for now to leave the port more "clean". rigoletto: This just changed the message to:
//WARN: Makefile: extra item placed in the *_DEPENDS section… | |||||
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 | |||||
Done Inline Actions^ you probably mean gtk_LIB_DEPENDS, and same for the others. tcberner: ^ you probably mean `gtk_LIB_DEPENDS`, and same for the others. | |||||
USES?= cmake:outsource cpe iconv localbase libtool pkgconfig | |||||
USE_GITHUB= yes | |||||
CPE_VENDOR= transmissionbt | |||||
qt4_CONFLICTS= qt5 | |||||
# Setting localbase:ldflags does NOT solve | |||||
LDFLAGS+= -L${LOCALBASE}/lib -lintl -ldht | |||||
# To fix documentation conflicts | |||||
CMAKE_ARGS+= -DCMAKE_INSTALL_DOCDIR=${PREFIX}/share/doc/${PORTNAME}-${FLAVOR} | |||||
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}-${FLAVOR} | |||||
.if ${FLAVOR} == cli | |||||
USES+= gettext-runtime:run ssl | |||||
Done Inline ActionsSeems superfluous if you're using cmake adridg: Seems superfluous if you're using cmake | |||||
CMAKE_OFF= ENABLE_GTK ENABLE_QT ENABLE_NLS ENABLE_DAEMON | |||||
CMAKE_ON= ENABLE_CLI | |||||
.endif | |||||
.if ${FLAVOR} == daemon | |||||
Done Inline Actions^ CMAKE_BOOL, not CLI_CMAKE_BOOL. Also, as this is no longer an option, you want CMAKE_ON= ENABLE_CLI tcberner: ^ `CMAKE_BOOL`, not `CLI_CMAKE_BOOL`. Also, as this is no longer an option, you want… | |||||
USES+= gettext-runtime:run ssl | |||||
Done Inline ActionsIf flavors work like options, perhaps you can just list all of the cmake bools? Then they will be explicitly switched on (or off) as needed. adridg: If flavors work like options, perhaps you can just list all of the cmake bools? Then they will… | |||||
CMAKE_OFF= ENABLE_CLI ENABLE_NLS ENABLE_GTK ENABLE_QT \ | |||||
ENABLE_UTILS | |||||
USERS= transmission | |||||
Done Inline ActionsCMAKE_ON&OFF, without the old OPTION-prefix :) tcberner: CMAKE_ON&OFF, without the old OPTION-prefix :) | |||||
GROUPS= transmission | |||||
USE_RC_SUBR= transmission | |||||
.endif | |||||
.if ${FLAVOR} == gtk | |||||
USES+= desktop-file-utils gettext-tools:build ssl | |||||
USE_GNOME= cairo gdkpixbuf2 glib20 gtk30 intlhack pango | |||||
CMAKE_OFF= ENABLE_CLI ENABLE_DAEMON ENABLE_QT \ | |||||
ENABLE_UTILS | |||||
Done Inline ActionsThat comment could be more descriptive .. and you might want to avoid installing LICENSE and Makefile.am. Come to think of it, you might even want to set LICENSE_FILE differently for the web flavor. adridg: That comment could be more descriptive .. and you might want to avoid installing LICENSE and… | |||||
Done Inline ActionsThis comment is just to identification for now. ^^ rigoletto: This comment is just to identification for now. ^^ | |||||
CMAKE_ON= ENABLE_GTK | |||||
.endif | |||||
.if ${FLAVOR} == qt4 | |||||
USES+= gettext-runtime:run | |||||
USE_QT4= moc_build qmake_build rcc_build uic_build\ | |||||
corelib dbus gui network xml | |||||
CMAKE_OFF= ENABLE_CLI ENABLE_DAEMON ENABLE_GTK ENABLE_NLS \ | |||||
ENABLE_UTILS | |||||
.endif | |||||
.if ${FLAVOR} == qt5 | |||||
USES+= gettext-runtime:run | |||||
USE_QT5= buildtools_build linguisttools_build qmake_build \ | |||||
core dbus gui network widgets | |||||
CMAKE_OFF= ENABLE_CLI ENABLE_DAEMON ENABLE_NLS ENABLE_GTK \ | |||||
ENABLE_UTILS | |||||
CMAKE_ON= USE_QT5 | |||||
.endif | |||||
.if ${FLAVOR} == web | |||||
USES= cpe | |||||
NO_ARCH= yes | |||||
NO_BUILD= yes | |||||
PORTDATA= web | |||||
.endif | |||||
.if ${FLAVOR} != web | |||||
OPTIONS_DEFINE= DOCS LITE | |||||
. if ${FLAVOR} == gtk | |||||
OPTIONS_DEFINE+= NLS | |||||
. endif | |||||
OPTIONS_DEFAULT= OPENSSL | |||||
OPTIONS_SINGLE= SSL | |||||
Done Inline Actionsuse more spaces after the dot for nested ifs, otherwise it's very hard to see the nesting . if ${FLAVOR$ != web . if ${FLAVOR} == gtk [...] . endif . endif tcberner: use more spaces after the dot for nested ifs, otherwise it's very hard to see the nesting
so… | |||||
Done Inline ActionsOh, I did that at first but had move the dot too. :-) rigoletto: Oh, I did that at first but had move the dot too. :-) | |||||
Done Inline Actionsthere is a script to do it: /usr/ports/Tools/scripts/indent_make_if.pl :) tcberner: there is a script to do it: /usr/ports/Tools/scripts/indent_make_if.pl :) | |||||
OPTIONS_SINGLE_SSL= OPENSSL POLARSSL WOLFSSL | |||||
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 | |||||
Done Inline Actions^ probably move this outside of the this is all *ssl related block here tcberner: ^ probably move this outside of the //this is all *ssl related// block here | |||||
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 | |||||
LITE_CONFIGURE_ENABLE= lightweight | |||||
.endif | |||||
cli_PLIST= pkg-plist.cli | |||||
daemon_PLIST= pkg-plist.daemon | |||||
gtk_PLIST= pkg-plist.gtk | |||||
qt4_PLIST= pkg-plist.qt4 | |||||
qt5_PLIST= pkg-plist.qt5 | |||||
web_PLIST= pkg-plist.web | |||||
Done Inline Actionspkg-plist.cli seem to be the more common pattern tcberner: pkg-plist.cli seem to be the more common pattern | |||||
Done Inline ActionsI've done that first but looking in the existent ports I had found more -{FLAVOR}. :-D rigoletto: I've done that first but looking in the existent ports I had found more -{FLAVOR}. :-D | |||||
post-extract: | |||||
@${FIND} ${WRKSRC}/web -name .git* -delete | |||||
.if ${FLAVOR} == web | |||||
@${FIND} ${WRKSRC}/web \( -name '*.am' -o -name '*.in' \ | |||||
-o -name '*.scss' \) -delete | |||||
do-install: | |||||
${MKDIR} ${STAGEDIR}${DATADIR}/web | |||||
(cd ${WRKSRC}/web && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}/web) | |||||
.endif | |||||
.if ${FLAVOR} == daemon | |||||
post-install: | |||||
${MKDIR} ${STAGEDIR}${ETCDIR}/home | |||||
.endif | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> |
The web flavor (assuming it's just the files in web/) is GPLv2-only, for instance. You could say GPLv2 here and be not-wrong.