Files
openhtmltopdf-cli/openhtmltopdf-cli.spec

79 lines
2.4 KiB
RPMSpec

#
# spec file for package openhtmltopdf-cli
#
# 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 gh_version 1.0.10-1
Name: openhtmltopdf-cli
Version: 1.0.10.1
Release: 0
Summary: A CLI for converting HTML files to PDF documents
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://github.com/danfickle/%{name}
Source0: %{url}/archive/refs/tags/%{name}-%{gh_version}.tar.gz
Source1: openhtmltopdf.pod
BuildRequires: fdupes
BuildRequires: maven-local
BuildRequires: mvn(com.openhtmltopdf:openhtmltopdf-pdfbox)
BuildRequires: mvn(info.picocli:picocli)
BuildRequires: mvn(org.jsoup:jsoup)
BuildArch: noarch
%description
This is a CLI for converting HTML files to PDF documents. Under the hood it
uses the openhtmltopdf library.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
API documentation for %{name}.
%prep
%setup -q -n %{name}-%{name}-%{gh_version}
%pom_remove_plugin :maven-shade-plugin
%{mvn_file} : openhtmltopdf/%{name}
%build
%{mvn_build} -f -- \
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)
pod2man --release='%{name} %{version}' --section=1 --center='User Commands' --quotes=none %{SOURCE1} openhtmltopdf.1
%install
%mvn_install
%fdupes %{buildroot}%{_javadocdir}/%{name}
%jpackage_script com.openhtmltopdf.cli.App "" "" openhtmltopdf:picocli:jsoup:pdfbox:pdfbox-graphics2d:apache-commons-logging openhtmltopdf true
install -dm0755 %{buildroot}%{_mandir}/man1
install -Dm0644 openhtmltopdf.1 %{buildroot}%{_mandir}/man1
%files -f .mfiles
%license LICENSE
%doc README.md
%{_bindir}/openhtmltopdf
%{_mandir}/man1/openhtmltopdf.1%{?ext_man}
%files javadoc -f .mfiles-javadoc
%license LICENSE
%changelog