packages java-svnkit.spec
      Pages: < 1 >  DOWNLOAD      
%define svn_rev 6888
%define with_eclipse 1
%if %with_eclipse 
%define eclipse_base     %{_libdir}/eclipse
%define eclipse_dropin   %{_datadir}/eclipse/dropins
%define svnkit_dropins   %{eclipse_dropin}/svnkit/eclipse
%define svnkit_plugins   %{svnkit_dropins}/plugins
%define svnkit_features  %{svnkit_dropins}/features
%define core_plugin_name org.tmatesoft.svnkit_%{version}
%define core_plugin_dir  %{svnkit_plugins}/%{core_plugin_name}
%define jna_plugin_name  com.sun.jna_3.2.7
%define jna_plugin_dir   %{svnkit_dropins}/%{jna_plugin_name}
%endif

Name:          java-svnkit
Version:       1.3.4
Release:       1mamba
Summary:       A pure Java Subversion library, formerly known as JavaSVN
Group:         Development/Tools
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://svnkit.com/licensing.html
Source0:       http://www.svnkit.com/org.tmatesoft.svn_%{version}.src.zip
# missing files
# svn export http://svn.svnkit.com/repos/svnkit/tags/%{version}/svnkit-test
Source1:       svnkit-test-%{version}-src-svn-tar.gz
Source2:       java-svnkit-1.2.3-jsvn.script
Source3:       java-svnkit-1.2.3-jsvnadmin.script
Source4:       java-svnkit-1.2.3-jsvndumpfilter.script
Source5:       java-svnkit-1.2.3-jsvnlook.script
Source6:       java-svnkit-1.2.3-jsvnsync.script
Source7:       java-svnkit-1.2.3-jsvnversion.script
Source8:       http://repo1.maven.org/maven2/org/tmatesoft/svnkit/svnkit/%{version}/svnkit-%{version}.pom 
Patch0:        java-svnkit-1.3.4-dependencies.patch
License:       TMate Open Source License
BuildRequires: antlr3
BuildRequires: apache-ant
%if %with_eclipse 
BuildRequires: eclipse-pde
%endif
BuildRequires: java-jna
BuildRequires: java-junit3
BuildRequires: java-subversion
#BuildRequires: java-svntask
BuildRequires: java-sqljet
BuildRequires: java-trilead-ssh2
BuildRequires: jpackage-utils
Requires:      java-jna
Requires:      java-subversion
Requires:      java-trilead-ssh2
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
SVNKit is a pure Java Subversion client library. You would like to use SVNKit
when you need to access or modify Subversion repository from your Java
application, be it a standalone program, plugin or web application. Being a
pure Java program, SVNKit doesn't need any additional configuration or native
binaries to work on any OS that runs Java

%package javadoc
Group:          Documentation
Summary:        Javadoc for %{name}

%description javadoc
SVNKit is a pure Java Subversion client library. You would like to use SVNKit
when you need to access or modify Subversion repository from your Java
application, be it a standalone program, plugin or web application. Being a
pure Java program, SVNKit doesn't need any additional configuration or native
binaries to work on any OS that runs Java

This package contains javadoc for %{name}

%package cli
Group:         Development/Tools
Summary:       SVNKit Command Line Client
Requires:      %{name} = %{version}
Requires:      java-bsh2

%description cli
SVNKit provides its own command line client realization (like svn.exe). In fact,
it's a script file (specific for an OS) that invokes the main command driver class -
SVN (org.tmatesoft.svn.cli), the one which redirects parameters to an appropriate
command class (located in org.tmatesoft.svn.cli.command). Command classes use the
SVNKit API to perform an operation.

The SVNKit command line client supports all the most important commands which
svn.exe supports. Commands have got the same syntax (names, options) as svn.exe has.

%if %with_eclipse
%package -n eclipse-svnkit
Summary:        Eclipse feature for SVNKit
Group:          Development/Tools
Requires:       %{name} = %{version}
Requires:       eclipse-platform

%description -n eclipse-svnkit
Eclipse feature for SVNKit - Java Subversion client library.
%endif

%prep

%setup -q -n svnkit-src-%{version}.%{svn_rev}
# -a 1
#%patch0 -p1

for j in $(find . -name "*.jar"); do
 rm -rf $j
done

#for j in $(find . -name "*.bat"); do
# rm -rf $j
#done

pushd contrib
  ln -s /usr/share/java/svn-javahl.jar javahl
  ln -sf $(build-classpath jna) jna/jna.jar
  ln -sf $(build-classpath sqljet) sqljet/sqljet.jar
  ln -sf $(build-classpath trilead-ssh2) trilead/trilead.jar
  ln -sf $(build-classpath junit-3.8.2) junit/junit.jar
  ln -sf $(build-classpath antlr3-runtime) sqljet/antlr-runtime-3.1.3.jar
popd

sed -i 's|http://java.sun.com/j2se/1.4.2/docs/api/|%{_javadocdir}/java|' build.xml

# delete src packages for dependencies
rm contrib/trilead/trileadsrc.zip

sed -i 's/\r//' README.txt doc/javadoc/package-list
find doc/javadoc -name \*.html -exec sed -i 's/\r//' {} \;
# svntask 
%build

