patch for ElectricFence

Reynes Philippe <[email protected]> Mon, 6 Jun 2005 01:27:04 +0200 (CEST)
Newsgroups gmane.linux.mandrake.cooker.amd64
Message-ID <[email protected]>
Hi

I've seen that ElectricFence don't compile
on cooker x86_64. I've written a little patch.

What do you think about it ? 

trem



	

	
		
_____________________________________________________________________________ 
Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vidéos ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com
ElectricFence.spec.patch (text/x-patch, 2 KB)
--- ElectricFence.spec	2005-01-24 19:36:30.000000000 +0100
+++ ElectricFence.spec.new	2005-06-06 01:21:15.000000000 +0200
@@ -1,17 +1,16 @@
 %define name	ElectricFence
 %define version	2.2.2
-%define release	5mdk
+%define release	6mdk
 
 %define lib_major	0
 %define lib_name_orig	%mklibname efence
 %define lib_name	%mklibname efence %{lib_major}
 
-
 Summary:	A debugger which detects memory allocation violations
 Name:		%{name}
 Version:	%{version}
 Release:	%{release}
-ExclusiveArch:	%{ix86} sparc ppc
+ExclusiveArch:	%{ix86} sparc ppc x86_64
 License:	GPL
 Group:		Development/Other
 Source:		ftp://ftp.ecrc.net/pub/netsw/System/Libs/Memory/Debug/%{name}-%{version}.tar.bz2
@@ -60,8 +59,19 @@ This package contains the static library
 %patch2 -p1 -b .vaarg
 
 %build
+
+%ifarch x86_64
+# fix the lib path on the Makefile for amd64 (lib -> lib64)
+perl -pi -e 's|/lib|/lib64|' Makefile
+%endif
+
+%ifarch x86_64
+# on x86_64 USE_SEMAPHORE generate an error on sem_init
+%make CFLAGS="$RPM_OPT_FLAGS -fPIC"
+%else
 # (gb) supposedly thread-safe when compiled with USE_SEMAPHORE
 %make CFLAGS="$RPM_OPT_FLAGS -DUSE_SEMAPHORE -fPIC"
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -71,7 +81,7 @@ install -d -m 755 $RPM_BUILD_ROOT%{_libd
 install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man3
 
 %makeinstall MAN_INSTALL_DIR=$RPM_BUILD_ROOT%{_mandir}/man3
-chmod a+x $RPM_BUILD_ROOT%{_libdir}/libefence.so*
+chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
 echo ".so man3/efence.3" > $RPM_BUILD_ROOT%{_mandir}/man3/libefence.3
 
 %clean
@@ -90,15 +100,17 @@ rm -rf $RPM_BUILD_ROOT
 %files -n %{lib_name}
 %defattr(-,root,root)
 %doc CHANGES
-%_libdir/libefence.so.0
-%_libdir/libefence.so.0.0
+%_libdir/*.0
 
 %files -n %{lib_name}-devel
 %defattr(-,root,root)
-%_libdir/libefence.a
-%_libdir/libefence.so
+%_libdir/*.a
+%_libdir/*.so
 
 %changelog
+* Sun Jun 06 2005 trem <[email protected]> 2.2.2-6mdk
+- fix build for amd64
+
 * Mon Jan 24 2005 Olivier Thauvin <[email protected]> 2.2.2-5mdk
 - move man page from -devel to main package because:
    - no requires on main package, so it's broken