1 # Created by: rooneg@electricjellyfish.net
6 MAINTAINER= lev@FreeBSD.org
7 COMMENT= Version control system
9 CONFLICTS_INSTALL= subversion-1.[^9].[0-9]* \
10 subversion1[^9]-1.[^9].[0-9]*
14 PORTDOCS= BUGS CHANGES COMMITTERS INSTALL README
29 OPTIONS_DEFAULT=FREEBSD_TEMPLATE \
32 FREEBSD_TEMPLATE_DESC= FreeBSD Project log template
33 MAINTAINER_DEBUG_DESC= Build debug version
34 SERF_DESC= WebDAV/Delta-V (HTTP/HTTPS) repo access module
35 STATIC_DESC= Build static version (no shared libs)
36 SVNSERVE_WRAPPER_DESC= Enable svnserve wrapper (umask setter)
37 TEST_DESC= Run subversion test suite
38 TOOLS_DESC= Install several tools
40 # Patches required for use with the FreeBSD Project repository only
41 FREEBSD_TEMPLATE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fbsd-template
42 SVNSERVE_WRAPPER_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-svnserve-wrapper
44 .include "Makefile.common"
46 SVNREPOS?= /home/svn/repos
51 CONFIGURE_ARGS+= --without-gnome-keyring \
55 .if ${PORT_OPTIONS:MSVNSERVE_WRAPPER}
56 SUB_LIST+= SVNSERVE_BIN_EXT=".bin"
57 PLIST_SUB+= NO_SVNSERVE_WRAPPER="@comment "
59 SUB_LIST+= SVNSERVE_BIN_EXT=""
60 PLIST_SUB+= NO_SVNSERVE_WRAPPER=""
63 .if ${PORT_OPTIONS:MTEST}
64 TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3
67 .if ${PORT_OPTIONS:MSTATIC}
68 . if ${PORT_OPTIONS:MNLS}
71 . if ${PORT_OPTIONS:MBDB}
72 BDB_BUILD_DEPENDS= yes
74 OLD_LIB_DEPENDS:= ${LIB_DEPENDS:S!^!${LOCALBASE}/lib/!:C!(\.so|\.[0-9]+)?:!.a:!}
75 BUILD_DEPENDS+= ${OLD_LIB_DEPENDS}
79 .if ${PORT_OPTIONS:MBDB}
80 CONFIGURE_ARGS+= --enable-bdb6
82 CONFIGURE_ARGS+= --without-berkeley-db
86 WITH_REPOSITORY_CREATION= yes
89 .if defined(WITH_REPOSITORY_CREATION)
90 MKREPOS_TARGET= _mkrepos
95 .if defined(WITH_REPOSITORY_CREATION)
96 @${ECHO_MSG} "I will create (or use, if it exists) '${SVNUSER}' user and '${SVNGROUP}' group."
97 @${ECHO_MSG} "Make sure that all committers are its members."
99 @${ECHO_MSG} "Repository will be created at '${SVNREPOS}' with user '${SVNUSER}' and group '${SVNGROUP}'."
100 @${ECHO_MSG} "Type of repository will be '${SVNFSTYPE}'."
101 @${ECHO_MSG} "You could change these settings by defining SVNREPOS, SVNGROUP and SVNFSTYPE."
103 @${ECHO_MSG} "You can have the repository created for you by defining"
104 @${ECHO_MSG} "WITH_REPOSITORY_CREATION."
106 @${ECHO_MSG} "Make sure that:"
107 @${ECHO_MSG} "* all your svn users are members of a common group"
108 @${ECHO_MSG} "* this group is the group id of the db/ and locks/"
109 @${ECHO_MSG} " subdirectories of your repository"
110 @${ECHO_MSG} "* the above subdirectories are writable by this group"
114 .if ${PORT_OPTIONS:MSTATIC}
115 @${ECHO_MSG} "Static binaries will be built."
117 @${ECHO_MSG} "Many useful scripts will be installed into ${DATADIR}"
120 .if ${PORT_OPTIONS:MBDB}
121 @BDB_VERSION=`${APR_APU_DIR}/${APU_CONFIG} --db-version`; \
122 if [ "$${BDB_VERSION}" != "4" -a "$${BDB_VERSION}" != "5" -a "$${BDB_VERSION}" != "6" ] ; then \
124 ${ECHO_MSG} 'You should build `'"devel/apr1' with Berkeley DB (4, 5 or 6) support to use subversion with it." ; \
125 ${ECHO_MSG} 'Please rebuild `'"devel/apr1' with option "'`'"BDB' and try again." ; \
127 ${ECHO_MSG} "Or you can disable Berkeley DB support. Only 'fs' repository backend will be available." ; \
132 .if ${PORT_OPTIONS:MSTATIC}
133 @if ${GREP} -q icui18n ${LOCALBASE}/lib/libsqlite3.la ; then \
135 ${ECHO_MSG} "You can not build static subversion if your SQLite3 is built with ICU enabled."; \
136 ${ECHO_MSG} "Please, reinstall 'devel/sqlite3' port with disabled ICU support."; \
143 # Enable GNOME Keyring / KWallet support in main code, as it is harmless
144 @${REINPLACE_CMD} -E 's%.*#undef SVN_HAVE_(GNOME_KEYRING|KWALLET).*%#define SVN_HAVE_\1 1%' ${WRKSRC}/subversion/svn_private_config.h
145 # ugly hack: save tools directory so we don't have to cleanup before installing
146 @${CP} -R ${WRKSRC}/tools ${WRKSRC}/tools.examples
147 @${CHMOD} -R a-st,o+rX ${WRKSRC}/tools.examples
149 # takes a long time, and will fail but gives maintainer a good oversight
150 .if ${PORT_OPTIONS:MTEST}
152 -@make check -C ${WRKSRC}
156 .if ${PORT_OPTIONS:MTOOLS}
157 @${MAKE} -C ${WRKSRC} tools ${MAKE_ARGS}
160 post-install: ${MKREPOS_TARGET}
161 .if ${PORT_OPTIONS:MTOOLS}
162 @${MAKE} -C ${WRKSRC} install-tools ${MAKE_ARGS}
164 @${MKDIR} ${STAGEDIR}${DATADIR}
165 (cd ${WRKSRC}/tools.examples && ${TAR} --exclude '*.in' -cf - * | ${TAR} -C ${STAGEDIR}${DATADIR} -xof - )
166 @${MKDIR} ${STAGEDIR}${DOCSDIR}
167 ${INSTALL_MAN} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
169 post-install-SVNSERVE_WRAPPER-on:
170 @${INSTALL_SCRIPT} ${FILESDIR}/svnserve.wrapper ${STAGEDIR}${PREFIX}/bin/svnserve.sample
172 # ===============================================================================
175 _SVNGRPFILES= db locks locks/db.lock locks/db-logs.lock
176 SVNGRPFILES= ${_SVNGRPFILES:S,^,${SVNREPOS}/,}
179 .if !exists(${SVNREPOS})
180 .if ${PORT_OPTIONS:MSVNSERVE_WRAPPER}
181 @if /usr/sbin/pw groupshow "${SVNGROUP}" >/dev/null 2>&1; then \
182 ${ECHO_MSG} "You already have a group \"${SVNGROUP}\", so I will use it."; \
184 if /usr/sbin/pw groupadd ${SVNGROUP} -h -; \
186 ${ECHO_MSG} "Added group \"${SVNGROUP}\"."; \
188 ${ECHO_MSG} "Adding group \"${SVNGROUP}\" failed..."; \
189 ${ECHO_MSG} "Please create it, and try again."; \
193 @if /usr/sbin/pw usershow "${SVNUSER}" >/dev/null 2>&1; then \
194 ${ECHO_MSG} "You already have a user \"${SVNUSER}\", so I will use it."; \
196 if /usr/sbin/pw useradd ${SVNUSER} -h -; \
198 ${ECHO_MSG} "Added user \"${SVNUSER}\"."; \
200 ${ECHO_MSG} "Adding user \"${SVNUSER}\" failed..."; \
201 ${ECHO_MSG} "Please create it, and try again."; \
206 @${MKDIR} ${SVNREPOS}
207 @${PREFIX}/bin/svnadmin create --fs-type ${SVNFSTYPE} ${SVNREPOS}
208 .if ${PORT_OPTIONS:MSVNSERVE_WRAPPER}
209 @${CHOWN} ${SVNUSER}:${SVNGROUP} ${SVNGRPFILES}
210 @${CHMOD} g+w ${SVNGRPFILES}
211 @for i in ${SVNREPOS}/db/* ; do \
214 DB_CONFIG|fs-type|uuid) ;; \
215 *) ${CHOWN} -R ${SVNUSER}:${SVNGROUP} ${SVNREPOS}/db/$$i; \
216 ${CHMOD} -R g+w ${SVNREPOS}/db/$$i; \
223 svn-build-outputs-hack:
224 (cd ${WRKSRC} && ${PATCH} ${PATCH_DIST_ARGS} -p0 < ${PATCHDIR}/extra-patch-build.conf)
225 (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)
226 ${MV} ${WRKSRC}/build-outputs.mk ${FILESDIR}/build-outputs.mk.addons
228 .include <bsd.port.post.mk>