File epublib.spec of Package epublib
#
# spec file for package epublib
#
# Copyright (c) 2023 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/
#
%global git_hash 4936fd9
%global git_date 20210503
Name: epublib
Version: 4.0+git%{git_date}.%{git_hash}
Release: 0
Summary: A java library for reading and writing epub files
License: LGPL-3.0 AND CC-BY-3.0
Group: Development/Libraries/Java
URL: http://www.siegmann.nl/%{name}
Source0: https://github.com/psiegman/%{name}/tarball/%{git_hash}#/%{name}-%{version}.tar.gz
Source1: https://www.gnu.org/licenses/lgpl-3.0.txt
Source2: https://creativecommons.org/licenses/by/3.0/legalcode.txt
Patch0: 00-htmlcleaner-2.29.patch
BuildRequires: fdupes
BuildRequires: maven-local
BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin)
BuildRequires: mvn(net.sf.kxml:kxml2)
BuildRequires: mvn(org.apache.commons:commons-vfs)
BuildRequires: mvn(commons-lang:commons-lang)
BuildRequires: mvn(net.sourceforge.htmlcleaner:htmlcleaner)
BuildArch: noarch
%description
Epublib is a java library for reading/writing/manipulating epub files.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
API documentation for %{name}.
%prep
%setup -q -n psiegman-%{name}-%{git_hash}
%patch0 -p1
cp %{SOURCE1} .
cp %{SOURCE2} .
%pom_remove_plugin :maven-source-plugin %{name}-parent
%pom_remove_plugin :maven-javadoc-plugin %{name}-parent
%pom_remove_plugin com.jolira:onejar-maven-plugin %{name}-tools
%pom_change_dep xmlpull:xmlpull xpp3:xpp3 %{name}-{core,tools}
%pom_change_dep commons-vfs:commons-vfs org.apache.commons:commons-vfs %{name}-tools
%build
%{mvn_build} -f -- \
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \
-D{source,target}.version=8 \
-f %{name}-parent
%install
%mvn_install
%fdupes %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%license CREDITS lgpl-3.0.txt legalcode.txt
%doc README.md
%files javadoc -f .mfiles-javadoc
%license CREDITS lgpl-3.0.txt legalcode.txt
%changelog