File xml-im-exporter.spec of Package xml-im-exporter

#
# spec file for package xml-im-exporter (Version 1.1)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define section free

Name:           xml-im-exporter
Version:        1.1
Release:        2
Summary:        XML Im-/Exporter
License:        LGPL v2.0 or later
Url:            http://xml-im-exporter.sourceforge.net/
Group:          Development/Libraries/Java
Source0:        xml-im-exporter1.1.tar.bz2
Source1:        http://mirrors.ibiblio.org/pub/mirrors/maven2/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom
Patch0:         xml-im-exporter-build_xml.patch
BuildRequires:  jpackage-utils >= 1.6
BuildRequires:  ant >= 1.6
BuildRequires:  ant-junit
BuildRequires:  junit
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
XML Im-/Exporter is a low level library to assist you in the straight
forward process of importing and exporting XML from and to your Java
classes. All of this is designed having performance and simplicity in
mind.



%package javadoc
License:        LGPL v2.0 or later
Summary:        XML Im-/Exporter
Group:          Development/Libraries/Java

%description javadoc
XML Im-/Exporter is a low level library to assist you in the straight
forward process of importing and exporting XML from and to your Java
classes. All of this is designed having performance and simplicity in
mind.



%prep
%setup -q -n %{name}
# remove all binary libs
find . -name "*.jar" | xargs rm
#for j in $(find . -name "*.jar"); do
#    mv $j $j.no
#done
# wrong end of line encoding
sed -i -e 's/.$//' *.txt doc/javadoc/stylesheet.css doc/javadoc/package-list
%patch0 -b .sav

%build
export CLASSPATH=
export OPT_JAT_LIST="junit ant/ant-junit"
ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 jar test javadocs

%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 build/lib/%{name}%{version}.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr doc/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# maven
%add_to_maven_depmap de.zeigermann.xml %{name} %{version} JPP %{name}
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.pom

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(0644,root,root,0755)
%doc doc/index.html *.txt
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
%{_datadir}/maven2/poms/*
%config %{_mavendepmapfragdir}/*

%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}

%changelog
* Fri May 15 2009 mvyskocil@suse.cz
- 'Initial SUSE packaging'
openSUSE Build Service is sponsored by