From owner-svn-ports-head@FreeBSD.ORG Wed Nov 27 22:04:33 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35E51C33; Wed, 27 Nov 2013 22:04:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0512E6F; Wed, 27 Nov 2013 22:04:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rARM4WYt060319; Wed, 27 Nov 2013 22:04:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rARM4Ww2060313; Wed, 27 Nov 2013 22:04:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201311272204.rARM4Ww2060313@svn.freebsd.org> From: Xin LI Date: Wed, 27 Nov 2013 22:04:32 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r335066 - in head/net/shadowsocks-libev: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Nov 2013 22:04:33 -0000 Author: delphij Date: Wed Nov 27 22:04:32 2013 New Revision: 335066 URL: http://svnweb.freebsd.org/changeset/ports/335066 Log: Add support of config.json. PR: ports/183300 Submitted by: maintainer Modified: head/net/shadowsocks-libev/Makefile head/net/shadowsocks-libev/files/shadowsocks_libev.in head/net/shadowsocks-libev/pkg-plist Modified: head/net/shadowsocks-libev/Makefile ============================================================================== --- head/net/shadowsocks-libev/Makefile Wed Nov 27 21:33:24 2013 (r335065) +++ head/net/shadowsocks-libev/Makefile Wed Nov 27 22:04:32 2013 (r335066) @@ -3,6 +3,7 @@ PORTNAME= shadowsocks-libev PORTVERSION= 1.4.0 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/archive/${GH_TAGNAME}.tar.gz?dummy=/ @@ -22,4 +23,8 @@ USES= gmake USE_RC_SUBR= shadowsocks_libev +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${CP} ${WRKSRC}/debian/config.json ${STAGEDIR}${ETCDIR}/config.json.sample + .include Modified: head/net/shadowsocks-libev/files/shadowsocks_libev.in ============================================================================== --- head/net/shadowsocks-libev/files/shadowsocks_libev.in Wed Nov 27 21:33:24 2013 (r335065) +++ head/net/shadowsocks-libev/files/shadowsocks_libev.in Wed Nov 27 22:04:32 2013 (r335066) @@ -8,15 +8,8 @@ # Add the following lines to /etc/rc.conf to enable shadowsocks-libev: # shadowsocks_libev_enable (bool): Set to "NO" by default. # Set to "YES" to enable shadowsocks-libev. -# shadowsocks_libev_host (ip addr/hostname): Set to "0.0.0.0" by default. -# shadowsocks_libev_port (port number): Set to 8388 by default. -# shadowsocks_libev_localport (local port): Set to 1080 by default. -# shadowsocks_libev_password (password): Set to ""(null) by default. -# shadowsocks_libev_encrypt_method (encrypt method): Set to rc4 by default. -# Available methods: table, rc4, aes-128-cfb, aes-192-cfb, aes-256-cfb, -# bf-cfb, camellia-128-cfb, camellia-192-cfb, camellia-256-cfb, -# cast5-cfb, des-cfb, idea-cfb, rc2-cfb and seed-cfb -# shadowsocks_libev_timeout (time): Set to "300" seconds by default. +# shadowsocks_libev_config (path): Shadowsocks config file. +# Defaults to "%%PREFIX%%/etc/shadowsocks-libev/config.json" . /etc/rc.subr @@ -28,23 +21,12 @@ rcvar=shadowsocks_libev_enable load_rc_config $name : ${shadowsocks_libev_enable:="NO"} -: ${shadowsocks_libev_host="0.0.0.0"} -: ${shadowsocks_libev_port=8388} -: ${shadowsocks_libev_localport=1080} -: ${shadowsocks_libev_password=""} -: ${shadowsocks_libev_encrypt_method="rc4"} -: ${shadowsocks_libev_timeout="300"} +: ${shadowsocks_libev_config="%%PREFIX%%/etc/shadowsocks-libev/config.json"} command="%%PREFIX%%/bin/ss-server" pidfile="/var/run/shadowsocks-libev.pid" +required_files="${shadowsocks_libev_config}" -: ${shadowsocks_libev_flags:="-s ${shadowsocks_libev_host} \ - -p ${shadowsocks_libev_port} \ - -l ${shadowsocks_libev_localport} \ - -k ${shadowsocks_libev_password} \ - -m ${shadowsocks_libev_encrypt_method} \ - -f ${pidfile} \ - -t ${shadowsocks_libev_timeout}"} - +command_args="-f $pidfile -c $shadowsocks_libev_config" run_rc_command "$1" Modified: head/net/shadowsocks-libev/pkg-plist ============================================================================== --- head/net/shadowsocks-libev/pkg-plist Wed Nov 27 21:33:24 2013 (r335065) +++ head/net/shadowsocks-libev/pkg-plist Wed Nov 27 22:04:32 2013 (r335066) @@ -1,3 +1,7 @@ bin/ss-local bin/ss-server man/man8/shadowsocks.8.gz +@unexec if cmp -s %D/etc/shadowsocks-libev/config.json %D/etc/shadowsocks-libev/config.json.sample ; then rm -f %D/etc/shadowsocks-libev/config.json ; fi +etc/shadowsocks-libev/config.json.sample +@exec if [ ! -f %D/etc/shadowsocks-libev/config.json ]; then cp -p %D/%F %B/config.json ; fi +@dirrm etc/shadowsocks-libev