diff options
author | John Thacker <johnthacker@gmail.com> | 2022-01-17 00:35:50 -0500 |
---|---|---|
committer | John Thacker <johnthacker@gmail.com> | 2022-01-17 00:56:16 -0500 |
commit | 1d0fb38d387ba3705088396994485d7cb9779e14 (patch) | |
tree | dcf7c61560f939c74190e0551d1ae1c659611581 /packaging | |
parent | a65abbc2bbfc0ee019cc44c169245dd3b68f67be (diff) |
rpm: Fix up paths
Fedora and SUSE 15 use out of source builds by default, but store
the build directory in differently named macros. Define one macro
for the build directory that has the appropriate value (which will
be "." for any distribution that doesn't have either macro, and
thus presumably does in-source builds.) This fixes building and
installing the guides with any of the supported distributions.
Also, since RHEL/CentOS 7 doesn't have a special CMake macro, it
needs to set the install prefix when calling cmake.
Also, fix a comment warning by escaping the percent sign.
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/rpm/wireshark.spec.in | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packaging/rpm/wireshark.spec.in b/packaging/rpm/wireshark.spec.in index be38a25c47..f814411cf4 100644 --- a/packaging/rpm/wireshark.spec.in +++ b/packaging/rpm/wireshark.spec.in @@ -273,6 +273,7 @@ development of Wireshark scripts and plugins. # https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild %if 0%{?rhel} && ( 0%{?rhel} <= 7 ) cmake3 \ + -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \ %else %if 0%{?el8} cmake \ @@ -353,6 +354,13 @@ cmake \ -DENABLE_OPUS=OFF \ %endif +# Fedora and SUSE 15 do out of source builds by default, but they store +# the build directory in different macros. Older distributions don't define +# that macro at all. Let's make it so that one macro contains the build +# directory (which will be "." for any distribution that doesn't define +# either macro, and thus presumably does in-source builds.) +%{?!__cmake_builddir: %global __cmake_builddir %{?__builddir}%{!?__builddir:.}} + %if %{with ninja} %if 0%{?fedora} || ( 0%{?suse_version} && 0%{?sle_version} >= 150200 ) %cmake_build @@ -378,11 +386,7 @@ cd build %ninja_install %endif %if %{with 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 +%ninja_install install_guides -C %{__cmake_builddir} %endif %else make DESTDIR=$RPM_BUILD_ROOT install -C %{__cmake_builddir} @@ -455,7 +459,7 @@ update-mime-database %{_datadir}/mime &> /dev/null || : # Include the User Guide: %if %{with guides} %docdir %{_datadir}/doc/wireshark/ -# HTML manuals are installed to %{_datadir}/wireshark because that is +# HTML manuals are installed to %%{_datadir}/wireshark because that is # where Wireshark's Help menu expects to launch them from. %exclude %{_datadir}/doc/wireshark/*.html %{_datadir}/doc/wireshark/ |