File aelfred.spec of Package aelfred

# spec file for package aelfred (Version 1.2)
# 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

# norootforbuild

%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}

Name:           aelfred
%define name		aelfred
%define version		1.2
%define release		0.a.7jpp
%define section		free
Version:        1.2
Release:        266
Summary:        Java-based XML parser
License:        BSD 3-Clause
Patch0:         aelfred-icedtea-build.patch
Group:          Development/Libraries/Java
BuildRequires:  ant
BuildRequires:  jpackage-utils >= 1.6
%if ! %{gcj_support}
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %defined suse_version
BuildRequires:  java-devel
BuildRequires:  unzip
%if %{gcj_support}
BuildRequires:  gnu-crypto
BuildRequires:  java-gcj-compat-devel
Requires(post):   java-gcj-compat
Requires(postun): java-gcj-compat

AElfred is a Java-based XML parser from Microstar Software Ltd. AElfred
is distributed for free (with full source) for both commercial and
non-commercial use.

%package javadoc
License:        BSD 3-Clause
PreReq:         coreutils
Summary:        Java-based XML parser (documentation)
Group:          Development/Libraries/Java
Requires(post):   /bin/rm,/bin/ln
Requires(postun): /bin/rm

%description javadoc
Javadoc for aelfred.

%package demo
License:        BSD 3-Clause
Summary:        Java-based XML parser (demo and samples)
Requires:       %{name} = %{version}-%{release}
Group:          Development/Libraries/Java

%description demo
Demonstrations and samples for aelfred.

%setup -q -c
# remove all binary libs
find . -name "*.jar" -exec %__rm -f {} \;
find . -name "*.class" -exec %__rm -f {} \;
%__rm -rf HTML/*
%patch0 -b .sav

export JAVA_HOME=%{java_home}
export PATH=%{java_home}/bin:$PATH
cd src
%javac -source 1.4 `find . -name \*.java`
%javadoc -source 1.4 -d ../HTML `find . -name \*.java`

# jar
export JAVA_HOME=%{java_home}
cd src
%__mkdir_p %{buildroot}%{_javadir}
%jar cvmf /dev/null %{name}.jar -C . com/
%__cp -a %{name}.jar \
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do \
%__ln_s ${jar} ${jar/-%{version}/}; done)
# javadoc
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
%__cp -a ../HTML/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-%{version} %{name})
# data
%__mkdir_p %{buildroot}%{_datadir}/%{name}/Demo
%__cp -a *.class %{buildroot}%{_datadir}/%{name}/Demo
%if %{gcj_support}
export CLASSPATH=$(build-classpath gnu-crypto)

%__rm -rf %{buildroot}

%post javadoc
%__rm -f %{_javadocdir}/%{name}
%__ln_s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ $1 -eq 0 ]; then
  %__rm -f %{_javadocdir}/%{name}
%if %{gcj_support}

if [ -x %{_bindir}/rebuild-gcj-db ]
%if %{gcj_support}

if [ -x %{_bindir}/rebuild-gcj-db ]

%dir %{_datadir}/%{name}
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*

%files javadoc
%dir %{_javadocdir}/%{name}-%{version}
%ghost %dir %{_javadocdir}/%{name}

%files demo

* Mon Mar 03 2008
- merged with jpackage 1.7
- allow to build with icedtea
* Fri Mar 30 2007
- add unzip to BuildRequires
* Wed Jan 25 2006
- converted neededforbuild to BuildRequires
* Wed Oct 19 2005
- Current version 1.2 from
openSUSE Build Service is sponsored by