CBEenv.spec
changeset 10 a65a967018ee
parent 7 fe5233293a17
child 11 6769bf4088b7
--- a/CBEenv.spec	Tue May 27 09:47:20 2008 +0000
+++ b/CBEenv.spec	Tue Jun 10 13:04:19 2008 +0000
@@ -9,7 +9,7 @@
 %include CBE.inc
 
 Name:			CBEenv
-Version:		@CBE_VERSION@
+Version:		%{?cbe_version}%{?!cbe_version:0.0}
 Vendor:			Sun Microsystems, Inc.
 Summary:		Desktop CBE: env setup scripts for the Desktop CBE
 Source:			env.sh
@@ -23,6 +23,8 @@
 %prep
 mkdir -p %name-%version
 
+%define relroot %(echo %{_bindir} | sed -e 's,[^/][^/]*,..,g' | cut -c2-)
+
 %install
 rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT%{_bindir}
@@ -31,6 +33,40 @@
 cp %SOURCE2 $RPM_BUILD_ROOT%{_bindir}
 chmod 755 $RPM_BUILD_ROOT%{_bindir}/*
 
+%if %(pkginfo -q CBEautomake && echo 0 || echo 1)
+# create the "automake" symlink to automake 1.10 when using the
+# Solaris default automake, because it only includes versioned
+# entries in /usr/bin
+test -f %{?altroot}/usr/bin/automake-1.10 && {
+    cd $RPM_BUILD_ROOT%{_bindir}
+    ln -s %relroot/usr/bin/automake-1.10 automake
+} || {
+    echo 'automake-1.10 not found'
+    exit 1
+}
+test -f %{?altroot}/usr/bin/aclocal-1.10 && {
+    cd $RPM_BUILD_ROOT%{_bindir}
+    ln -s %relroot/usr/bin/aclocal-1.10 aclocal
+} || {
+    echo 'aclocal-1.10 not found'
+    exit 1
+}
+%endif
+
+%if %(pkginfo -q CBEmake && echo 0 || echo 1)
+# 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
+done
+if [ "x$GMAKE" == xxx ]; then
+    echo 'GNU make not found, please install SUNWgmake or CBEmake'
+    exit 1
+fi
+cd $RPM_BUILD_ROOT%{_bindir}
+ln -s %relroot$GMAKE make
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -39,35 +75,9 @@
 %dir %attr (0755, root, bin) %{_bindir}
 %{_bindir}/*
 
-%define relroot %(echo %{_bindir} | sed -e 's,[^/][^/]*,..,g' | cut -c2-)
-
-%post
-#!/bin/bash
-# create the "automake" symlink to automake 1.10 when using the
-# Solaris default automake, because it only includes versioned
-# entries in /usr/bin
-test -f $PKG_INSTALL_ROOT/usr/bin/automake-1.10 && {
-    cd $BASEDIR/bin
-    ln -s %relroot/usr/bin/automake-1.10 automake
-    installf $PKGINST %{_bindir}/automake s
-}
-# create the "make" symlink to gmake
-GMAKE=xx
-for f in /usr/gnu/bin/make /usr/bin/gmake /usr/sfw/bin/gmake; do
-    test -f $PKG_INSTALL_ROOT$f && GMAKE=$f
-done
-if [ "x$GMAKE" == xxx ]; then
-    # none of the above was found
-    echo 'GNU make not found, please install SUNWgmake'
-    exit 1
-fi
-cd $BASEDIR/bin
-ln -s %relroot$GMAKE make
-installf $PKGINST %{_bindir}/make s
-
-installf -f $PKGINST
-
 %changelog
+* Wed Jun 11 2008  <[email protected]>
+- update version, create symlinks for [Open]Solaris gnu make, automake, aclocal
 * Mon Apr 14 2008 - [email protected]
 - update deps
 - use CBE.inc