pdfsam/pdfsam.spec
wangtaozhi 0b3507cf74 Package init
- 初始化提交
2023-05-26 15:04:55 +08:00

91 lines
2.7 KiB
RPMSpec

#
# spec file for package pdfsam
#
# Copyright (c) 2022 UnitedRPMs.
#
# 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://goo.gl/zqFJft
#
%global _iconsdir %{_datadir}/icons
%global _javadir %{_datadir}/java
Name: pdfsam
Version: 4.2.12
Release: 1
Summary: PDF Split and Merge enhanced
Group: Applications/Publishing
License: GPLv3
URL: https://pdfsam.org/
Source0: https://github.com/torakiki/%{name}/releases/download/v%{version}/%{name}-%{version}-linux.tar.gz
Source1: pdfsam
Source2: pdfsam.png
Source3: org.pdfsam.pdfsam.metainfo.xml
BuildArch: noarch
BuildRequires: gendesk
Requires: java-11-openjdk
%description
PDFsam is a simple, platform independent software designed to split and merge
pdf files. It's stable, completely free and it should cover most of your
needs.
%prep
%autosetup -n %{name}-%{version}-linux
%build
# create *.desktop file
gendesk -f -n \
--pkgname="%{name}" \
--pkgdesc="A free open source tool to split and merge pdf documents" \
--name="PDFsam" \
--categories="Office"
%install
install -dm755 "$RPM_BUILD_ROOT/usr/share/java/%{name}/lib"
install -Dm644 "pdfsam-basic-%{version}.jar" \
"$RPM_BUILD_ROOT/usr/share/java/%{name}/"
install -Dm644 lib/* \
"$RPM_BUILD_ROOT/usr/share/java/%{name}/lib"
install -Dm755 "bin/pdfsam.sh" \
"$RPM_BUILD_ROOT/usr/share/java/%{name}/bin/pdfsam.sh"
# exec
install -Dm755 %{S:1} "$RPM_BUILD_ROOT/usr/bin/pdfsam"
# desktop
install -Dm644 %{S:2} "$RPM_BUILD_ROOT/usr/share/pixmaps/pdfsam.png"
install -Dm644 "%{name}.desktop" "$RPM_BUILD_ROOT/usr/share/applications/%{name}.desktop"
# Appdata
install -Dm 0644 %{S:3} %{buildroot}/%{_metainfodir}/org.pdfsam.pdfsam.metainfo.xml
# mangling shebang fix
sed -i 's|/bin/sh|/usr/bin/sh|g' %{buildroot}/%{_datadir}/java/pdfsam/bin/pdfsam.sh
%files
%license LICENSE.txt
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_metainfodir}/org.pdfsam.pdfsam.metainfo.xml
%{_datadir}/pixmaps/%{name}.png
%{_javadir}/%{name}/
%changelog
* Fri May 26 2023 wangtaozhi <wangtaozhi@kylinsec.com.cn> - 4.2.12-1
- Package init