Explorar o código

add support for Subversion over DAV via Apache 2

Ralf S. Engelschall %!s(int64=18) %!d(string=hai) anos
pai
achega
872ff9ccb0
Modificáronse 3 ficheiros con 82 adicións e 20 borrados
  1. 19 0
      subversion/subversion.config.apache
  2. 35 16
      subversion/subversion.patch
  3. 28 4
      subversion/subversion.spec

+ 19 - 0
subversion/subversion.config.apache

@@ -0,0 +1,19 @@
+##
+##  subversion.conf -- Apache configuration for Subversion modules
+##
+
+LoadModule dav_svn_module   @l_prefix@/libexec/apache2/mod_dav_svn.so
+LoadModule authz_svn_module @l_prefix@/libexec/apache2/mod_authz_svn.so
+
+#<Location /svn/default>
+#    DAV                 svn
+#    SVNParentPath       @l_prefix@/var/subversion/default
+#    AuthzSVNAccessFile  @l_prefix@/var/subversion/default/conf/authz
+#    AuthUserFile        @l_prefix@/var/subversion/default/conf/htpasswd
+#    AuthName            "Subversion Default Repository"
+#    AuthType            Basic
+#    <LimitExcept GET PROPFIND OPTIONS REPORT>
+#        Require         valid-user
+#    </LimitExcept>
+#</Location>
+

+ 35 - 16
subversion/subversion.patch

@@ -1,18 +1,36 @@
 Index: Makefile.in
---- Makefile.in.orig	2005-05-09 07:56:09 +0200
-+++ Makefile.in	2005-05-26 21:18:45 +0200
-@@ -575,7 +575,7 @@
- install-swig-rb: install-swig-rb-lib
+--- Makefile.in.orig	2006-08-23 17:12:43 +0200
++++ Makefile.in	2007-06-06 16:45:20 +0200
+@@ -144,7 +144,7 @@
+ LT_COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE)
+ 
+ # special compilation for files destined for mod_dav_svn
+-COMPILE_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) $(APACHE_INCLUDES) $(INCLUDES) -o $@ -c
++COMPILE_APACHE_MOD = @APXS@ -c -S LIBEXECDIR="$(APACHE_LIBEXECDIR)" $(CPPFLAGS) $(APACHE_INCLUDES) $(INCLUDES) -o $@
+ 
+ # special compilation for files destined for libsvn_swig_* (e.g. swigutil_*.c)
+ COMPILE_SWIG_PY = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(CPPFLAGS) -DSWIGPYTHON $(CFLAGS) $(SWIG_PY_INCLUDES) $(INCLUDES) -o $@ -c
+@@ -159,7 +159,7 @@
+ LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(libdir)
+ 
+ # special link rule for mod_dav_svn
+-LINK_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(APACHE_LIBEXECDIR) -avoid-version -module $(APACHE_LDFLAGS)
++LINK_APACHE_MOD = @APXS@ -c -S LIBEXECDIR="$(APACHE_LIBEXECDIR)" $(LDFLAGS) $(APACHE_LDFLAGS)
+ 
+ # Compilation of SWIG-generated C source code
+ COMPILE_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(CPPFLAGS) $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -prefer-pic -c -o $@
+@@ -601,7 +601,7 @@
+ 	./config.status subversion/bindings/swig/perl/native/Makefile.PL
  
  $(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL
 -	cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL
 +	cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL INSTALLDIRS=vendor
  
- swig-pl_DEPS = libsvn_client libsvn_delta libsvn_diff libsvn_fs libsvn_ra libsvn_repos libsvn_subr libsvn_wc libsvn_swig_perl $(SWIG_PL_DIR)/native/Makefile
- swig-pl: $(swig-pl_DEPS)
+ swig-pl_DEPS = autogen-swig-pl libsvn_client libsvn_delta libsvn_diff \
+   libsvn_fs libsvn_ra libsvn_repos libsvn_subr libsvn_wc libsvn_swig_perl \
 Index: apr-util/crypto/getuuid.c
---- apr-util/crypto/getuuid.c.orig	2006-03-25 03:00:17 +0100
-+++ apr-util/crypto/getuuid.c	2006-04-04 19:13:08 +0200
+--- apr-util/crypto/getuuid.c.orig	2007-01-17 23:16:55 +0100
++++ apr-util/crypto/getuuid.c	2007-06-06 16:45:20 +0200
 @@ -102,7 +102,7 @@
  static void get_pseudo_node_identifier(unsigned char *node)
  {
@@ -75,9 +93,10 @@ Index: apr-util/crypto/getuuid.c
 +    /* UUID field: node */
      memcpy(&d[10], uuid_state_node, NODE_LENGTH);
  }
---- configure.orig      Fri Jul  1 22:18:48 2005
-+++ configure   Fri Aug  5 17:18:33 2005
-@@ -19775,6 +19775,11 @@
+Index: configure
+--- configure.orig	2007-01-17 23:17:34 +0100
++++ configure	2007-06-06 16:45:20 +0200
+@@ -4207,6 +4207,11 @@
        ac_sub_cache_file="$ac_dots$cache_file" ;;
      esac
  
@@ -90,9 +109,9 @@ Index: apr-util/crypto/getuuid.c
      if eval $SHELL $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $args
      then :
 Index: subversion/bindings/swig/perl/native/Makefile.PL.in
---- subversion/bindings/swig/perl/native/Makefile.PL.in.orig	2005-03-22 10:31:58 +0100
-+++ subversion/bindings/swig/perl/native/Makefile.PL.in	2005-05-26 21:18:45 +0200
-@@ -26,16 +26,12 @@
+--- subversion/bindings/swig/perl/native/Makefile.PL.in.orig	2005-11-16 15:19:09 +0100
++++ subversion/bindings/swig/perl/native/Makefile.PL.in	2007-06-06 16:45:20 +0200
+@@ -23,16 +23,12 @@
                                                                        ra_dav
                                                                        fs_base
                                                                        fs_fs/));
