#6 Adapt the specflie for EPEL 8
Merged 2 years ago by omos. Opened 2 years ago by omos.
rpms/ omos/quazip wip-epel8  into  rawhide

file modified
+81 -19
@@ -1,5 +1,17 @@ 

  %undefine __cmake_in_source_build

  

+ %if 0%{?rhel}

+ # EPEL - only Qt5 packages

+ %bcond_with	qt4

+ %bcond_without	qt5

+ %bcond_with	qt6

+ %else

+ # Fedora - build everything

+ %bcond_without	qt4

+ %bcond_without	qt5

+ %bcond_without	qt6

+ %endif

+ 

  %bcond_without test

  

  Name:		quazip
@@ -11,12 +23,19 @@ 

  Source0:	%{url}/archive/v%{version}/%{name}-v%{version}.tar.gz

  # pre-1.0 compat CMake module

  Source1:	FindQuaZip.cmake

- BuildRequires: 	cmake

- BuildRequires: 	gcc-c++

+ BuildRequires:	cmake

+ BuildRequires:	gcc-c++

+ BuildRequires:	zlib-devel

+ %if %{with qt4}

  BuildRequires:	qt4-devel

+ %endif

+ %if %{with qt5}

  BuildRequires:	qt5-qtbase-devel

+ %endif

+ %if %{with qt6}

  BuildRequires:	qt6-qtbase-devel

  BuildRequires:	qt6-qt5compat-devel

+ %endif

  BuildRequires:	doxygen graphviz

  

  
@@ -31,16 +50,20 @@ 

  QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both reading

  from and writing to ZIP archives.

  

+ 

+ %if %{with qt4}

  %package devel

- Summary:		Development files for %{name}

- Requires:		%{name}%{?_isa} = %{version}-%{release}

- Requires:		qt4-devel%{?_isa}

- Requires:		zlib-devel%{?_isa}

+ Summary:	Development files for %{name}

+ Requires:	%{name}%{?_isa} = %{version}-%{release}

+ Requires:	qt4-devel%{?_isa}

+ Requires:	zlib-devel%{?_isa}

  

  %description devel

  The %{name}-devel package contains libraries, header files and documentation

  for developing applications that use %{name}. 

+ %endif

  

+ %if %{with qt5}

  %package qt5

  Summary: Qt5 wrapper for the minizip library

  %description qt5
@@ -55,15 +78,17 @@ 

  from and writing to ZIP archives.

  

  %package qt5-devel

- Summary:		Development files for %{name}

- Requires:		%{name}-qt5%{?_isa} = %{version}-%{release}

- Requires:		qt5-qtbase-devel%{?_isa}

- Requires:		zlib-devel%{?_isa}

+ Summary:	Development files for %{name}-qt5

+ Requires:	%{name}-qt5%{?_isa} = %{version}-%{release}

+ Requires:	qt5-qtbase-devel%{?_isa}

+ Requires:	zlib-devel%{?_isa}

  

  %description qt5-devel

  The %{name}-qt5-devel package contains libraries, header files and documentation

- for developing applications that use %{name}.

+ for developing applications that use %{name}-qt5.

+ %endif

  

+ %if %{with qt6}

  %package qt6

  Summary: Qt6 wrapper for the minizip library

  %description qt6
@@ -78,32 +103,39 @@ 

  from and writing to ZIP archives.

  

  %package qt6-devel

- Summary:		Development files for %{name}

- Requires:		%{name}-qt6%{?_isa} = %{version}-%{release}

- Requires:		qt6-qtbase-devel%{?_isa}

- Requires:		qt6-qt5compat-devel%{?_isa}

- Requires:		zlib-devel%{?_isa}

+ Summary:	Development files for %{name}-qt6

+ Requires:	%{name}-qt6%{?_isa} = %{version}-%{release}

+ Requires:	qt6-qtbase-devel%{?_isa}

+ Requires:	qt6-qt5compat-devel%{?_isa}

+ Requires:	zlib-devel%{?_isa}

  

  %description qt6-devel

  The %{name}-qt6-devel package contains libraries, header files and documentation

- for developing applications that use %{name}.

+ for developing applications that use %{name}-qt6.

+ %endif

  

  

  %prep

  %autosetup -p1

  

  %build

+ %if %{with qt4}

  %global _vpath_builddir build-qt4

  %cmake -DQUAZIP_QT_MAJOR_VERSION=4

  %cmake_build

+ %endif

  

