Index: head/devel/subversion/Makefile =================================================================== --- head/devel/subversion/Makefile (revision 460382) +++ head/devel/subversion/Makefile (revision 460383) @@ -1,235 +1,237 @@ # Created by: rooneg@electricjellyfish.net # $FreeBSD$ -PORTREVISION= 1 +PORTREVISION= 2 MAINTAINER= lev@FreeBSD.org COMMENT= Version control system CONFLICTS_INSTALL= subversion-1.[^9].[0-9]* \ subversion1[^9]-1.[^9].[0-9]* USE_RC_SUBR= svnserve PORTDOCS= BUGS CHANGES COMMITTERS INSTALL README OPTIONS_DEFINE= \ BDB \ DOCS \ FREEBSD_TEMPLATE\ + GPG_AGENT \ MAINTAINER_DEBUG\ NLS \ SASL \ SERF \ STATIC \ SVNSERVE_WRAPPER\ TEST \ TOOLS OPTIONS_DEFAULT=FREEBSD_TEMPLATE \ SERF TOOLS FREEBSD_TEMPLATE_DESC= FreeBSD Project log template +GPG_AGENT_DESC= Enable GPG agent password store MAINTAINER_DEBUG_DESC= Build debug version SERF_DESC= WebDAV/Delta-V (HTTP/HTTPS) repo access module STATIC_DESC= Build static version (no shared libs) SVNSERVE_WRAPPER_DESC= Enable svnserve wrapper (umask setter) TEST_DESC= Run subversion test suite TOOLS_DESC= Install several tools # Patches required for use with the FreeBSD Project repository only FREEBSD_TEMPLATE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fbsd-template SVNSERVE_WRAPPER_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-svnserve-wrapper USES+= shebangfix python:2.7,env python_OLD_CMD+= "/bin/env python" SHEBANG_REGEX= ./tools/.* .include "Makefile.common" SVNREPOS?= /home/svn/repos SVNFSTYPE?= fsfs SVNGROUP?= svn SVNUSER?= svn CONFIGURE_ARGS+= --without-gnome-keyring \ --without-kwallet \ --with-apxs=no .if ${PORT_OPTIONS:MSVNSERVE_WRAPPER} SUB_LIST+= SVNSERVE_BIN_EXT=".bin" PLIST_SUB+= NO_SVNSERVE_WRAPPER="@comment " .else SUB_LIST+= SVNSERVE_BIN_EXT="" PLIST_SUB+= NO_SVNSERVE_WRAPPER="" .endif .if ${PORT_OPTIONS:MTEST} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 .endif .if ${PORT_OPTIONS:MSTATIC} . if ${PORT_OPTIONS:MNLS} USES+= gettext-tools . endif . if ${PORT_OPTIONS:MBDB} BDB_BUILD_DEPENDS= yes . endif OLD_LIB_DEPENDS:= ${LIB_DEPENDS:S!^!${LOCALBASE}/lib/!:C!(\.so|\.[0-9]+)?:!.a:!} BUILD_DEPENDS+= ${OLD_LIB_DEPENDS} LIB_DEPENDS= .endif .if ${PORT_OPTIONS:MBDB} CONFIGURE_ARGS+= --enable-bdb6 .else CONFIGURE_ARGS+= --without-berkeley-db .endif .if make(repository) WITH_REPOSITORY_CREATION= yes .endif .if defined(WITH_REPOSITORY_CREATION) MKREPOS_TARGET= _mkrepos .endif pre-everything:: @${ECHO_MSG} "" .if defined(WITH_REPOSITORY_CREATION) @${ECHO_MSG} "I will create (or use, if it exists) '${SVNUSER}' user and '${SVNGROUP}' group." @${ECHO_MSG} "Make sure that all committers are its members." @${ECHO_MSG} "" @${ECHO_MSG} "Repository will be created at '${SVNREPOS}' with user '${SVNUSER}' and group '${SVNGROUP}'." @${ECHO_MSG} "Type of repository will be '${SVNFSTYPE}'." @${ECHO_MSG} "You could change these settings by defining SVNREPOS, SVNGROUP and SVNFSTYPE." .else @${ECHO_MSG} "You can have the repository created for you by defining" @${ECHO_MSG} "WITH_REPOSITORY_CREATION." @${ECHO_MSG} "" @${ECHO_MSG} "Make sure that:" @${ECHO_MSG} "* all your svn users are members of a common group" @${ECHO_MSG} "* this group is the group id of the db/ and locks/" @${ECHO_MSG} " subdirectories of your repository" @${ECHO_MSG} "* the above subdirectories are writable by this group" .endif @${ECHO_MSG} "" .if ${PORT_OPTIONS:MSTATIC} @${ECHO_MSG} "Static binaries will be built." .endif # STATIC @${ECHO_MSG} "Many useful scripts will be installed into ${DATADIR}" pre-configure: .if ${PORT_OPTIONS:MBDB} @BDB_VERSION=`${APR_APU_DIR}/${APU_CONFIG} --db-version`; \ if [ "$${BDB_VERSION}" != "4" -a "$${BDB_VERSION}" != "5" -a "$${BDB_VERSION}" != "6" ] ; then \ ${ECHO_MSG} "" ; \ ${ECHO_MSG} 'You should build `'"devel/apr1' with Berkeley DB (4, 5 or 6) support to use subversion with it." ; \ ${ECHO_MSG} 'Please rebuild `'"devel/apr1' with option "'`'"BDB' and try again." ; \ ${ECHO_MSG} "" ; \ ${ECHO_MSG} "Or you can disable Berkeley DB support. Only 'fs' repository backend will be available." ; \ ${ECHO_MSG} "" ; \ ${FALSE} ; \ fi .endif .if ${PORT_OPTIONS:MSTATIC} @if ${GREP} -q ucol_close ${LOCALBASE}/lib/libsqlite3.a ; then \ ${ECHO_MSG} "" ; \ ${ECHO_MSG} "You can not build static subversion if your SQLite3 is built with ICU enabled."; \ ${ECHO_MSG} "Please, reinstall 'devel/sqlite3' port with disabled ICU support."; \ ${ECHO_MSG} "" ; \ ${FALSE} ; \ fi .endif post-configure: # Enable GNOME Keyring / KWallet support in main code, as it is harmless @${REINPLACE_CMD} -E 's%.*#undef SVN_HAVE_(GNOME_KEYRING|KWALLET).*%#define SVN_HAVE_\1 1%' ${WRKSRC}/subversion/svn_private_config.h # ugly hack: save tools directory so we don't have to cleanup before installing @${CP} -R ${WRKSRC}/tools ${WRKSRC}/tools.examples @${CHMOD} -R a-st,o+rX ${WRKSRC}/tools.examples # takes a long time, and will fail but gives maintainer a good oversight .if ${PORT_OPTIONS:MTEST} test: build -@make check -C ${WRKSRC} .endif post-build-TOOLS-on: @${MAKE} -C ${WRKSRC} tools ${MAKE_ARGS} post-install: ${MKREPOS_TARGET} -@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/* @${MKDIR} ${STAGEDIR}${DATADIR} (cd ${WRKSRC}/tools.examples && ${TAR} --exclude '*.in' -cf - * | ${TAR} -C ${STAGEDIR}${DATADIR} -xof - ) @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} post-install-STATIC-off: -@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so post-install-SVNSERVE_WRAPPER-on: @${INSTALL_SCRIPT} ${FILESDIR}/svnserve.wrapper ${STAGEDIR}${PREFIX}/bin/svnserve.sample post-install-TOOLS-on: @${MAKE} -C ${WRKSRC} install-tools ${MAKE_ARGS} -@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/* # =============================================================================== repository: _mkrepos _SVNGRPFILES= db locks locks/db.lock locks/db-logs.lock SVNGRPFILES= ${_SVNGRPFILES:S,^,${SVNREPOS}/,} _mkrepos: .USE .if !exists(${SVNREPOS}) .if ${PORT_OPTIONS:MSVNSERVE_WRAPPER} @if /usr/sbin/pw groupshow "${SVNGROUP}" >/dev/null 2>&1; then \ ${ECHO_MSG} "You already have a group \"${SVNGROUP}\", so I will use it."; \ else \ if /usr/sbin/pw groupadd ${SVNGROUP} -h -; \ then \ ${ECHO_MSG} "Added group \"${SVNGROUP}\"."; \ else \ ${ECHO_MSG} "Adding group \"${SVNGROUP}\" failed..."; \ ${ECHO_MSG} "Please create it, and try again."; \ ${FALSE}; \ fi; \ fi @if /usr/sbin/pw usershow "${SVNUSER}" >/dev/null 2>&1; then \ ${ECHO_MSG} "You already have a user \"${SVNUSER}\", so I will use it."; \ else \ if /usr/sbin/pw useradd ${SVNUSER} -h -; \ then \ ${ECHO_MSG} "Added user \"${SVNUSER}\"."; \ else \ ${ECHO_MSG} "Adding user \"${SVNUSER}\" failed..."; \ ${ECHO_MSG} "Please create it, and try again."; \ ${FALSE}; \ fi; \ fi .endif @${MKDIR} ${SVNREPOS} @${PREFIX}/bin/svnadmin create --fs-type ${SVNFSTYPE} ${SVNREPOS} .if ${PORT_OPTIONS:MSVNSERVE_WRAPPER} @${CHOWN} ${SVNUSER}:${SVNGROUP} ${SVNGRPFILES} @${CHMOD} g+w ${SVNGRPFILES} @for i in ${SVNREPOS}/db/* ; do \ i=$${i##*/}; \ case $$i in \ DB_CONFIG|fs-type|uuid) ;; \ *) ${CHOWN} -R ${SVNUSER}:${SVNGROUP} ${SVNREPOS}/db/$$i; \ ${CHMOD} -R g+w ${SVNREPOS}/db/$$i; \ ;; \ esac; \ done .endif .endif svn-build-outputs-hack: (cd ${WRKSRC} && ${PATCH} ${PATCH_DIST_ARGS} -p0 < ${PATCHDIR}/extra-patch-build.conf) (cd ${WRKSRC} && python2 gen-make.py --release --installed-libs libsvn_client,libsvn_delta,libsvn_diff,libsvn_fs,libsvn_fs_x,libsvn_ra,libsvn_repos,libsvn_subr,libsvn_wc) ${MV} ${WRKSRC}/build-outputs.mk ${FILESDIR}/build-outputs.mk.addons .include Index: head/devel/subversion/Makefile.common =================================================================== --- head/devel/subversion/Makefile.common (revision 460382) +++ head/devel/subversion/Makefile.common (revision 460383) @@ -1,115 +1,120 @@ # Created by: rooneg@electricjellyfish.net # $FreeBSD$ PORTNAME?= subversion PORTVERSION= 1.9.7 PORTREVISION?= 0 CATEGORIES+= devel MASTER_SITES= APACHE/subversion DIST_SUBDIR= subversion19 GNU_CONFIGURE= yes USES+= cpe libtool pathfix pkgconfig shebangfix tar:bzip2 SHEBANG_FILES= tools/server-side/svnpubsub/rc.d/svnpubsub.solaris \ tools/server-side/svnpubsub/rc.d/svnwcsub.solaris LICENSE= APACHE20 CPE_VENDOR= apache CONFLICTS_INSTALL+= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-1.[^9].[0-9]* LIB_DEPENDS+= libapr-1.so:devel/apr1 \ libsqlite3.so:databases/sqlite3 \ libexpat.so:textproc/expat2 CONFIGURE_ARGS+= --without-swig \ --with-sqlite=${LOCALBASE} \ --with-expat=${LOCALBASE}/include:${LOCALBASE}/lib:expat .if defined(SVN_BUILD_ADDONS) CONFLICTS_BUILD+= ${PORTNAME}-1.[^9].[0-9]* LIB_DEPENDS+= libsvn_client-1.so:devel/subversion OPTIONS_NAME= devel_subversion .endif # =============================================================== OPTIONS_SUB= yes BDB_CONFIGURE_OFF= --without-berkeley-db BDB_USES= bdb MAINTAINER_DEBUG_CONFIGURE_ON= --enable-maintainer-mode --enable-debug NLS_CONFIGURE_OFF= --disable-nls NLS_USES= gettext SASL_CONFIGURE_OFF= --without-sasl SASL_CONFIGURE_ON= --with-sasl=${LOCALBASE} SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 SERF_CONFIGURE_OFF= --without-serf SERF_CONFIGURE_ON= --with-serf SERF_LIB_DEPENDS= libserf-1.so:www/serf +GPG_AGENT_CONFIGURE_OFF= --without-gpg-agent +GPG_AGENT_CONFIGURE_ON= --with-gpg-agent +GPG_AGENT_BUILD_DEPENDS= gpg-agent:security/gnupg +GPG_AGENT_RUN_DEPENDS= gpg-agent:security/gnupg + STATIC_CONFIGURE_ON= --enable-all-static PKG_CONFIG="${LOCALBASE}/bin/pkg-config --static" # =============================================================== .include .if ${PORT_OPTIONS:MMAINTAINER_DEBUG} WITH_DEBUG= yes .endif APR_CONFIG= ${LOCALBASE}/bin/apr-1-config APU_CONFIG= ${LOCALBASE}/bin/apu-1-config CONFIGURE_ARGS+=--with-apr=${APR_CONFIG} --with-apr-util=${APU_CONFIG} .if ${ARCH} == "amd64" || ${ARCH} == "ia64" CFLAGS+= -fpic -DPIC .endif OPTIONS_FILE_UNSET?="" OPTIONS_FILE_SET?="" .if ( ${PORT_OPTIONS:MFREEBSD_TEMPLATE} || !${OPTIONS_FILE_UNSET:MFREEBSD_TEMPLATE} ) && defined(ORGANIZATION) CFLAGS+= -DHAS_ORGANIZATION_NAME .endif .include pre-everything:: .if defined(SVN_BUILD_ADDONS) .if ${PORT_OPTIONS:MSTATIC} || ${OPTIONS_FILE_SET:MSTATIC} @${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" @${ECHO_MSG} "!!! addons (bindings, mod_dav_svn, etc). and static build are not compatible !!!" @${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" @${FALSE} .endif .endif pre-patch: .if defined(SVN_BUILD_ADDONS) @${CP} ${FILESDIR}/build-outputs.mk.addons ${WRKSRC}/build-outputs.mk .endif post-patch: .if ${PREFIX} != "/usr" @${REINPLACE_CMD} "s#/etc/subversion#${ETCDIR}#g" ${WRKSRC}/subversion/libsvn_subr/config_file.c @${REINPLACE_CMD} "s#/etc/subversion#${ETCDIR}#g" ${WRKSRC}/subversion/libsvn_subr/config_impl.h .endif @${REINPLACE_CMD} "s#^swig_pydir =.*#swig_pydir = ${PYTHON_SITELIBDIR}/libsvn#" ${WRKSRC}/Makefile.in @${REINPLACE_CMD} "s#^swig_pydir_extra =.*#swig_pydir_extra = ${PYTHON_SITELIBDIR}/svn#" ${WRKSRC}/Makefile.in .if ( ${PORT_OPTIONS:MFREEBSD_TEMPLATE} || !${OPTIONS_FILE_UNSET:MFREEBSD_TEMPLATE} ) && defined(ORGANIZATION) @${ECHO_CMD} "#define ORGANIZATION_NAME \"${ORGANIZATION}\"" > ${WRKSRC}/subversion/freebsd-organization.h .endif # shebangfix @${FIND} ${WRKSRC}/tools/ -type f -exec ${GREP} -l -e '#!/bin/b' -e '#!/bin/env' \ -e '#!/usr/bin/p' {} + | ${XARGS} ${REINPLACE_CMD} -e \ '1s|#\!/bin/b|#\!/usr/local/bin/b|' \ -e '1s|#\!/bin/env|#\!/usr/bin/env|' \ -e '1s|#\!/usr/bin/p|#\!/usr/local/bin/p|' # remove all .bak files to clean the stage @${FIND} ${WRKSRC} -name '*.bak' -delete Index: head/devel/subversion/files/patch-subversion_libsvn_subr_gpg_agent.c =================================================================== --- head/devel/subversion/files/patch-subversion_libsvn_subr_gpg_agent.c (nonexistent) +++ head/devel/subversion/files/patch-subversion_libsvn_subr_gpg_agent.c (revision 460383) @@ -0,0 +1,153 @@ +--- subversion/libsvn_subr/gpg_agent.c.orig 2016-11-14 04:00:09 UTC ++++ subversion/libsvn_subr/gpg_agent.c +@@ -65,9 +65,12 @@ + #include + + #include ++#include ++#include + #include "svn_auth.h" + #include "svn_config.h" + #include "svn_error.h" ++#include "svn_io.h" + #include "svn_pools.h" + #include "svn_cmdline.h" + #include "svn_checksum.h" +@@ -225,30 +228,31 @@ bye_gpg_agent(int sd) + close(sd); + } + +-/* Locate a running GPG Agent, and return an open file descriptor +- * for communication with the agent in *NEW_SD. If no running agent +- * can be found, set *NEW_SD to -1. */ +-static svn_error_t * +-find_running_gpg_agent(int *new_sd, apr_pool_t *pool) ++/* This implements a method of finding the socket which is a mix of the ++ * description from GPG 1.x's gpg-agent man page under the ++ * --use-standard-socket option and the logic from GPG 2.x's socket discovery ++ * code in common/homedir.c. ++ * ++ * The man page says the standard socket is "named 'S.gpg-agent' located ++ * in the home directory." GPG's home directory is either the directory ++ * specified by $GNUPGHOME or ~/.gnupg. GPG >= 2.1.13 will check for a ++ * socket under (/var)/run/UID/gnupg before ~/.gnupg if no environment ++ * variables are set. ++ * ++ * $GPG_AGENT_INFO takes precedence, if set, otherwise $GNUPGHOME will be ++ * used. For GPG >= 2.1.13, $GNUPGHOME will be used directly only if it ++ * refers to the canonical home -- ~/.gnupg. Otherwise, the path specified ++ * by $GNUPGHOME is hashed (SHA1 + z-base-32) and the socket is expected to ++ * be present under (/var)/run/UID/gnupg/d.HASH. This last mechanism is not ++ * yet supported here. */ ++static const char * ++find_gpg_agent_socket(apr_pool_t *result_pool, apr_pool_t *scratch_pool) + { +- char *buffer; + char *gpg_agent_info = NULL; + char *gnupghome = NULL; + const char *socket_name = NULL; +- const char *request = NULL; +- const char *p = NULL; +- char *ep = NULL; +- int sd; + +- *new_sd = -1; +- +- /* This implements the method of finding the socket as described in +- * the gpg-agent man page under the --use-standard-socket option. +- * The manage page says the standard socket is "named 'S.gpg-agent' located +- * in the home directory." GPG's home directory is either the directory +- * specified by $GNUPGHOME or ~/.gnupg. */ +- gpg_agent_info = getenv("GPG_AGENT_INFO"); +- if (gpg_agent_info != NULL) ++ if ((gpg_agent_info = getenv("GPG_AGENT_INFO")) != NULL) + { + apr_array_header_t *socket_details; + +@@ -256,25 +260,77 @@ find_running_gpg_agent(int *new_sd, apr_pool_t *pool) + * The path to the socket, the pid of the gpg-agent process and + * finally the version of the protocol the agent talks. */ + socket_details = svn_cstring_split(gpg_agent_info, ":", TRUE, +- pool); ++ scratch_pool); + socket_name = APR_ARRAY_IDX(socket_details, 0, const char *); + } + else if ((gnupghome = getenv("GNUPGHOME")) != NULL) + { +- const char *homedir = svn_dirent_canonicalize(gnupghome, pool); +- socket_name = svn_dirent_join(homedir, "S.gpg-agent", pool); ++ const char *homedir = svn_dirent_canonicalize(gnupghome, scratch_pool); ++ socket_name = svn_dirent_join(homedir, "S.gpg-agent", scratch_pool); + } + else + { +- const char *homedir = svn_user_get_homedir(pool); ++ int i = 0; ++ const char *maybe_socket[] = {NULL, NULL, NULL, NULL}; ++ const char *homedir; + +- if (!homedir) +- return SVN_NO_ERROR; ++#ifdef APR_HAS_USER ++ apr_uid_t uid; ++ apr_gid_t gid; + +- homedir = svn_dirent_canonicalize(homedir, pool); +- socket_name = svn_dirent_join_many(pool, homedir, ".gnupg", +- "S.gpg-agent", SVN_VA_NULL); ++ if (apr_uid_current(&uid, &gid, scratch_pool) == APR_SUCCESS) ++ { ++ const char *uidbuf = apr_psprintf(scratch_pool, "%lu", ++ (unsigned long)uid); ++ maybe_socket[i++] = svn_dirent_join_many(scratch_pool, "/run/user", ++ uidbuf, "gnupg", ++ "S.gpg-agent", ++ SVN_VA_NULL); ++ maybe_socket[i++] = svn_dirent_join_many(scratch_pool, ++ "/var/run/user", ++ uidbuf, "gnupg", ++ "S.gpg-agent", ++ SVN_VA_NULL); ++ } ++#endif ++ ++ homedir = svn_user_get_homedir(scratch_pool); ++ if (homedir) ++ maybe_socket[i++] = svn_dirent_join_many(scratch_pool, homedir, ++ ".gnupg", "S.gpg-agent", ++ SVN_VA_NULL); ++ ++ for (i = 0; !socket_name && maybe_socket[i]; i++) ++ { ++ apr_finfo_t finfo; ++ svn_error_t *err = svn_io_stat(&finfo, maybe_socket[i], ++ APR_FINFO_TYPE, scratch_pool); ++ if (!err && finfo.filetype == APR_SOCK) ++ socket_name = maybe_socket[i]; ++ svn_error_clear(err); ++ } + } ++ ++ if (socket_name) ++ socket_name = apr_pstrdup(result_pool, socket_name); ++ ++ return socket_name; ++} ++ ++/* Locate a running GPG Agent, and return an open file descriptor ++ * for communication with the agent in *NEW_SD. If no running agent ++ * can be found, set *NEW_SD to -1. */ ++static svn_error_t * ++find_running_gpg_agent(int *new_sd, apr_pool_t *pool) ++{ ++ char *buffer; ++ const char *socket_name = find_gpg_agent_socket(pool, pool); ++ const char *request = NULL; ++ const char *p = NULL; ++ char *ep = NULL; ++ int sd; ++ ++ *new_sd = -1; + + if (socket_name != NULL) + { Property changes on: head/devel/subversion/files/patch-subversion_libsvn_subr_gpg_agent.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property