Author: glen                         Date: Fri Jun  9 19:33:56 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- now that sed doesn't require /bin/sh, use sed in uninstall scripts

---- Files affected:
SPECS:
   pdksh.spec (1.105 -> 1.106) 

---- Diffs:

================================================================
Index: SPECS/pdksh.spec
diff -u SPECS/pdksh.spec:1.105 SPECS/pdksh.spec:1.106
--- SPECS/pdksh.spec:1.105      Sun Nov 27 23:25:08 2005
+++ SPECS/pdksh.spec    Fri Jun  9 21:33:50 2006
@@ -14,7 +14,7 @@
 Summary(uk):   ÷ŚĚÂÎÁ ŇĹÁĚŚÚÁĂŚŃ ËĎÍÁÎÄÎĎÇĎ ĐŇĎĂĹÓĎŇÁ Korn shell (ksh)
 Name:          pdksh
 Version:       5.2.14
-Release:       43
+Release:       43.1
 License:       Mostly Public Domain with Free & GPL additions
 Group:         Applications/Shells
 Source0:       ftp://ftp.cs.mun.ca/pub/pdksh/%{name}-%{version}.tar.gz
@@ -39,7 +39,7 @@
 Patch15:       %{name}-ulimit-vmem.patch
 URL:           http://www.cs.mun.ca/~michael/pdksh/
 %{?with_static:BuildRequires:  glibc-static}
-#Requires(preun):      /bin/mv
+Requires(preun):       sed >= 4.1.5-1.2
 Requires:      setup >= 2.4.6-2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -96,7 +96,8 @@
 Summary:       Statically linked Public Domain Korn Shell
 Summary(pl):   Skonsolidowana statycznie powłoka Korna
 Group:         Applications/Shells
-#Requires(preun):      /bin/mv
+Requires(preun):       sed >= 4.1.5-1.2
+# requires base for /etc/kshrc?
 Requires:      %{name} = %{version}-%{release}
 
 %description static
@@ -142,10 +143,10 @@
 rm -rf $RPM_BUILD_ROOT
 
 %{__make} install \
-       exec_prefix=$RPM_BUILD_ROOT/ \
+       exec_prefix=$RPM_BUILD_ROOT \
        mandir=$RPM_BUILD_ROOT%{_mandir}/man1
 
-install -d $RPM_BUILD_ROOT{/etc,%{_mandir}/pl/man1}
+install -d $RPM_BUILD_ROOT{%{_mandir}/pl/man1,/etc}
 
 echo ".so ksh.1" > $RPM_BUILD_ROOT%{_mandir}/man1/pdksh.1
 echo ".so ksh.1" > $RPM_BUILD_ROOT%{_mandir}/man1/sh.1
@@ -162,54 +163,48 @@
 rm -rf $RPM_BUILD_ROOT
 
 %post
-umask 022
 if [ ! -f /etc/shells ]; then
+       umask 022
        echo "/bin/ksh" > /etc/shells
        echo "/bin/sh" >> /etc/shells
 else
        while read SHNAME; do
-               if [ "$SHNAME" = "/bin/ksh" ]; then
-                       HAS_KSH=1
-               elif [ "$SHNAME" = "/bin/sh" ]; then
-                       HAS_SH=1
-               fi
+               if [ "$SHNAME" = "/bin/ksh" ]; then
+                       HAS_KSH=1
+               elif [ "$SHNAME" = "/bin/sh" ]; then
+                       HAS_SH=1
+               fi
        done < /etc/shells
        [ -n "$HAS_KSH" ] || echo "/bin/ksh" >> /etc/shells
        [ -n "$HAS_SH" ] || echo "/bin/sh" >> /etc/shells
 fi
 
 %preun
-umask 022
 if [ "$1" = "0" ]; then
-       while read SHNAME; do
-               [ "$SHNAME" = "/bin/ksh" ] ||\
-               [ "$SHNAME" = "/bin/sh" ] ||\
-               echo "$SHNAME"
-       done < /etc/shells > /etc/shells.new
-       mv -f /etc/shells.new /etc/shells
+       %{__sed} -i -e '
+               /^\/bin\/ksh$/d
+               /^\/bin\/sh$/d
+       ' /etc/shells
 fi
 
 %post static
-umask 022
 if [ ! -f /etc/shells ]; then
+       umask 022
        echo "/bin/ksh.static" > /etc/shells
 else
        while read SHNAME; do
-               if [ "$SHNAME" = "/bin/ksh.static" ]; then
-                       HAS_KSH_STATIC=1
-               fi
+       if [ "$SHNAME" = "/bin/ksh.static" ]; then
+               HAS_KSH_STATIC=1
+       fi
        done < /etc/shells
        [ -n "$HAS_KSH_STATIC" ] || echo "/bin/ksh.static" >> /etc/shells
 fi
 
 %preun static
-umask 022
 if [ "$1" = "0" ]; then
-       while read SHNAME; do
-               [ "$SHNAME" = "/bin/ksh.static" ] ||\
-               echo "$SHNAME"
-       done < /etc/shells > /etc/shells.new
-       mv -f /etc/shells.new /etc/shells
+       %{__sed} -i -e '
+               /^\/bin\/ksh\.static$/d
+       ' /etc/shells
 fi
 
 %files
@@ -233,6 +228,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.106  2006/06/09 19:33:50  glen
+- now that sed doesn't require /bin/sh, use sed in uninstall scripts
+
 Revision 1.105  2005/11/27 22:25:08  ankry
 - commented out again R(preun): rpm needs fixing
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/pdksh.spec?r1=1.105&r2=1.106&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to