aelfred/aelfred.spec

104 lines
2.9 KiB
RPMSpec

#
# spec file for package aelfred
#
# Copyright (c) 2014 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/
#
Name: aelfred
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: java-devel
BuildRequires: javapackages-tools
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%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
Summary: Java-based XML parser (documentation)
Group: Development/Libraries/Java
%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}
cp -a ../HTML/* %{buildroot}%{_javadocdir}/%{name}
# data
mkdir -p %{buildroot}%{_datadir}/%{name}/Demo
cp -a *.class %{buildroot}%{_datadir}/%{name}/Demo
%files
%defattr(0644,root,root,0755)
%doc README.txt FILES
%{_javadir}/*
%dir %{_datadir}/%{name}
%files javadoc
%defattr(0644,root,root,0755)
%dir %{_javadocdir}/%{name}
%{_javadocdir}/%{name}/*
%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}/Demo
%changelog