CBEenv.spec
changeset 27 7f4e9d6a6772
parent 18 ea7716e23aab
child 29 d02e22ab9ac5
--- a/CBEenv.spec	Wed Jun 18 11:50:08 2008 +0000
+++ b/CBEenv.spec	Thu Jun 19 02:21:39 2008 +0000
@@ -60,7 +60,10 @@
 # create the "make" symlink to gmake when using SUNWgmake
 GMAKE=xx
 for f in /usr/gnu/bin/make /usr/bin/gmake /usr/sfw/bin/gmake; do
-    test -f %{?altroot}$f && GMAKE=$f
+    test -f %{?altroot}$f && {
+	GMAKE=$f
+	break
+    }
 done
 if [ "x$GMAKE" == xxx ]; then
     echo 'GNU make not found, please install SUNWgmake or CBEmake'
@@ -73,15 +76,35 @@
 %if %(pkginfo -q CBEcoreutils && echo 0 || echo 1)
 # create the "install" symlink to ginstall when using SUNWgnu-coreutils
 cd $RPM_BUILD_ROOT%{_bindir}
+# break if ginstall is not found
+test -x /usr/bin/ginstall
 ln -s %relroot/usr/bin/ginstall install
 %endif
 
 %if %(pkginfo -q CBEdiff && echo 0 || echo 1)
 # create the "diff" symlink to gdiff when using SUNWgnu-diffutils
 cd $RPM_BUILD_ROOT%{_bindir}
+# break if gdiff is not found
+test -x /usr/bin/gdiff
 ln -s %relroot/usr/bin/gdiff diff
 %endif
 
+%if %(pkginfo -q CBEm4 && echo 0 || echo 1)
+# create the "m4" symlink to gm4 when using SUNWgm4
+GM4=xx
+for f in /usr/gnu/bin/m4 /usr/bin/gm4 /usr/sfw/bin/gm4; do
+    test -f %{?altroot}$f && {
+	GM4=$f
+	break
+    }
+done
+if [ "x$GM4" == xxx ]; then
+    echo 'GNU m4 not found, please install SUNWgm4 or CBEm4'
+    exit 1
+fi
+cd $RPM_BUILD_ROOT%{_bindir}
+ln -s %relroot$GM4 m4
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT