File ini4j.spec of Package ini4j

#
# spec file for package ini4j (Version 0.5.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:           ini4j
Version:        0.5.1
Release:        2
Summary:        Java API for handling Windows ini file format
License:        The Apache Software License
Url:            http://www.ini4j.org/
Group:          Development/Libraries/Java
# wget http://switch.dl.sourceforge.net/sourceforge/ini4j/%{name}-%{version}-all.zip
# unzip -q *zip
# cd ini4j-0.5.1/
# fastjar -cf ini4j-0.5.1-sources
# mkdir src; mv META-INF org src/
# tar -cjf ../ini4j-0.5.1-sources.tar.bz2 src/ LICENSE.txt NOTICE.txt
Source0:        %{name}-%{version}-sources.tar.bz2
Source1:        %{name}-%{version}.build.xml
Source2:        %{name}-%{version}.buildinfo.properties
#Patch0:		ini4j-build.patch
BuildRequires:  jpackage-utils >= 1.6
BuildRequires:  ant
BuildRequires:  ant-nodeps
BuildRequires:  ant-junit
BuildRequires:  unzip
BuildRequires:  java-devel
BuildRequires:  fdupes
Requires:       java
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The [ini4j] is a simple Java API for handling configuration files in
Windows .ini format. Additionally, the library includes Java
Preferences API implementation based on the .ini file.



%package javadoc
License:        The Apache Software License
Summary:        Java API for handling Windows ini file format
Group:          Development/Libraries/Java
Requires(post):   /bin/rm,/bin/ln
Requires(postun): /bin/rm

%description javadoc
The [ini4j] is a simple Java API for handling configuration files in
Windows .ini format. Additionally, the library includes Java
Preferences API implementation based on the .ini file.



%prep
%setup -q -c -n %{name}-%{version}
# remove all binary libs
find . -name "*.jar" -exec %{__rm} -f {} \;
cp %{SOURCE1} build.xml
mkdir -p src/etc
cp %{SOURCE2} src/etc/buildinfo.properties
#%patch0

%build
[ -z "$JAVA_HOME" ] && export JAVA_HOME=%{_jvmdir}/java 
ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 build
ant javadoc

%install
# jar
%{__install} -d -m 755 %{buildroot}%{_javadir}
%{__install} -m 644 dist/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%{__ln_s} %{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
# javadoc
%{__install} -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__cp} -pr build/doc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && ln -sf %{name}-%{version} %{name})
%fdupes -s %{buildroot}/%{_javadocdir}/%{name}-%{version}

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc  LICENSE.txt NOTICE.txt
%{_javadir}/*

%files javadoc
%defattr(-,root,root)
%dir %{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}/*
%{_javadocdir}/%{name}

%changelog
* Wed May 06 2009 mvyskocil@suse.cz
- Initial SUSE packaging of 0.5.1 (using Mandriva spec)
openSUSE Build Service is sponsored by