Kaynağa Gözat

provide SWIG-based Subversion Perl bindings

Ralf S. Engelschall 20 yıl önce
ebeveyn
işleme
5239f66c45
2 değiştirilmiş dosya ile 58 ekleme ve 5 silme
  1. 34 0
      subversion/subversion.patch
  2. 24 5
      subversion/subversion.spec

+ 34 - 0
subversion/subversion.patch

@@ -10,3 +10,37 @@ Index: apr-util/crypto/getuuid.c
  }
  
  static void get_system_time(apr_uint64_t *uuid_time)
+Index: subversion/bindings/swig/perl/native/Makefile.PL.in
+--- subversion/bindings/swig/perl/native/Makefile.PL.in.orig	2004-09-14 18:32:08 +0200
++++ subversion/bindings/swig/perl/native/Makefile.PL.in	2005-03-06 13:40:24 +0100
+@@ -26,16 +26,12 @@
+                                                                       ra_dav
+                                                                       fs_base
+                                                                       fs_fs/));
+-my @ldmodules = map {"-lsvn_$_-1"} (@modules, qw/diff subr/);
++my @ldmodules = map {"-lsvn_$_-1"} (@modules, qw/diff subr delta ra_dav subr ra_local ra_svn fs_base fs_fs/);
+ 
+ my $apr_shlib_path_var = '@SVN_APR_SHLIB_PATH_VAR@';
+ my $apr_cflags = '@SVN_APR_INCLUDES@';
+ my $apu_cflags = '@SVN_APRUTIL_INCLUDES@';
+-
+-# According to the log of r7937, the flags guarded by the conditional break
+-# the build on FreeBSD if not conditionalized.
+-my $apr_ldflags = '@SVN_APR_EXPORT_LIBS@' 
+-   if $^O eq 'darwin' or $^O eq 'cygwin';
++my $apr_ldflags = '@SVN_APRUTIL_EXPORT_LIBS@ @SVN_APR_EXPORT_LIBS@ -liconv -lz '.`neon-config --libs`.' -lssl -lcrypto -lxml2';
+ 
+ chomp $apr_shlib_path_var;
+ 
+@@ -46,9 +42,9 @@
+                  " -I$svnlib_srcdir/include",
+                  " -I$swig_srcdir -g"),
+     OBJECT => q/$(O_FILES)/,
+-    LIBS => [join(' ', $apr_ldflags,
++    LIBS => [join(' ', "-L@l_prefix@/lib",
+                   (map {$_ = abs_path($_); "-L$_"} @ldpaths),
+-                  @ldmodules, '-lsvn_swig_perl-1',
++                  '-lsvn_swig_perl-1', @ldmodules, @ldmodules, @ldmodules, @ldmodules, $apr_ldflags,
+                   `$swig -perl -ldflags`)],
+     test => { TESTS => "$swig_srcdir/perl/native/t/*.t" }
+ );

+ 24 - 5
subversion/subversion.spec

@@ -39,11 +39,12 @@ Class:        BASE
 Group:        SCM
 License:      Apache/BSD
 Version:      %{V_opkg}
-Release:      20050305
+Release:      20050306
 
 #   package options
 %option       with_cvs2svn  no
 %option       with_svn2cvs  no
+%option       with_perl     no
 
 #   list of sources
 Source0:      http://subversion.tigris.org/tarballs/subversion-%{V_dist}.tar.gz
@@ -67,6 +68,10 @@ PreReq:       rcs, python
 BuildPreReq:  perl
 PreReq:       perl, perl-xml, cvs, rcs
 %endif
+%if "%{with_perl}" == "yes"
+BuildPreReq:  perl, swig
+PreReq:       perl
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -93,6 +98,8 @@ AutoReqProv:  no
     %setup -q
     %setup -q -T -D -a 1
     %patch -p0
+    %{l_shtool} subst %{l_value -s -a} \
+        subversion/bindings/swig/perl/native/Makefile.PL.in
 
 %build
     #   configure package
@@ -113,27 +120,39 @@ AutoReqProv:  no
         --with-neon=%{l_prefix} \
         --with-zlib \
         --enable-static \
+%if "%{with_perl}" == "yes"
+        --with-swig=%{l_prefix}/bin/swig-old \
+        --enable-swig-bindings=perl \
+%endif
         --disable-nls \
         --disable-shared \
         --without-apxs
 
     #   build package
     %{l_make} %{l_mflags}
+%if "%{with_perl}" == "yes"
+    ( cd apr;      ln -s .libs/libapr-0.a .     ) || exit $?
+    ( cd apr-util; ln -s .libs/libaprutil-0.a . ) || exit $?
+    %{l_make} %{l_mflags} swig-pl
+%endif
 
 %install
     #   install package
     rm -rf $RPM_BUILD_ROOT
     %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
+%if "%{with_perl}" == "yes"
+    %{l_make} %{l_mflags} install-swig-pl DESTDIR=$RPM_BUILD_ROOT
+%endif
 
     #   strip down installation
-    rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
-    rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/mod_dav_svn.h
     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
     rm -rf $RPM_BUILD_ROOT%{l_prefix}/build
     rm -f  $RPM_BUILD_ROOT%{l_prefix}/man/man1/neon*
-    rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
-    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/*-config
     strip  $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
+%if "%{with_perl}" == "yes"
+    %{l_prefix}/bin/perl-openpkg -F- fixate >/dev/null
+%endif
 
     #   install svn_load_dirs(1) tool
     %{l_shtool} install -c -m 755 \