[packages/kImageAnnotator] - rework packaging to make building mutually exclusive packages possible, rel 4

baggins baggins at pld-linux.org
Fri Oct 10 22:52:53 CEST 2025


commit 367bca1bf4d1e2d1fbf664ef9dd198ccd560a569
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Oct 11 00:52:00 2025 +0200

    - rework packaging to make building mutually exclusive packages possible, rel 4

 kImageAnnotator.spec | 64 +++++++++++++++++++++++++---------------------------
 1 file changed, 31 insertions(+), 33 deletions(-)
---
diff --git a/kImageAnnotator.spec b/kImageAnnotator.spec
index 37ce45a..90e042b 100644
--- a/kImageAnnotator.spec
+++ b/kImageAnnotator.spec
@@ -3,13 +3,15 @@
 %bcond_with	tests		# build with tests
 %bcond_with	qt5		# build with qt5 version
 %bcond_without	qt6		# build without qt6 version
+#
+%define		pname	kImageAnnotator
 Summary:	Tool for annotating images
-Name:		kImageAnnotator
+Name:		%{pname}%{?with_qt5:-qt5}%{?with_qt6:-qt6}
 Version:	0.7.1
-Release:	3
+Release:	4
 License:	LGPL 3.0
 Group:		X11/Libraries
-Source0:	https://github.com/ksnip/kImageAnnotator/archive/v%{version}/%{name}-%{version}.tar.gz
+Source0:	https://github.com/ksnip/kImageAnnotator/archive/v%{version}/%{pname}-%{version}.tar.gz
 # Source0-md5:	68990dfe7fe03f1aff5e0e5338b9f3bb
 URL:		https://github.com/ksnip/kImageAnnotator/
 BuildRequires:	cmake >= 3.20
@@ -20,54 +22,46 @@ BuildRequires:	pkgconfig
 BuildRequires:	rpmbuild(macros) >= 1.164
 BuildRequires:	tar >= 1:1.22
 BuildRequires:	zlib-devel
+%if %{with qt5}
+Obsoletes:	%{name} < 0.7.1
+Conflicts:	%{name}-qt6
+%endif
+%if %{with qt6}
+Conflicts:	%{name}-qt5
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
 Tool for annotating images.
 
-%package qt5
-Summary:	Tool for annotating images
-Obsoletes:	%{name} < 0.7.1
-Conflicts:	%{name}-qt6
-
-%description qt5
-Tool for annotating images. Qt5 version.
-
-%package qt5-devel
+%package -n %{pname}-qt5-devel
 Summary:	Header files for %{name}-qt5 development
 Summary(pl.UTF-8):	Pliki nagłówkowe dla programistów używających %{name}-qt5
 Group:		X11/Development/Libraries
 Requires:	%{name}-qt5 = %{version}-%{release}
 Requires:	cmake >= 3.20
 
-%description qt5-devel
+%description -n %{pname}-qt5-devel
 Header files for %{name}-qt5 development.
 
-%description qt5-devel -l pl.UTF-8
+%description -n %{pname}-qt5-devel -l pl.UTF-8
 Pliki nagłówkowe dla programistów używających %{name}-qt5.
 
-%package qt6
-Summary:	Tool for annotating images
-Conflicts:	%{name}-qt5
-
-%description qt6
-Tool for annotating images. Qt6 version.
-
-%package qt6-devel
+%package -n %{pname}-qt6-devel
 Summary:	Header files for %{name}-qt6 development
 Summary(pl.UTF-8):	Pliki nagłówkowe dla programistów używających %{name}-qt6
 Group:		X11/Development/Libraries
 Requires:	%{name}-qt6 = %{version}-%{release}
 Requires:	cmake >= 3.20
 
-%description qt6-devel
+%description -n %{pname}-qt6-devel
 Header files for %{name}-qt6 development.
 
-%description qt6-devel -l pl.UTF-8
+%description -n %{pname}-qt6-devel -l pl.UTF-8
 Pliki nagłówkowe dla programistów używających %{name}-qt6.
 
 %prep
-%setup -q
+%setup -q -n %{pname}-%{version}
 
 %build
 %if %{with qt5}
@@ -111,21 +105,25 @@ rm -rf $RPM_BUILD_ROOT
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post	qt5 -p /sbin/ldconfig
-%postun	qt5 -p /sbin/ldconfig
+%if %{with qt5}
+%post	-n %{pname}-qt5 -p /sbin/ldconfig
+%postun	-n %{pname}-qt5 -p /sbin/ldconfig
+%endif
 
-%post	qt6 -p /sbin/ldconfig
-%postun	qt6 -p /sbin/ldconfig
+%if %{with qt6}
+%post	-n %{pname}-qt6 -p /sbin/ldconfig
+%postun	-n %{pname}-qt6 -p /sbin/ldconfig
+%endif
 
 %if %{with qt5}
-%files qt5 -f %{name}.lang
+%files -n %{pname}-qt5 -f %{name}.lang
 %defattr(644,root,root,755)
 %dir %{_datadir}/kImageAnnotator
 %dir %{_datadir}/kImageAnnotator/translations
 %ghost %{_libdir}/libkImageAnnotator.so.0
 %attr(755,root,root) %{_libdir}/libkImageAnnotator.so.*.*
 
-%files qt5-devel
+%files -n %{pname}-qt5-devel
 %defattr(644,root,root,755)
 %{_includedir}/kImageAnnotator-Qt5
 %{_libdir}/cmake/kImageAnnotator-Qt5
@@ -133,14 +131,14 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %if %{with qt6}
-%files qt6 -f %{name}.lang
+%files -n %{pname}-qt6 -f %{name}.lang
 %defattr(644,root,root,755)
 %dir %{_datadir}/kImageAnnotator
 %dir %{_datadir}/kImageAnnotator/translations
 %ghost %{_libdir}/libkImageAnnotator.so.0
 %attr(755,root,root) %{_libdir}/libkImageAnnotator.so.*.*
 
-%files qt6-devel
+%files -n %{pname}-qt6-devel
 %defattr(644,root,root,755)
 %{_includedir}/kImageAnnotator-Qt6
 %{_libdir}/cmake/kImageAnnotator-Qt6
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kImageAnnotator.git/commitdiff/367bca1bf4d1e2d1fbf664ef9dd198ccd560a569



More information about the pld-cvs-commit mailing list