Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #15454: Fixes to allow building the agent on Fedora 30 #2025

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rudder-agent/SOURCES/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ install-cfengine: build-cfengine $(INSTALL_DEPS) rudder.8.gz
# Install cfengine manpages
mkdir -p $(DESTDIR)/opt/rudder/share/man/man8
cd $(DESTDIR)/opt/rudder/bin && for binary in cf-agent cf-promises cf-key cf-execd cf-serverd cf-monitord cf-net cf-runagent; do \
LD_LIBRARY_PATH="$(DESTDIR)/opt/rudder/lib" $${binary}/$${binary} -M | gzip > $(DESTDIR)/opt/rudder/share/man/man8/$${binary}.8.gz; \
LD_LIBRARY_PATH="$(DESTDIR)/opt/rudder/lib" ./$${binary} -M | gzip > $(DESTDIR)/opt/rudder/share/man/man8/$${binary}.8.gz; \
done
cd $(DESTDIR)/opt/rudder && rm -rf share/doc/cfengine

Expand Down
24 changes: 11 additions & 13 deletions rudder-agent/SPECS/rudder-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# Default to use PIE code if possible
%define use_pie true

%if 0%{?rhel} == 8
%if 0%{?rhel} == 8 || 0%{?fedora}
# https://pagure.io/packaging-committee/issue/738
%define __brp_mangle_shebangs /usr/bin/true
%endif
Expand Down Expand Up @@ -92,7 +92,7 @@
%define use_pie false
%endif

# 2 - RHEL
# 2 - RHEL & Fedora
%if 0%{?rhel} && 0%{?rhel} == 3
# no PCRE on RHEL3
%define use_system_pcre false
Expand All @@ -110,6 +110,11 @@
%define use_pie false
%endif

%if 0%{?fedora}
%define use_system_curl true
%define use_system_openssl true
%endif

# 3 - SUSE
# Reference for suse_version : https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
%if 0%{?suse_version} && 0%{?suse_version} < 1200
Expand Down Expand Up @@ -173,12 +178,12 @@ Requires: syslog

## Requirement for cpanminus
# rh 6,7
%if 0%{?rhel} && 0%{?rhel} >= 6
%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} >= 6)
BuildRequires: perl-IPC-Cmd
%endif

# rhel perl core is too minimal, we try to not add too much here
%if 0%{?rhel} && 0%{?rhel} >= 7
%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} >= 7)
Requires: perl-Digest
BuildRequires: perl-Digest
%endif
Expand All @@ -196,21 +201,14 @@ Requires: cron net-tools

# dmiecode is provided in the "dmidecode" package on EL4+ and on kernel-utils
# on EL3
%if 0%{?rhel} && 0%{?rhel} >= 4
%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} >= 4)
Requires: dmidecode
%endif

%if 0%{?rhel} && 0%{?rhel} < 4
Requires: kernel-utils
%endif

# dmidecode is provided by "dmidecode" too on Fedora platforms, but I'm adding
# another if block to prevent cluttering the conditions on the >= el4 one and
# prevent possible unwanted non-matches.
%if 0%{?fedora}
Requires: dmidecode
%endif

# https fails on old distro because they don't support modern certificates (namely rhel3, aix5, sles10 and sles11)
%define use_https true
%if 0%{?rhel} && 0%{?rhel} < 6
Expand Down Expand Up @@ -347,7 +345,7 @@ make install DESTDIR=%{buildroot} USE_SYSTEM_OPENSSL=%{use_system_openssl} BUILD
rm -rf %{buildroot}/opt/rudder/man %{buildroot}/opt/rudder/lib/perl5/5.22.0/pod

# strip binaries
find %{buildroot}/opt/rudder/bin -type f | xargs file -i | grep -E "application/x-sharedlib|application/x-executable" | awk -F: '{print $1}' | xargs strip
find %{buildroot}/opt/rudder/bin -type f | xargs file -i | grep -E "application/x-sharedlib|application/x-executable|application/x-pie-executable" | awk -F: '{print $1}' | xargs strip

# Build a list of files to include in this package for use in the %files section below
find %{buildroot} -type f -o -type l | sed "s,%{buildroot},," | sed "s,\.py$,\.py*," | grep -v "%{rudderdir}/etc/uuid.hive" | grep -v "/etc/bash_completion.d" | grep -v "%{ruddervardir}/cfengine-community/ppkeys" > %{_builddir}/file.list.%{name}
Expand Down