fix multilib issue with config.h

This commit is contained in:
Tom Callaway 2012-02-21 13:41:23 -05:00
parent 7eb42454b0
commit 5703ce4239
2 changed files with 38 additions and 1 deletions

18
config.h Normal file
View File

@ -0,0 +1,18 @@
/* This file is here to prevent a file conflict on multiarch systems. A
* conflict will frequently occur because arch-specific build-time
* configuration options are stored (and used, so they can't just be stripped
* out) in config.h. The original config.h has been renamed.
* DO NOT INCLUDE THE NEW FILE DIRECTLY -- ALWAYS INCLUDE THIS ONE INSTEAD. */
#ifdef srtp_multilib_redirection_h
#error "Do not define srtp_multilib_redirection_h!"
#endif
#define srtp_multilib_redirection_h
#if defined(__x86_64__) || defined(__ppc64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__s390x__)
#include "srtp/config-64.h"
#else
#include "srtp/config-32.h"
#endif
#undef srtp_multilib_redirection_h

View File

@ -3,7 +3,7 @@
Name: lib%{shortname}
Version: 1.4.4
Release: 3.%{cvsver}%{?dist}
Release: 4.%{cvsver}%{?dist}
Summary: An implementation of the Secure Real-time Transport Protocol (SRTP)
Group: System Environment/Libraries
License: BSD
@ -14,6 +14,9 @@ URL: http://srtp.sourceforge.net
Source0: %{shortname}-%{version}-%{cvsver}.tar.bz2
# Pkgconfig goodness
Source1: libsrtp.pc
# Universal config.h
Source2: config.h
# Seriously. Who doesn't do shared libs these days?
# And how does Chromium always manage to find these projects and use them?
Patch0: libsrtp-1.4.4-shared.patch
@ -40,6 +43,12 @@ developing applications that use %{name}.
# Fix end-of-line encoding
sed -i 's/\r//g' doc/draft-irtf-cfrg-icm-00.txt
%if 0%{?rhel} > 0
%ifarch ppc64
sed -i 's/-z noexecstack//' Makefile.in
%endif
%endif
%build
export CFLAGS="%{optflags} -fPIC"
%configure --disable-static
@ -61,6 +70,10 @@ sed -i "s|@PREFIX@|%{_prefix}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc
sed -i "s|@LIBDIR@|%{_libdir}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc
sed -i "s|@INCLUDEDIR@|%{_includedir}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc
# Handle multilib issues with config.h
mv %{buildroot}%{_includedir}/%{shortname}/config.h %{buildroot}%{_includedir}/%{shortname}/config-%{__isa_bits}.h
cp -a %{SOURCE2} %{buildroot}%{_includedir}/%{shortname}/config.h
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -76,11 +89,17 @@ sed -i "s|@INCLUDEDIR@|%{_includedir}|g" %{buildroot}%{_libdir}/pkgconfig/libsrt
%{_libdir}/*.so
%changelog
* Tue Feb 21 2012 Tom Callaway <spot@fedoraproject.org> - 1.4.4-4.20101004cvs
- handle config.h multilib (bz787537)
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.4-3.20101004cvs
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.4-2.20101004cvs
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Jan 25 2011 Jeffrey C. Ollie <jeff@ocjtech.us>
- Don't use '-z noexecstack' option for linker on PPC64 (EL6)
* Mon Oct 4 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 1.4.4-1.20101004cvs
- initial package