aelfred/aelfred.spec

164 lines
4.2 KiB
RPMSpec

#
# spec file for package aelfred
#
# Copyright (c) 2013 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 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: 0
Summary: Java-based XML parser
License: BSD-3-Clause
Group: Development/Libraries/Java
Url: http://www.jpackage.org/
Source0: http://card4u.fhnon.de/XMLKlassen/microstar-Parser/aelfred.zip
Patch0: aelfred-icedtea-build.patch
BuildRequires: ant
BuildRequires: jpackage-utils >= 1.6
%if ! %{gcj_support}
BuildArch: noarch
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %defined suse_version
BuildRequires: java-devel
BuildRequires: unzip
%endif
%if %{gcj_support}
BuildRequires: gnu-crypto
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
%description
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
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
Summary: Java-based XML parser (demo and samples)
Group: Development/Libraries/Java
Requires: %{name} = %{version}-%{release}
%description demo
Demonstrations and samples for aelfred.
%prep
%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
%build
export JAVA_HOME=%{java_home}
export PATH=%{java_home}/bin:$PATH
export CLASSPATH=
cd src
%javac -source 1.4 `find . -name \*.java`
%javadoc -source 1.4 -d ../HTML `find . -name \*.java`
%install
# jar
export JAVA_HOME=%{java_home}
cd src
%__mkdir_p %{buildroot}%{_javadir}
%jar cvmf /dev/null %{name}.jar -C . com/
%__cp -a %{name}.jar \
%{buildroot}%{_javadir}/%{name}-%{version}.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)
%{_bindir}/aot-compile-rpm
%endif
%post javadoc
%__rm -f %{_javadocdir}/%{name}
%__ln_s %{name}-%{version} %{_javadocdir}/%{name}
%postun javadoc
if [ $1 -eq 0 ]; then
%__rm -f %{_javadocdir}/%{name}
fi
%if %{gcj_support}
%post
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%if %{gcj_support}
%postun
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%files
%defattr(0644,root,root,0755)
%doc README.txt FILES
%{_javadir}/*
%dir %{_datadir}/%{name}
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif
%files javadoc
%defattr(0644,root,root,0755)
%dir %{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}/*
%ghost %{_javadocdir}/%{name}
%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}/Demo
%changelog