File abcl.spec of Package abcl

#
# spec file for package abcl
#
# Copyright (c) 2022 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/
#


Name:           abcl
Version:        1.9.2
Release:        0
Summary:        Armed Bear Common Lisp
License:        GPL-2.0-only
Group:          Development/Languages/Other
URL:            https://common-lisp.net/project/armedbear/
Source0:        https://common-lisp.net/project/armedbear/releases/%{version}/%{name}-src-%{version}.tar.gz
Source1:        https://repo1.maven.org/maven2/org/%{name}/%{name}/%{version}/%{name}-%{version}.pom
Source2:        %{name}.pod
Patch0:         %{name}-no-hostname.patch
BuildRequires:  ant
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  java-devel >= 1.8
BuildRequires:  javapackages-local
BuildRequires:  texinfo
BuildRequires:  texlive-listings
BuildRequires:  xmvn-install
BuildRequires:  xmvn-resolve
BuildRequires:  mvn(org.sonatype.oss:oss-parent:pom:)
Requires:       java >= 1.8
Requires:       javapackages-tools
BuildArch:      noarch

%description
Armed Bear Common Lisp (ABCL) is a full implementation of the Common Lisp
language featuring both an interpreter and a compiler, running in the JVM.
Originally started to be a scripting language for the J editor, it now supports
JSR-223 (Java scripting API): it can be a scripting engine in any Java
application. Additionally, it can be used to implement (parts of) the
application using Java to Lisp integration APIs.

%if 0%{?suse_version} > 1320
%package doc
Summary:        Documentation for %{name}
Group:          Documentation/Other
BuildRequires:  texinfo
BuildRequires:  texlive-a4wide
BuildRequires:  texlive-changepage
BuildRequires:  tex(enumitem.sty)
BuildRequires:  tex(microtype.sty)

%description doc
This package contains the documentation for %{name}.
%endif

%package javadoc
Summary:        Javadocs for %{name}
Group:          Development/Languages/Java
Requires:       jpackage-utils

%description javadoc
This package contains the API documentation for %{name}.

%prep
%setup -q -n %{name}-src-%{version}
%patch -P 0 -p1
find examples -type f |xargs dos2unix
find -name \*.pdf -delete
cat <<__TEX__ >>doc/manual/abcl.sty
\usepackage[utf8]{inputenc}
\usepackage{microtype}
__TEX__
sed -e 's/__VERSION__/%{version}/' %{SOURCE2} >%{name}.pod

# Fix improper xsi:* and xmlns:* attributes
sed -i -e 's/="https:/="http:/g' %{SOURCE1} contrib/pom.xml

%{mvn_file} org.abcl:%{name} %{name}
%{mvn_file} org.abcl:%{name}-contrib %{name}-contrib

%build
JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 %{ant} \
	-Dabcl.build.incremental=1 \
	-Dant.build.javac.source=1.8 \
	-Dant.build.javac.target=1.8 \
%if 0%{?suse_version} > 1320
    abcl.documentation \
%endif
	abcl.jar abcl.javadoc

%install
%{mvn_artifact} %{SOURCE1} dist/%{name}.jar
%{mvn_artifact} contrib/pom.xml dist/%{name}-contrib.jar
%mvn_install -J build/javadoc
%fdupes %{buildroot}%{_javadocdir}/%{name}

%if 0%{?suse_version} > 1320
install -dm0755 %{buildroot}%{_defaultdocdir}/%{name}
cp -rf dist/*.pdf %{buildroot}%{_defaultdocdir}/%{name}
cp -rf examples %{buildroot}%{_defaultdocdir}/%{name}
%fdupes %{buildroot}/%{_defaultdocdir}/%{name}
%endif

%jpackage_script org.armedbear.lisp.Main "" "" %{name}:%{name}-contrib %{name} true

install -dm0755 %{buildroot}%{_mandir}/man1
pod2man --release '%{name} %{version}' --section 1 --center "User Commands" %{name}.pod %{buildroot}%{_mandir}/man1/%{name}.1

%files -f .mfiles
%license COPYING
%{_bindir}/%{name}
%{_mandir}/man1/*

%if 0%{?suse_version} > 1320
%files doc
%{_defaultdocdir}/%{name}
%license COPYING
%endif

%files javadoc -f .mfiles-javadoc
%license COPYING

%changelog
openSUSE Build Service is sponsored by