Name: peazip
Summary: File archiver utility
License: LGPL-3.0-only
Version: 10.5.0
Release: 1%{?dist}
URL: https://peazip.github.io
Source0: https://github.com/peazip/PeaZip/releases/download/%{version}/peazip-%{version}.src.zip
# Change file search paths to match packaging
Patch0: %{name}--paths.patch
# Change "are we on ARM?" check guarding asm code to "are we not on x86?"
Patch1: %{name}--asm.patch
BuildRequires: fpc
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: lazarus-tools
# Set to 0 (or remove) to disable a particular build.
%global ws_gtk2 1
%global ws_gtk3 1
%global ws_qt5 1
%global ws_qt6 1
ExclusiveArch: %{fpc_arches}
%global desc %{expand:
PeaZip is fully-featured, user-friendly file archiver utility,
supporting over 180 archive formats. It also contains a powerful and complete
file manager for viewing, browsing and searching archive files.}
%description %{desc}
# -- Subpackages start
%package common
Summary: Data files for PeaZip
BuildArch: noarch
Requires: hicolor-icon-theme
# PeaZip tries to serve as a universal archive manipulation GUI.
# As such, it relies on external programs for handling some archive formats.
Recommends: %{_bindir}/7z
Recommends: %{_bindir}/arc
Recommends: %{_bindir}/brotli
Recommends: %{_bindir}/upx
Recommends: %{_bindir}/unrar-free
Recommends: %{_bindir}/zpaq
Recommends: %{_bindir}/zstd
# Can't recommend these since they're not in the official Fedora repos
# Recommends: %%{_bindir}/unace
%description common
This package provides common data files (icons, translations, etc.)
used by the PeaZip file archiving utility.
# -- Widgetset subpackages start
%if 0%{?ws_gtk2}
%package gtk2
Summary: File archiver utility (GTK2 version)
BuildRequires: lazarus-lcl-gtk2
RemovePathPostfixes: .gtk2
Conflicts: %{name}-gtk3
Conflicts: %{name}-qt5
Conflicts: %{name}-qt6
Requires: %{name}-common = %{version}-%{release}
%description gtk2 %{desc}
This package provides a GTK2 build of the program.
%endif
%if 0%{?ws_gtk3}
%package gtk3
Summary: File archiver utility (GTK3 version)
BuildRequires: lazarus-lcl-gtk3
RemovePathPostfixes: .gtk3
Conflicts: %{name}-gtk2
Conflicts: %{name}-qt5
Conflicts: %{name}-qt6
Requires: %{name}-common = %{version}-%{release}
%description gtk3 %{desc}
This package provides a GTK3 build of the program.
%endif
%if 0%{?ws_qt5}
%package qt5
Summary: File archiver utility (Qt version)
BuildRequires: lazarus-lcl-qt5
RemovePathPostfixes: .qt5
Conflicts: %{name}-gtk2
Conflicts: %{name}-gtk3
Conflicts: %{name}-qt6
Requires: %{name}-common = %{version}-%{release}
%description qt5 %{desc}
This package provides a Qt5 build of the program.
%endif
%if 0%{?ws_qt6}
%package qt6
Summary: File archiver utility (Qt6 version)
BuildRequires: lazarus-lcl-qt6
RemovePathPostfixes: .qt6
Conflicts: %{name}-gtk2
Conflicts: %{name}-gtk3
Conflicts: %{name}-qt5
Requires: %{name}-common = %{version}-%{release}
%description qt6 %{desc}
This package provides a Qt6 build of the program.
%endif
# -- Subpackages end
%global widgetsets %{expand: \\
%if 0%{?ws_gtk2}
gtk2 \\
%endif
%if 0%{?ws_gtk3}
gtk3 \\
%endif
%if 0%{?ws_qt5}
qt5 \\
%endif
%if 0%{?ws_qt6}
qt6 \\
%endif
}
%prep
%autosetup -p1 -n %{name}-%{version}.src
# Patch the project configuration files to enable debuginfo generation
for PROJECT in dev/project_pea.lpi dev/project_peach.lpi; do
sed \
-e 's|||g' \
-e 's|||g' \
-i "${PROJECT}"
done
# Remove unused files
mv res/share/batch/freedesktop_integration/peazip.desktop ./
rm -rf res/share/batch/
rm -rf res/share/copying/third-parties
find res/bin -name '*.txt' -delete
rm res/portable
%build
lazbuild \
--add-package dev/metadarkstyle/metadarkstyle.lpk
for WIDGETSET in %{widgetsets}; do
lazbuild \
--widgetset="${WIDGETSET}" \
--lazarusdir="%{_libdir}/lazarus" \
-B dev/project_pea.lpi dev/project_peach.lpi
mv ./dev/pea "./pea.${WIDGETSET}"
mv ./dev/peazip "./peazip.${WIDGETSET}"
done
%install
install -m 755 -d %{buildroot}%{_bindir}
for WIDGETSET in %{widgetsets}; do
install -m 755 "./pea.${WIDGETSET}" %{buildroot}%{_bindir}/
install -m 755 "./peazip.${WIDGETSET}" %{buildroot}%{_bindir}/
done
install -m 755 -d %{buildroot}%{_datadir}/
cp -a res %{buildroot}%{_datadir}/
mv %{buildroot}%{_datadir}/res %{buildroot}%{_datadir}/%{name}
# Create symlinks to external programs.
# This could be patched in the source code, but doing it like this is easier.
function link_binary() {
SRC_NAME="$1"
DST_DIR="$2"
DST_NAME="$3"
DST_DIR="%{buildroot}%{_datadir}/%{name}/bin/${DST_DIR}"
mkdir -m 755 -p "${DST_DIR}"
ln -srf "%{buildroot}%{_bindir}/${SRC_NAME}" "${DST_DIR}/${DST_NAME}"
}
link_binary 7z 7z 7z
link_binary arc arc arc
link_binary brotli brotli brotli
link_binary upx upx upx
link_binary unrar-free unrar unrar
link_binary zpaq zpaq zpaq
link_binary zstd zstd zstd
install -m 755 -d %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
ln -srf \
%{buildroot}%{_datadir}/%{name}/share/icons/peazip.png \
%{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
install -m 755 -d %{buildroot}%{_datadir}/applications/
desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ %{name}.desktop
%files gtk2
%{_bindir}/pea.gtk2
%{_bindir}/peazip.gtk2
%{_datadir}/applications/%{name}.desktop
%files gtk3
%{_bindir}/pea.gtk3
%{_bindir}/peazip.gtk3
%{_datadir}/applications/%{name}.desktop
%files qt5
%{_bindir}/pea.qt5
%{_bindir}/peazip.qt5
%{_datadir}/applications/%{name}.desktop
%files qt6
%{_bindir}/pea.qt6
%{_bindir}/peazip.qt6
%{_datadir}/applications/%{name}.desktop
%files common
%license %{_datadir}/%{name}/share/copying/copying.txt
%{_datadir}/%{name}/
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%changelog
* Tue Aug 05 2025 Artur Frenszek-Iwicki - 10.5.0-1
- Update to v10.5.0
* Thu Aug 10 2023 Artur Frenszek-Iwicki - 9.3.0-2
- Update to v9.3.0
- Migrate License tag to SPDX
* Sat Jul 25 2020 Artur Iwicki 7.3.2-1
- Initial packaging