+ %if %{with qt5}

  %global _vpath_builddir build-qt5

  %cmake -DQUAZIP_QT_MAJOR_VERSION=5

  %cmake_build

+ %endif

  

+ %if %{with qt6}

  %global _vpath_builddir build-qt6

  %cmake -DQUAZIP_QT_MAJOR_VERSION=6

  %cmake_build

+ %endif

  

  doxygen Doxyfile

  for file in doc/html/*; do
@@ -111,12 +143,20 @@ 

  done

  

  %install

+ %if %{with qt4}

  %global _vpath_builddir build-qt4

  %cmake_install

+ %endif

+ 

+ %if %{with qt5}

  %global _vpath_builddir build-qt5

  %cmake_install

+ %endif

+ 

+ %if %{with qt6}

  %global _vpath_builddir build-qt6

  %cmake_install

+ %endif

  

  # Create compat symlinks/files so that packages that use the old (pre-1.0)

  # library location, include paths, or CMake module still build against the
@@ -125,8 +165,8 @@ 

  #

  # These symlinks should probably be removed once all dependent packages are

  # switched to use the new pkgconfig or CMake modules.

+ %if %{with qt4}

  ln -s libquazip1-qt4.so %{buildroot}%{_libdir}/libquazip.so

- ln -s libquazip1-qt5.so %{buildroot}%{_libdir}/libquazip5.so

  

  install -d %{buildroot}%{_includedir}/quazip

  pushd %{buildroot}%{_includedir}/QuaZip-Qt4-1.1/quazip
@@ -135,6 +175,13 @@ 

  done

  popd

  

+ install -d %{buildroot}%{_datadir}/cmake/Modules

+ install -pm 0644 %{SOURCE1} %{buildroot}%{_datadir}/cmake/Modules/FindQuaZip.cmake

+ %endif

+ 

+ %if %{with qt5}

+ ln -s libquazip1-qt5.so %{buildroot}%{_libdir}/libquazip5.so

+ 

  install -d %{buildroot}%{_includedir}/quazip5

  pushd %{buildroot}%{_includedir}/QuaZip-Qt5-1.1/quazip

  for f in *; do
@@ -143,8 +190,9 @@ 

  popd

  

  install -d %{buildroot}%{_datadir}/cmake/Modules

- install -pm 0644 %{SOURCE1} %{buildroot}%{_datadir}/cmake/Modules/FindQuaZip.cmake

  install -pm 0644 %{SOURCE1} %{buildroot}%{_datadir}/cmake/Modules/FindQuaZip5.cmake

+ %endif

+ 

  

  %if %{with test}

  %check
@@ -158,16 +206,25 @@ 

  # test failures.

  export QT_ENABLE_REGEXP_JIT=0

  

+ %if %{with qt4}

  %global _vpath_builddir build-qt4

  %cmake_build -t check

+ %endif

+ 

+ %if %{with qt5}

  %global _vpath_builddir build-qt5

  %cmake_build -t check

+ %endif

+ 

+ %if %{with qt6}

  %global _vpath_builddir build-qt6

  %cmake_build -t check

  %endif

+ %endif

  

  %ldconfig_scriptlets

  

+ %if %{with qt4}

  %files

  %doc NEWS.txt README.md

  %license COPYING
@@ -183,7 +240,9 @@ 

  %{_includedir}/quazip/

  %{_libdir}/libquazip.so

  %{_datadir}/cmake/Modules/FindQuaZip.cmake

+ %endif

  

+ %if %{with qt5}

  %files qt5

  %doc NEWS.txt README.md

  %license COPYING
@@ -199,7 +258,9 @@ 

  %{_includedir}/quazip5/

  %{_libdir}/libquazip5.so

  %{_datadir}/cmake/Modules/FindQuaZip5.cmake

+ %endif

  

+ %if %{with qt6}

  %files qt6

  %doc NEWS.txt README.md

  %license COPYING
@@ -213,6 +274,7 @@ 

  # qt6-qtbase-devel currently doesn't provide pkgconfig(Qt6Core)

  # https://bugreports.qt.io/browse/QTBUG-86080

  %exclude %{_libdir}/pkgconfig/quazip1-qt6.pc

+ %endif

  

  

  %changelog

The gist is to add conditionals for individual Qt versions and enable only the Qt5 subpackages in EPEL (which only has Qt5).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1754155

Cc @germano

Pull-Request has been merged by omos

2 years ago
Metadata