Build the daemon with full relro

This commit is contained in:
Honza Horák 2012-11-30 14:26:17 +01:00
parent 81e93d1073
commit 806d86bd80

View File

@ -1,7 +1,7 @@
Summary: Client for sending messages to a host's logged in users
Name: rwall
Version: 0.17
Release: 37%{?dist}
Release: 38%{?dist}
License: BSD
Url: ftp://ftp.linux.org.uk/pub/linux/Networking/netkit/
Group: System Environment/Daemons
@ -49,28 +49,21 @@ from users on remote hosts.
%patch3 -p1 -b .netgroup
%patch4 -p1 -b .droppriv
%{__perl} -pi -e '
s|^LDFLAGS=|LDFLAGS="-pie -Wl,-z,relro,-z,now"|;
s,^BINDIR=.*$,BINDIR=%{_bindir},;
s,^MANDIR=.*$,MANDIR=%{_mandir},;
s,^SBINDIR=.*$,SBINDIR=%{_sbindir},;
' configure
%build
sh configure --with-c-compiler=gcc
%ifarch s390 s390x
%{__perl} -pi -e '
s,^CC=.*$,CC=cc,;
s,-O2,\$(RPM_OPT_FLAGS) -fPIC,;
s,^LDFLAGS=,LDFLAGS=-pie,;
s,^BINDIR=.*$,BINDIR=%{_bindir},;
s,^MANDIR=.*$,MANDIR=%{_mandir},;
s,^SBINDIR=.*$,SBINDIR=%{_sbindir},;
' MCONFIG
CFLAGS="$RPM_OPT_FLAGS -fPIC" \
%else
%{__perl} -pi -e '
s,^CC=.*$,CC=cc,;
s,-O2,\$(RPM_OPT_FLAGS) -fpic,;
s,^LDFLAGS=,LDFLAGS=-pie,;
s,^BINDIR=.*$,BINDIR=%{_bindir},;
s,^MANDIR=.*$,MANDIR=%{_mandir},;
s,^SBINDIR=.*$,SBINDIR=%{_sbindir},;
' MCONFIG
CFLAGS="$RPM_OPT_FLAGS -fpic" \
%endif
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
sh configure --with-c-compiler=gcc
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
%install
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
@ -110,6 +103,9 @@ install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_unitdir}/
%{_unitdir}/*
%changelog
* Fri Nov 30 2012 Honza Horak <hhorak@redhat.com> - 0.17-38
- Build the daemon with full relro
* Thu Oct 04 2012 Honza Horak <hhorak@redhat.com> - 0.17-37
- Run %%triggerun regardless of systemd_post variable definition