# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit libtool DESCRIPTION="A compelling replacement for CVS" SRC_URI=" http://subversion.tigris.org/files/documents/15/5977/${P}.tar.gz" HOMEPAGE="http://subversion.tigris.org/" SLOT="0" LICENSE="Apache-1.1" KEYWORDS="~x86" IUSE="ssl apache2 berkdb python emacs" S=${WORKDIR}/${P} if [ "${SVN_REPOS_LOC}x" = "x" ]; then SVN_REPOS_LOC="/home/svn" fi # # # Note that to disable the server part of subversion you need to specify # USE="-berkdb" emerge subversion. # # DEPEND="python? ( >=dev-lang/python-2.0 ) python? ( >=dev-lang/swig-1.3.16 ) emacs? ( virtual/emacs ) apache2? ( >=net-www/apache-2.0.45 ) berkdb? ( >=sys-libs/db-4.0.14 ) !apache2? ( !>=apache-2* ) !dev-libs/apr >=sys-apps/diffutils-2.7.7 >=sys-devel/libtool-1.4.1-r1 >=sys-devel/bison-1.28-r3 >=net-misc/neon-0.23.8 ~sys-devel/m4-1.4" RDEPEND="python? ( >=dev-lang/python-2.0 ) emacs? ( virtual/emacs ) >=sys-apps/diffutils-2.7.7 ~sys-devel/m4-1.4" pkg_setup() { if has_version '${D}/etc/apache2/conf/modules.d/47_mod_dav_svn.conf LoadModule dav_svn_module extramodules/mod_dav_svn.so DAV svn SVNPath ${SVN_REPOS_LOC}/repos AuthType Basic AuthName "Subversion repository" AuthUserFile ${SVN_REPOS_LOC}/conf/svnusers Require valid-user EOF fi } pkg_postinst() { if use berkdb; then einfo "WARNING: If you updated from subversion 0.27 or less." einfo "WARNING: You must use this new Subversion code to create, and load" einfo "WARNING: your dumpfile a new repository using 'svnadmin load'." einfo "WARNING: And don't forget to copy over any custom configuration/hooks" einfo "WARNING: from the old to the new repository." einfo "" einfo "More details:" einfo " http://svn.collab.net/repos/svn/trunk/notes/repos_upgrade_HOWTO" if use apache2; then einfo "Subversion has multiple server types. To enable the http based version" einfo "you must edit /etc/conf.d/apache2 to include both \"-D DAV\" and \"-D SVN\"" einfo "" fi einfo "A repository needs to be created using the ebuild ${PN} config command" if has_version =sys-libs/db-4*; then einfo "If you upgraded from an older version of berkely db and experience" einfo "problems with your repository then run the following command:" einfo " su apache -c \"db4_recover -h /path/to/repos\"" fi if use apache2; then einfo "To allow web access a htpasswd file needs to be created using the" einfo "following command:" einfo " htpasswd2 -m -c ${SVN_REPOS_LOC}/conf/svnusers USERNAME" fi else einfo "Your subversion is client only as the server is only build when" einfo "the berkdb flag is set" fi if [ -n "`use emacs`" ]; then inherit elisp elisp-site-regen fi } pkkg_postrm() { if [ -n "`use emacs`" ]; then inherit elisp elisp-site-regen fi } pkg_config() { if [ ! -x /usr/bin/svnadmin ]; then die "You seem to only have build the subversion client" fi einfo ">>> Initializing the database in ${SVN_REPOS_LOC}..." if [ -f ${SVN_REPOS_LOC}/repos ] ; then echo "A subversion repository already exists and I will not overwrite it." echo "Delete ${SVN_REPOS_LOC}/repos first if you're sure you want to have a clean version." else mkdir -p ${SVN_REPOS_LOC} einfo ">>> Populating repository directory ..." # create initial repository /usr/bin/svnadmin create ${SVN_REPOS_LOC}/repos einfo ">>> Setting repository permissions ..." chown -Rf apache.apache ${SVN_REPOS_LOC}/repos chmod -Rf 755 ${SVN_REPOS_LOC}/repos fi }