RPM+CI: Update and fix for Fedora 33, CentOS 8, OpenSUSE Leap 15.2

Re-enable Fedora build and add CentOS 8 and OpenSUSE 15.2 builds.
Fedora 33 does out of build tree cmake builds and needs spec file changes.
CentOS 8 has some changes with cmake and other packages that are similar to
older Fedora, and needs extra repositories enabled to get -devel packages
(still missing -devel for some optional libraries). OpenSUSE Leap 15.2 also
has some changes needed to build. Note that OpenSUSE Leap 15.1 is EOL
at the end of November 2020. Fixes #16971
This commit is contained in:
John Thacker 2020-10-31 07:14:18 -04:00
parent 57b6666920
commit ac34f3e8b6
3 changed files with 101 additions and 27 deletions

View File

@ -78,6 +78,32 @@ test:rpm-centos-7:
- build:rpm-centos-7
variables:
GIT_STRATEGY: none
build:rpm-centos-8:
<<: *build-rpm
image: centos:8
script:
- dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
- dnf -y install dnf-plugins-core
# PowerTools is the CentOS name for CodeReady, where -devel packages live
- dnf config-manager --enable PowerTools
# Devel is a CentOS repository with some extra -devel packages not (yet?) in RHEL
- dnf config-manager --enable Devel
- tools/rpm-setup.sh --install-optional -y
- mkdir build
- cd build
- cmake -GNinja ..
- ninja-build rpm-package
test:rpm-centos-8:
stage: test
image: centos:8
script:
- dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
- dnf --nogpgcheck localinstall -y build/packaging/rpm/RPMS/x86_64/*.rpm
- tshark --version
dependencies:
- build:rpm-centos-8
variables:
GIT_STRATEGY: none
build:rpm-opensuse-15.1:
image: opensuse/leap:15.1
<<: *build-rpm
@ -99,9 +125,28 @@ test:rpm-opensuse-15.1:
GIT_STRATEGY: none
dependencies:
- build:rpm-opensuse-15.1
# Disabled for now due to issues with Fedora 33.
.build:rpm-fedora:
build:rpm-opensuse-15.2:
image: opensuse/leap:15.2
<<: *build-rpm
script:
- zypper --non-interactive install update-desktop-files
- tools/rpm-setup.sh --install-optional ruby
- gem install asciidoctor -v 2.0.10 --no-ri --no-rdoc
- mkdir build
- cd build
- cmake -GNinja ..
- ninja rpm-package
test:rpm-opensuse-15.2:
image: opensuse/leap:15.2
stage: test
script:
- zypper --no-gpg-checks install -y build/packaging/rpm/RPMS/x86_64/*.rpm
- tshark --version
variables:
GIT_STRATEGY: none
dependencies:
- build:rpm-opensuse-15.2
build:rpm-fedora:
<<: *build-rpm
image: fedora
script:
@ -110,9 +155,8 @@ test:rpm-opensuse-15.1:
- mkdir build
- cd build
- cmake3 -GNinja ..
- ninja-build rpm-package
.test:rpm-fedora:
- ninja rpm-package
test:rpm-fedora:
image: fedora
stage: test
script:

View File

@ -50,7 +50,7 @@ Packager: Gerald Combs <gerald[AT]wireshark.org>
BuildRoot: /tmp/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?rhel}
%if 0%{?rhel} && ( 0%{?rhel} <= 7 )
BuildRequires: cmake3 >= 3.5
%else
BuildRequires: cmake >= 3.5
@ -112,7 +112,7 @@ Requires: c-ares
%endif
%if %{with lua}
%if 0%{?fedora}
%if 0%{?fedora} || ( 0%{?rhel} >= 8 )
BuildRequires: compat-lua-devel < 5.3
Requires: compat-lua < 5.3
%else
@ -226,7 +226,7 @@ Wireshark. A Qt graphical user interface is packaged separately.
%package qt
Summary: Wireshark's Qt-based GUI
Group: Applications/Internet
# XXX Fedora 33 requires versioned "Obsoletes" declarations.
# XXX Recent versions of rpm (Fedora 33 et al.) warn about unversioned "Obsoletes".
Obsoletes: wireshark-gnome wireshark-gtk
%description qt
This package contains the Qt Wireshark GUI and desktop integration files.
@ -280,22 +280,31 @@ development of Wireshark scripts and plugins.
# SUSE has a wrong bindir for cmake. Set it to the right one.
%if 0%{?suse_version}
%define _bindir /usr/bin
%if %{with ninja}
%define __builder %{_bindir}/ninja
%endif
%endif
# XXX How do we reliably run CMake for all of CentOS, Fedora, RHEL, and openSUSE?
# The percent-cmake macro in Fedora >= 33 runs
# /usr/bin/cmake -S . -B x86_64-redhat-linux-gnu
# which presumably means we need to use the cmake_build and cmake_install
# macros described at https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/
%if 0%{?rhel}
%define __ninja /usr/bin/ninja-build
%endif
# How do we reliably run CMake for all of CentOS, Fedora, RHEL, and openSUSE?
# https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/
# https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
# https://en.opensuse.org/openSUSE:Build_system_recipes#cmake
%if 0%{?rhel} && ( 0%{?rhel} <= 7 )
cmake3 \
%else
%if 0%{?el8}
cmake \
%else
%cmake \
%endif
%endif
%if %{with ccache}
-DENABLE_CCACHE=ON \
%endif
-DCMAKE_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ \
%if %{with qt5}
-DBUILD_wireshark=ON \
%else
@ -364,10 +373,11 @@ cmake3 \
%endif
%if %{with ninja}
# Older RPM-based distributions used ninja-build in order to prevent a collision with
# the Ninja IRC client: https://bugzilla.redhat.com/show_bug.cgi?id=1166135
NINJA=$(type ninja >/dev/null 2>&1 && echo ninja || echo ninja-build)
$NINJA
%if 0%{?fedora} || ( 0%{?suse_version} && 0%{?sle_version} >= 150200 )
%cmake_build
%else
%ninja_build
%endif
%else
# Suggestion: put this in your ~/.rpmmacros (without the hash sign, of course):
# %_smp_mflags -j %(grep -c processor /proc/cpuinfo)
@ -376,14 +386,22 @@ make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
%if 0%{?suse_version}
%if 0%{?suse_version} && 0%{?sle_version} <= 150100
cd build
%endif
%if %{with ninja}
NINJA=$(type ninja >/dev/null 2>&1 && echo ninja || echo ninja-build)
DESTDIR=$RPM_BUILD_ROOT $NINJA install
%if 0%{?fedora} || ( 0%{?suse_version} && 0%{?sle_version} >= 150200 )
%cmake_install
%else
%ninja_install
%endif
%if %{with guides}
DESTDIR=$RPM_BUILD_ROOT $NINJA install_guides
%if 0%{?fedora}
DESTDIR=$RPM_BUILD_ROOT %ninja_build install_guides -C %{__cmake_builddir}
%else
DESTDIR=$RPM_BUILD_ROOT %ninja_build install_guides
%endif
%endif
%else
make DESTDIR=$RPM_BUILD_ROOT install
@ -391,7 +409,8 @@ make DESTDIR=$RPM_BUILD_ROOT install
make DESTDIR=$RPM_BUILD_ROOT install_guides
%endif
%endif
%if 0%{?suse_version}
%if 0%{?suse_version} && 0%{?sle_version} <= 150100
cd -
%endif

View File

@ -57,8 +57,6 @@ ADDITIONAL_LIST="libcap-devel \
libssh-devel \
krb5-devel \
perl-Parse-Yapp \
sbc-devel \
libsmi-devel \
snappy-devel \
minizip-devel \
lz4 \
@ -126,7 +124,7 @@ add_package BASIC_LIST glib2 || add_package BASIC_LIST libglib-2_0-0 ||
echo "glib2 is unavailable" >&2
# lua51, lua51-devel: OpenSUSE Leap 42.3 (lua would be fine too, as it installs lua52), OpenSUSE Leap 15.0 (lua installs lua53, so it wouldn't work)
# compat-lua, compat-lua-devel: Fedora 28, Fedora 29
# compat-lua, compat-lua-devel: Fedora 28, Fedora 29, CentOS 8
# lua, lua-devel: CentOS 7
add_package BASIC_LIST lua51-devel || add_package BASIC_LIST compat-lua-devel || add_package BASIC_LIST lua-devel ||
echo "lua devel is unavailable" >&2
@ -225,6 +223,19 @@ echo "opus is unavailable" >&2
add_package ADDITIONAL_LIST bcg729-devel ||
echo "bcg729 is unavailable" >&2
# RHEL 8 / CentOS 8 are missing the -devel packages for sbc and libsmi due to
# RH deciding not to ship all -devel packages.
# https://wiki.centos.org/FAQ/CentOS8/UnshippedPackages
# There are CentOS bugs filed to add them to the Devel repository and eventually
# RHEL 8 CRB / CentOS PowerTools, but make them optional for now.
# https://bugs.centos.org/view.php?id=16504
# https://bugs.centos.org/view.php?id=17824
add_package ADDITIONAL_LIST sbc-devel ||
echo "sbc is unavailable"
add_package ADDITIONAL_LIST libsmi-devel ||
echo "libsmi is unavailable"
ACTUAL_LIST=$BASIC_LIST
# Now arrange for optional support libraries