File kawa.spec of Package kawa
#
# spec file for package kawa
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%{!?make_build:%global make_build make %{?_smp_mflags}}
Name: kawa
Version: 3.1.1
Release: 0
Summary: An implementation of Scheme for the Java platform
License: X11
Group: Development/Libraries/Java
URL: https://www.gnu.org/software/kawa/
Source0: ftp://ftp.gnu.org/pub/gnu/kawa/%{name}-%{version}.tar.gz
Source1: https://repo1.maven.org/maven2/com/github/arvyy/%{name}/%{version}/%{name}-%{version}.pom
Source10: %{name}-logo-64x64.png
Patch0: kawa-jdk17.patch
Patch1: no-return-in-nonvoid-function.patch
Patch2: reproducible-jar-mtime.patch
BuildRequires: ant
BuildRequires: docbook5-xsl-stylesheets
BuildRequires: eclipse-swt
BuildRequires: fdupes
BuildRequires: glassfish-servlet-api
BuildRequires: google-gson
BuildRequires: java-devel >= 1.8
BuildRequires: java-javadoc
BuildRequires: javapackages-local >= 6
BuildRequires: libxslt-tools
BuildRequires: texinfo
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
BuildArch: noarch
%description
Kawa is a programming language for the Java platform. It is an implementation
of Scheme, which, is in the Lisp family of programming languages. Kawa has many
useful features, including convenient integration with Java. It can be used as
a “scripting language”, but includes a compiler and all the benefits of a
“real” programming language, including optional static typing, so Kawa programs
can be as efficient as Java.
%if 0%{?suse_version} > 1320
%package doc
Summary: Documentation for %{name}
Group: Documentation/HTML
%description doc
This package contains the documentation for %{name}.
%endif
%package javadoc
Summary: API documentation for %{name}
Group: Development/Libraries/Java
%description javadoc
API documentation for %{name}.
%prep
%setup -q
%patch -P 0 -p1
%patch -P 1 -p1
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 17}%{!?pkg_vcmp:0}
%patch -P 2 -p1
%endif
%configure \
--disable-maintainer-mode \
--with-httpserver \
--with-javax.script \
--enable-xquery \
--with-swt=$(find-jar swt) \
--with-gson=$(find-jar google-gson/gson) \
%{nil}
%build
%make_build -j1
javadoc -encoding UTF-8 \
-source 8 \
-d apidocs \
-use \
-sourcepath . \
-cp $(build-classpath ant swt glassfish-servlet-api) \
-link file://%{_javadocdir}/java \
-Xdoclint:none \
-notimestamp \
gnu.brl \
gnu.ecmascript \
gnu.expr \
gnu.kawa.ant \
gnu.kawa.brl \
gnu.kawa.functions \
gnu.kawa.lispexpr \
gnu.kawa.models \
gnu.kawa.reflect \
gnu.kawa.sax \
gnu.kawa.servlet \
gnu.kawa.swingviews \
gnu.kawa.swtviews \
gnu.kawa.util \
gnu.kawa.xml \
gnu.kawa.xslt \
gnu.lists \
gnu.mapping \
gnu.math \
gnu.text \
gnu.xml \
gnu.xquery.lang \
gnu.xquery.util \
kawa.lang \
kawa.standard \
gnu.bytecode \
%{nil}
#gnu.jemacs.lang \
#gnu.jemacs.buffer \
#gnu.jemacs.swing \
#gnu.jemacs.swt \
#gnu.kawa.echo2 \
#kawa \
#gnu.commonlisp.lang \
#gnu.q2.lang \
#gnu.kawa.android \
#gnu.kawa.javafx
%if 0%{?suse_version} > 1320
rm -f doc/texinfo.tex
%make_build html pdf
%make_build -Cdoc kawa.html
%endif
%install
# jar
install -dm 0755 %{buildroot}%{_javadir}/%{name}
install -pm 0644 lib/%{name}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar
install -dm 0755 %{buildroot}%{_datadir}/%{name}
ln -s %{_javadir}/%{name} %{buildroot}%{_datadir}/%{name}/lib
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
%{mvn_install_pom} %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom
%add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar
#javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes %{buildroot}%{_javadocdir}/%{name}
# Manual pages
install -Dm0644 doc/%{name}.man %{buildroot}%{_mandir}/man1/%{name}.1
install -Dm0644 doc/qexo.man %{buildroot}%{_mandir}/man1/qexo.1
%if 0%{?suse_version} > 1320
# Manual
install -dm0755 %{buildroot}%{_defaultdocdir}/%{name}/html
cp -pr doc/kawa.html/* %{buildroot}%{_defaultdocdir}/%{name}/html
install -pm0644 doc/%{name}.pdf %{buildroot}%{_defaultdocdir}/%{name}
%endif
# Info pages
install -dm0755 %{buildroot}%{_infodir}
install -Dm0644 doc/%{name}.info* %{buildroot}%{_infodir}/
# Icon
install -Dm0644 %{SOURCE10} %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
# Scripts
install -dm0755 %{buildroot}%{_datadir}/%{name}/bin
install -pm0755 bin/{%{name},qexo} %{buildroot}%{_datadir}/%{name}/bin
install -dm0755 %{buildroot}%{_bindir}
ln -s %{_datadir}/%{name}/bin/{%{name},qexo} %{buildroot}%{_bindir}
%post
# touch to force icon cache update
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
##%%{info_add} %%{name}.info
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%postun
# touch to force icon cache update
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%posttrans
%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files -f .mfiles
%doc AUTHORS NEWS TODO doc/ChangeLog doc/scm2java.html
%license COPYING
%{_bindir}/*
%{_mandir}/man1/*
%{_datadir}/%{name}
%{_datadir}/icons/hicolor/*
%{_infodir}/*
%files javadoc
%{_javadocdir}/%{name}
%license COPYING
%if 0%{?suse_version} > 1320
%files doc
%{_defaultdocdir}/%{name}/html
%{_defaultdocdir}/%{name}/%{name}.pdf
%endif
%changelog