From a09c021a76fc1e9ef91ecb4f52b9977a0fba3e24 Mon Sep 17 00:00:00 2001 From: Antoine Brodin Date: Thu, 6 Feb 2014 18:45:36 +0000 Subject: [PATCH] - Stage support - OPTIONS conversion --- net/tsocks/Makefile | 91 +++++++++----------------------------------- net/tsocks/pkg-plist | 3 ++ 2 files changed, 20 insertions(+), 74 deletions(-) diff --git a/net/tsocks/Makefile b/net/tsocks/Makefile index 0ea36f77c80b..fe0d292fa95d 100644 --- a/net/tsocks/Makefile +++ b/net/tsocks/Makefile @@ -14,7 +14,7 @@ MAINTAINER= ports@FreeBSD.org COMMENT= Allow non SOCKS aware applications to use SOCKS without modification GNU_CONFIGURE= yes -USE_GMAKE= yes +USES= gmake USE_LDCONFIG= yes WRKSRC=${WRKDIR}/${PORTNAME}-${PORTVERSION:C/.b.*//} @@ -22,85 +22,28 @@ WRKSRC=${WRKDIR}/${PORTNAME}-${PORTVERSION:C/.b.*//} CONFIGURE_ARGS= --with-conf=${PREFIX}/etc/tsocks.conf \ --libdir=${PREFIX}/lib -MAN1= tsocks.1 -MAN5= tsocks.conf.5 -MAN8= tsocks.8 +OPTIONS_DEFINE= DEBUG DOCS EXAMPLES HOSTNAMES OLDMETHOD SOCKSDNS +OPTIONS_DEFAULT= DEBUG HOSTNAMES -.if defined(WITH_SOCKSDNS) -CONFIGURE_ARGS+= --enable-socksdns -.endif +DEBUG_DESC= Output error messages to stderr +HOSTNAMES_DESC= Enable DNS lookups +OLDMETHOD_DESC= Do not use RTLD_NEXT parameter to dlsym +SOCKSDNS_DESC= Intercept DNS requests and attempt to force them to use TCP -.if defined(WITH_OLDMETHOD) -CONFIGURE_ARGS+= --enable-oldmethod -.endif - -.if defined(WITH_NODEBUG) -CONFIGURE_ARGS+= --disable-debug -.endif - -.if defined(WITH_NOHOSTNAMES) -CONFIGURE_ARGS+= --disable-hostnames -.endif - -NO_STAGE= yes -.include - -pre-everything:: -.if !defined(WITH_SOCKSDNS) - @${ECHO_MSG} - @${ECHO_MSG} "You can use the WITH_SOCKSDNS=yes knob." - @${ECHO_MSG} "This option causes tsocks to intercept" - @${ECHO_MSG} "DNS lookups and attempt to force them" - @${ECHO_MSG} "to use TCP instead of UDP and thus" - @${ECHO_MSG} "be proxied through the socks server." - @${ECHO_MSG} -.endif - -.if !defined(WITH_OLDMETHOD) - @${ECHO_MSG} - @${ECHO_MSG} "You can use the make WITH_OLDMETHOD=yes knob." - @${ECHO_MSG} "This forces tsocks not to use the" - @${ECHO_MSG} "RTLD_NEXT parameter to dlsym to get the" - @${ECHO_MSG} "address of the connect() method tsocks" - @${ECHO_MSG} "overrides, instead it loads a reference" - @${ECHO_MSG} "to the libc shared library and then uses dlsym()." - @${ECHO_MSG} -.endif - -.if !defined(WITH_NODEBUG) - @${ECHO_MSG} - @${ECHO_MSG} "You can use the make WITH_NODEBUG=yes knob." - @${ECHO_MSG} "This configuration option tells tsocks" - @${ECHO_MSG} "to never output error messages to stderr." - @${ECHO_MSG} -.endif - -.if !defined(WITH_NOHOSTNAMES) - @${ECHO_MSG} - @${ECHO_MSG} "You can use the make WITH_NOHOSTNAMES=yes knob." - @${ECHO_MSG} "This disables DNS lookups on names" - @${ECHO_MSG} "provided as socks servers in the config" - @${ECHO_MSG} "file. This option is necessary" - @${ECHO_MSG} "if socks dns is enabled since tsocks" - @${ECHO_MSG} "can't send a socks dns request to resolve" - @${ECHO_MSG} "the location of the socks server." - @${ECHO_MSG} -.endif +DEBUG_CONFIGURE_OFF= --disable-debug +HOSTNAMES_CONFIGURE_OFF= --disable-hostnames +OLDMETHOD_CONFIGURE_ON= --enable-oldmethod +SOCKSDNS_CONFIGURE_ON= --enable-socksdns post-patch: @${REINPLACE_CMD} -e 's|ufds|fds|g' ${WRKSRC}/tsocks.c @${REINPLACE_CMD} -e 's|/usr|${PREFIX}|' ${WRKSRC}/tsocks post-install: - ${INSTALL_DATA} ${WRKSRC}/tsocks.conf.simple.example ${PREFIX}/etc/tsocks.conf.sample -.if !defined(NOPORTEXAMPLES) - @${MKDIR} ${EXAMPLESDIR} - ${INSTALL_DATA} ${WRKSRC}/*.example ${EXAMPLESDIR} -.endif -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCSDIR}/README -.endif - @${CAT} ${PKGMESSAGE} + ${INSTALL_DATA} ${WRKSRC}/tsocks.conf.simple.example ${STAGEDIR}${PREFIX}/etc/tsocks.conf.sample + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/*.example ${STAGEDIR}${EXAMPLESDIR} + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/INSTALL ${STAGEDIR}${DOCSDIR}/README -.include +.include diff --git a/net/tsocks/pkg-plist b/net/tsocks/pkg-plist index ba3a2d315947..994c4e8926f7 100644 --- a/net/tsocks/pkg-plist +++ b/net/tsocks/pkg-plist @@ -2,6 +2,9 @@ bin/tsocks etc/tsocks.conf.sample lib/libtsocks.so.1 lib/libtsocks.so +man/man1/tsocks.1.gz +man/man5/tsocks.conf.5.gz +man/man8/tsocks.8.gz %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tsocks.conf.complex.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tsocks.conf.simple.example %%PORTDOCS%%%%DOCSDIR%%/README