%if %with_eclipse
ECLIPSE_HOME=%{eclipse_base} ant build-library build-cli build-eclipse build-doc
%else
export CLASSPATH=$(build-classpath junit-3.8.2 svn-javahl jna trilead-ssh2)
ant build-library build-cli build-doc test-java
%endif

%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_javadir}
install -m 644 build/lib/svnkit.jar \
 %{buildroot}%{_javadir}/svnkit-%{version}.jar
install -m 644 build/lib/svnkit-javahl.jar \
 %{buildroot}%{_javadir}/svnkit-javahl-%{version}.jar
install -m 644 build/lib/svnkit-cli.jar \
 %{buildroot}%{_javadir}/svnkit-cli-%{version}.jar

(
  cd %{buildroot}%{_javadir}
  for jar in *-%{version}*; do
    ln -sf ${jar} ${jar/-%{version}/}
  done
)

mkdir -p %{buildroot}%{_javadocdir}/svnkit-%{version}
cp -pr build/doc/javadoc/* %{buildroot}%{_javadocdir}/svnkit-%{version}

%if %with_eclipse
mkdir -p %{buildroot}%{svnkit_dropins}
cp -R build/eclipse/features %{buildroot}%{svnkit_dropins}

# extracting plugin jars
mkdir %{buildroot}%{svnkit_plugins}
unzip build/eclipse/site/plugins/%{jna_plugin_name}.jar -d %{buildroot}%{jna_plugin_dir}
unzip build/eclipse/site/plugins/%{core_plugin_name}.jar -d %{buildroot}%{core_plugin_dir}

rm -f %{buildroot}%{jna_plugin_dir}/jna.jar
rm -fR %{buildroot}%{jna_plugin_dir}/com
rm -f %{buildroot}%{core_plugin_dir}/{svnkitsrc.zip,trilead.jar,svnkit.jar,svnkit-javahl.jar,sqljet.1.0.3.jar,antlr-runtime-3.1.3.jar}

ln -s %{_javadir}/svn-javahl.jar %{buildroot}%{core_plugin_dir}
ln -s %{_javadir}/trilead-ssh2.jar %{buildroot}%{core_plugin_dir}/trilead.jar
ln -s %{_javadir}/svnkit.jar %{buildroot}%{core_plugin_dir}
ln -s %{_javadir}/svnkit-javahl.jar %{buildroot}%{core_plugin_dir}
ln -s %{_javadir}/jna.jar %{buildroot}%{jna_plugin_dir}
ln -s %{_javadir}/sqljet.jar %{buildroot}%{core_plugin_dir}/sqljet.1.0.3.jar
ln -s %{_javadir}/antlr3-runtime.jar %{buildroot}%{core_plugin_dir}/antlr-runtime-3.1.3.jar
ln -s %{_javadir}/antlr3.jar %{buildroot}%{core_plugin_dir}/antlr-3.1.3.jar
%endif

mkdir -p %{buildroot}%{_datadir}/svnkit-%{version}

install -pm 644 build/lib/logging.properties.disabled %{buildroot}%{_datadir}/svnkit-%{version}/logging.properties
install -pm 644 build/lib/jsvnsetup.openvms %{buildroot}%{_datadir}/svnkit-%{version}/jsvnsetup.openvms

mkdir -p %{buildroot}%{_bindir}
install -pm 755  %{S:2} %{buildroot}%{_bindir}/jsvn
install -pm 755  %{S:3} %{buildroot}%{_bindir}/jsvnadmin
install -pm 755  %{S:4} %{buildroot}%{_bindir}/jsvndumpfilter
install -pm 755  %{S:5} %{buildroot}%{_bindir}/jsvnlook
install -pm 755  %{S:6} %{buildroot}%{_bindir}/jsvnsync
install -pm 755  %{S:7} %{buildroot}%{_bindir}/jsvnversion

sed -i "s|__SVN_KIT_HOME__|%{_datadir}/svnkit-%{version}|" $(find %{buildroot}%{_bindir} -name "jsvn*")

%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

%files
%defattr(-,root,root)
%{_javadir}/svnkit-%{version}.jar
%{_javadir}/svnkit.jar
%{_javadir}/svnkit-javahl-%{version}.jar
%{_javadir}/svnkit-javahl.jar
%doc README.txt changelog.txt

%files cli
%defattr(-,root,root)
%{_bindir}/jsvn*
%dir %{_datadir}/svnkit-%{version}
%{_datadir}/svnkit-%{version}/logging.properties
%{_datadir}/svnkit-%{version}/jsvnsetup.openvms
%{_javadir}/svnkit-cli-%{version}.jar
%{_javadir}/svnkit-cli.jar
%doc build/lib/*.txt

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/svnkit-%{version}

%if %with_eclipse
%files -n eclipse-svnkit
%defattr(-,root,root)
%{_datadir}/eclipse/dropins/svnkit
%endif

%changelog
* Sun Jan 09 2011 gil <puntogil@...> 1.3.4-1mamba
- update to 1.3.5

* Thu Nov 04 2010 gil <puntogil@...> 1.3.0-2mamba
- rebuilt devel

* Wed Jul 29 2009 gil <puntogil@...> 1.3.0-1mamba
- update to 1.3.0
- added sub package cli (... and scripts)

* Fri Apr 10 2009 gil <puntogil@...> 1.2.3-1mamba
- package created by autospec