@@ -111,8 +130,8 @@ Index: subversion/bindings/swig/perl/native/Makefile.PL.in
  
  chomp $apr_shlib_path_var;
  
-@@ -46,9 +42,9 @@
-                  " -I$svnlib_srcdir/include",
+@@ -44,9 +40,9 @@
+                  " -I$svnlib_builddir",
                   " -I$swig_srcdir -g"),
      OBJECT => q/$(O_FILES)/,
 -    LIBS => [join(' ', $apr_ldflags,

+ 28 - 4
subversion/subversion.spec

@@ -41,11 +41,12 @@ Class:        BASE
 Group:        SCM
 License:      Apache/BSD
 Version:      %{V_opkg}
-Release:      20070127
+Release:      20070606
 
 #   package options
 %option       with_cvs2svn  no
 %option       with_svn2cvs  no
+%option       with_apache2  no
 %option       with_perl     no
 %option       with_python   no
 %option       with_ruby     no
@@ -58,8 +59,9 @@ Source3:      ftp://ftp.openpkg.org/sources/CPY/subversion/svn2cvs.pl-%{V_svn2cv
 Source4:      ftp://ftp.openpkg.org/sources/CPY/subversion/svn-book-%{V_book_html}.html
 Source5:      ftp://ftp.openpkg.org/sources/CPY/subversion/svn-book-%{V_book_pdf}.pdf
 Source6:      subversion.config
-Source7:      subversion.servers
-Source8:      rc.subversion
+Source7:      subversion.config.apache
+Source8:      subversion.servers
+Source9:      rc.subversion
 Patch0:       subversion.patch
 
 #   build information
@@ -76,6 +78,9 @@ PreReq:       rcs, python, python::with_dbm = yes
 BuildPreReq:  perl
 PreReq:       perl, perl-xml, cvs, rcs
 %endif
+%if "%{with_apache2}" == "yes"
+BuildPreReq:  apache2
+%endif
 %if "%{with_perl}" == "yes" || "%{with_python}" == "yes"
 BuildPreReq:  swig
 %endif
@@ -163,6 +168,12 @@ AutoReqProv:  no
         --without-gssapi \
         --with-libxml2 \
         --enable-static \
+%if "%{with_apache2}" == "yes"
+        --with-apxs \
+        --disable-mod-activation \
+%else
+        --without-apxs \
+%endif
 %if "%{with_perl}" == "yes" || "%{with_python}" == "yes"
         --with-swig=%{l_prefix}/bin/swig \
 %endif
@@ -177,7 +188,7 @@ AutoReqProv:  no
 %endif
         --disable-nls \
         --disable-shared \
-        --without-apxs
+        --enable-static
 
     #   build package
     %{l_make} %{l_mflags}
@@ -328,6 +339,15 @@ AutoReqProv:  no
         svn2cvs.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/svn2cvs.1
 %endif
 
+%if "%{with_apache2}" == "yes"
+    #   install Apache configuration file
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/apache2/apache2.d
+    %{l_shtool} install -c -m 644 %{l_value -s -a} \
+        %{SOURCE subversion.config.apache} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/apache2/apache2.d/subversion.conf
+%endif
+
     #   install run-command script
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
@@ -361,6 +381,10 @@ AutoReqProv:  no
     [ $1 -eq 2 ] || exit 0
     eval `%{l_rc} subversion status 2>/dev/null`
     [ ".$subversion_active" = .yes ] && %{l_rc} subversion restart
+%if "%{with_apache2}" == "yes"
+    eval `%{l_rc} apache2 status 2>/dev/null`
+    [ ".$apache2_active" = .yes ] && %{l_rc} apache2 restart
+%endif
     exit 0
 
 %preun