File ical4j.spec of Package ical4j

#
# spec file for "ical4j"
#
# Copyright (c) 2020 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 http://bugs.opensuse.org/
#

Name:           ical4j
Version:        3.0.18
Release:        1
License:        BSD-3-Clause
Summary:        A Java library for parsing and building iCalendar data models
Url:            https://github.com/ical4j/ical4j
Group:          Development/Libraries/Java
Source0:        https://github.com/ical4j/ical4j/archive/ical4j-3.0.18.tar.gz
Source1:        build.sh
Source2:        %{name}.pom
Patch0:         001-remove-clover-license.patch
Patch1:         002-errorprone-2.4.0.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
ExcludeArch:    aarch64 ppc64le s390x
BuildRequires:  xz
BuildRequires:  java-devel
BuildRequires:  javapackages-local
BuildRequires:  ical4j-kit == c285d0c91f57e109c1c0613ca58ba748a15b30fb
%if 0%{?rhel}
BuildRequires:  java-11-openjdk-devel
%endif
Requires:       java

%description
A Java library for parsing and building iCalendar data models

%package doc
Summary: Javadoc package for ical4j
%description doc
Javadoc package for ical4j

%prep
%setup -q -c -n src
%patch0 -p0
%patch1 -p2
cp -f %{SOURCE1} .
cp -f %{SOURCE2} pom.xml
cp -Rf %{_libdir}/tetra ../kit

%build
cd ..
sh src/build.sh

%install
# export NO_BRP_CHECK_BYTECODE_VERSION=true
mkdir -p %{buildroot}%{_javadir}
cp -a ical4j-ical4j-3.0.18/build/libs/ical4j-0.1.0-SNAPSHOT-javadoc.jar %{buildroot}%{_javadir}/ical4j-%{version}-javadoc.jar
cp -a ical4j-ical4j-3.0.18/build/libs/ical4j-0.1.0-SNAPSHOT.jar %{buildroot}%{_javadir}/ical4j-%{version}.jar
ln -sf ical4j-%{version}.jar %{buildroot}%{_javadir}/ical4j.jar

# Maven metadata
install -d -m 0755 %{buildroot}/%{_mavenpomdir}/
%{mvn_install_pom} pom.xml %{buildroot}/%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar

%files -f .mfiles
%defattr(-,root,root)
%{_javadir}/ical4j-%{version}.jar
%{_javadir}/ical4j.jar

%files doc
%defattr(-,root,root)
%{_javadir}/ical4j-%{version}-javadoc.jar

%changelog
openSUSE Build Service is sponsored by