rpms/CGAL/devel CGAL.spec,1.13,1.14

Laurent Rineau (rineau) fedora-extras-commits at redhat.com
Sun Oct 21 22:30:22 UTC 2007


Author: rineau

Update of /cvs/pkgs/rpms/CGAL/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1163

Modified Files:
	CGAL.spec 
Log Message:
* Sun Oct 21 2007 Laurent Rineau <laurent.rineau__fedora at normalesup.org> - 3.3.1-3%{dist}
- gawk and coreutils are not required in BR (see exceptions list)
- fix multilib issues (bug #340821):
  - rename %{_datadir}/CGAL/cgal.mk to %{_datadir}/CGAL/cgal-%{_arch}.mk
  - remove the arch-specific comment from %{_includedir}/CGAL/compiler_config.h



Index: CGAL.spec
===================================================================
RCS file: /cvs/pkgs/rpms/CGAL/devel/CGAL.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- CGAL.spec	3 Sep 2007 20:25:22 -0000	1.13
+++ CGAL.spec	21 Oct 2007 22:29:50 -0000	1.14
@@ -2,7 +2,7 @@
 
 Name:           CGAL
 Version:        3.3.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Computational Geometry Algorithms Library
 
 Group:          System Environment/Libraries
@@ -27,12 +27,6 @@
 BuildRequires: mpfr-devel
 %endif
 
-# Required tools
-BuildRequires: gawk
-
-# for chmod in prep:
-BuildRequires: coreutils
-
 # CGAL-libs is renamed to CGAL.
 Obsoletes:     %{name}-libs < %{version}-%{release}
 Provides:      %{name}-libs = %{version}-%{release}
@@ -82,18 +76,20 @@
 
 
 # fix end-of-lines of several files
-sed -i 's/\r//' \
-    examples/Surface_mesh_parameterization/data/mask_cone.off \
-    examples/Boolean_set_operations_2/test.dxf
-
 for f in demo/Straight_skeleton_2/data/vertex_event_9.poly \
-         demo/Straight_skeleton_2/data/vertex_event_0.poly;
+         demo/Straight_skeleton_2/data/vertex_event_0.poly \
+         examples/Surface_mesh_parameterization/data/mask_cone.off \
+         examples/Boolean_set_operations_2/test.dxf;
 do
-  [ -r $f ] && sed -i 's/\r//' $f;
+  if [ -r $f ]; then
+    sed -i.bak 's/\r//' $f;
+    touch -r ${f}.bak $f
+    rm -f ${f}.bak
+  fi
 done
 
 # Install README.Fedora here, to include it in %doc
-install -m 644 %{SOURCE10} ./README.Fedora
+install -p -m 644 %{SOURCE10} ./README.Fedora
 
 %build
 
@@ -118,16 +114,27 @@
 %install
 rm -rf %{buildroot}
 
+case "%{_arch}" in
+        *64* | s390 )
+           SUFFIX=64 ;;
+        * )
+           SUFFIX=32 ;;
+esac
+
 # Install headers
 mkdir -p %{buildroot}%{_includedir}
 cp -a include/* %{buildroot}%{_includedir}
 rm -rf %{buildroot}%{_includedir}/CGAL/config/msvc*
-mv %{buildroot}%{_includedir}/CGAL/config/*/CGAL/compiler_config.h %{buildroot}%{_includedir}/CGAL/
+mv %{buildroot}%{_includedir}/CGAL/config/*/CGAL/compiler_config.h %{buildroot}%{_includedir}/CGAL/compiler_config.h
+# remove the arch-specific comment
+sed -i -e '/System: / d' %{buildroot}%{_includedir}/CGAL/compiler_config.h
+# use the timestamp of install_cgal
+touch -r %{_builddir}/%{name}-%{version}/install_cgal %{buildroot}%{_includedir}/CGAL/compiler_config.h
 rm -rf %{buildroot}%{_includedir}/CGAL/config
 
 # Install scripts (only those prefixed with "cgal_").
 mkdir -p %{buildroot}%{_bindir}
-cp -a scripts/cgal_* %{buildroot}%{_bindir}
+install -p scripts/cgal_* %{buildroot}%{_bindir}
 
 # Install libraries
 mkdir -p %{buildroot}%{_libdir}
@@ -136,7 +143,7 @@
 # Install makefile:
 mkdir -p %{buildroot}%{_datadir}/CGAL
 touch -r make %{buildroot}%{_datadir}/CGAL
-cp -p make/makefile_* %{buildroot}%{_datadir}/CGAL/cgal.mk
+install -p make/makefile_* %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk
 
 # Install demos and examples
 mkdir -p %{buildroot}%{_datadir}/CGAL/
@@ -155,13 +162,15 @@
 /-I.*CGAL_INCL_CONF_DIR/ d
 EOF
 
-sed -i -f makefile.sed %{buildroot}%{_datadir}/CGAL/cgal.mk
+# use -i.bak to generate cgal-${SUFFIX}.mk.bak with right timestamp
+# used below to restore the timestamp
+sed -i.bak -f makefile.sed %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk
 
 # check if the sed script above has worked:
-grep -q %{_builddir} %{buildroot}%{_datadir}/CGAL/cgal.mk && false
-grep -q %{buildroot} %{buildroot}%{_datadir}/CGAL/cgal.mk && false
-grep -q CGAL/config %{buildroot}%{_datadir}/CGAL/cgal.mk && false
-grep -q -E 'CUSTOM_CXXFLAGS.*(-O2|-g)' %{buildroot}%{_datadir}/CGAL/cgal.mk && false
+grep -q %{_builddir} %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk && false
+grep -q %{buildroot} %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk && false
+grep -q CGAL/config %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk && false
+grep -q -E 'CUSTOM_CXXFLAGS.*(-O2|-g)' %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk && false
 
 # Remove -L and -R flags from the makefile
 cat > makefile-noprefix.sed <<'EOF'
@@ -170,29 +179,56 @@
 /'-I$(CGAL_INCL_DIR)'/ d;
 EOF
 
-sed -i -f makefile-noprefix.sed  %{buildroot}%{_datadir}/CGAL/cgal.mk
+sed -i -f makefile-noprefix.sed  %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk
+
+# restore the timestamp and remove the .bak file
+touch -r %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk.bak %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk
+rm -f %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk.bak
 
 # check that the sed script has worked
-grep -q -E -- '-[LI]\$' %{buildroot}%{_datadir}/CGAL/cgal.mk && false
-grep -q -E -- '-R' %{buildroot}%{_datadir}/CGAL/cgal.mk && false
+grep -q -E -- '-[LI]\$' %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk && false
+grep -q -E -- '-R' %{buildroot}%{_datadir}/CGAL/cgal-${SUFFIX}.mk && false
 
 
 # Create %{_sysconfdir}/profile.d/ scripts
 cd %{buildroot}
 mkdir -p .%{_sysconfdir}/profile.d
 cat > .%{_sysconfdir}/profile.d/cgal.sh <<EOF
+ARCH=`uname -m`
+
+case $ARCH in
+        x86_64 | ia64 | s390 )
+           SUFFIX=64 ;;
+        * )
+           SUFFIX=32 ;;
+esac
+
 if [ -z "\$CGAL_MAKEFILE" ] ; then
-  CGAL_MAKEFILE="%{_datadir}/CGAL/cgal.mk"
+  CGAL_MAKEFILE="%{_datadir}/CGAL/cgal-${SUFFIX}.mk"
   export CGAL_MAKEFILE
 fi
 EOF
 
 cat > .%{_sysconfdir}/profile.d/cgal.csh <<EOF
+ARCH=`uname -m`
+
+switch( $ARCH )
+        case x86_64:
+        case ia64:
+        case s390:
+          SUFFIX=64;
+          breaksw;
+        default:
+          SUFFIX=62;
+endsw
+
 if ( ! \$?CGAL_MAKEFILE ) then
-  setenv CGAL_MAKEFILE "%{_datadir}/CGAL/cgal.mk"
+  setenv CGAL_MAKEFILE "%{_datadir}/CGAL/cgal-${SUFFIX}.mk"
 endif
 EOF
 chmod 644 .%{_sysconfdir}/profile.d/cgal.*sh
+# use the timestamp of install_cgal
+touch -r %{_builddir}/%{name}-%{version}/install_cgal .%{_sysconfdir}/profile.d/cgal.*sh
 
 %clean
 rm -rf %{buildroot}
@@ -215,7 +251,7 @@
 %{_includedir}/CGAL
 %{_libdir}/libCGAL*.so
 %dir %{_datadir}/CGAL
-%{_datadir}/CGAL/cgal.mk
+%{_datadir}/CGAL/cgal*.mk
 %{_bindir}/*
 %exclude %{_bindir}/cgal_make_macosx_app
 %config(noreplace) %{_sysconfdir}/profile.d/cgal.*
@@ -231,6 +267,12 @@
 
 
 %changelog
+* Sun Oct 21 2007 Laurent Rineau <laurent.rineau__fedora at normalesup.org> - 3.3.1-3%{dist}
+- gawk and coreutils are not required in BR (see exceptions list)
+- fix multilib issues (bug #340821):
+  - rename %%{_datadir}/CGAL/cgal.mk to %%{_datadir}/CGAL/cgal-%%{_arch}.mk
+  - remove the arch-specific comment from %%{_includedir}/CGAL/compiler_config.h
+
 * Mon Sep  3 2007 Laurent Rineau <laurent.rineau__fedora at normalesup.org> - 3.3.1-2%{dist}
 - Fix soversion.
 
@@ -254,7 +296,7 @@
 - CGAL-devel now requires all its dependancies.
 
 * Sat Jun  2 2007 Laurent Rineau <laurent.rineau__fedora_extras at normalesup.org> - 3.3-2%{?dist}
-- Officiel CGAL-3.3 release
+- Official CGAL-3.3 release
 - Skip file named "skip_vcproj_auto_generation"
 
 * Wed May 30 2007 Laurent Rineau <laurent.rineau__fedora_extras at normalesup.org> - 3.3-0.1.RC1%{?dist}




More information about the fedora-extras-commits mailing list