Author: glen                         Date: Mon Feb 22 19:32:39 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- use %lua_{remove|add}_etc_shells macros
- FHS and setup macros should be automatic

---- Files affected:
packages/mksh:
   mksh.spec (1.7 -> 1.8) 

---- Diffs:

================================================================
Index: packages/mksh/mksh.spec
diff -u packages/mksh/mksh.spec:1.7 packages/mksh/mksh.spec:1.8
--- packages/mksh/mksh.spec:1.7 Sun Oct 26 18:44:40 2008
+++ packages/mksh/mksh.spec     Mon Feb 22 20:32:33 2010
@@ -10,8 +10,7 @@
 # Source0-md5: 9962d052a1571ba843965c6253819ac4
 Source1:       http://www.mirbsd.org/MirOS/dist/hosted/other/arc4random.c
 URL:           http://mirbsd.de/mksh
-Requires(pre): FHS
-Requires:      setup >= 2.4.6-2
+BuildRequires: rpmbuild(macros) >= 1.462
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _bindir                 /bin
@@ -43,9 +42,8 @@
 %prep
 %setup -qcT
 gzip -dc %{SOURCE0} | cpio -mid
-mv mksh/* ./
-rm -rf mksh
-cp %{SOURCE1} .
+mv mksh/* .; rmdir mksh
+cp -a %{SOURCE1} .
 
 %build
 CC="%{__cc}" CFLAGS="%{rpmcflags}" sh ./Build.sh -Q -r -j
@@ -53,45 +51,26 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -D mksh        $RPM_BUILD_ROOT%{_bindir}/mksh
-install -D mksh.1 $RPM_BUILD_ROOT%{_mandir}/man1/mksh.1
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
+install -p mksh        $RPM_BUILD_ROOT%{_bindir}/mksh
+cp -a mksh.1 $RPM_BUILD_ROOT%{_mandir}/man1/mksh.1
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post -p <lua>
-t = {}
-f = io.open("/etc/shells", "r")
-if f then
-       for l in f:lines() do t[l]=l; end
-       f:close()
-end
-for _, s in ipairs({"/bin/mksh"}) do
-       if not t[s] then
-               f = io.open("/etc/shells", "a"); f:write(s.."\n"); f:close()
-       end
-end
+%post  -p <lua>
+%lua_add_etc_shells %{_bindir}/mksh
 
-%preun -p <lua>
-if arg[2] == "0" then
-       f = io.open("/etc/shells", "r")
-       if f then
-               s=""
-               for l in f:lines() do
-                       if not string.match(l,"^/bin/mksh$") then
-                               s=s..l.."\n"
-                       end
-               end
-               f:close()
-               io.open("/etc/shells", "w"):write(s)
-       end
+%preun -p <lua>
+if arg[2] == 0 then
+       %lua_remove_etc_shells  %{_bindir}/mksh
 end
 
 %files
 %defattr(644,root,root,755)
 %doc dot.mkshrc
 %attr(755,root,root) %{_bindir}/mksh
-%{_mandir}/man1/*
+%{_mandir}/man1/mksh.1*
 
 %define date   %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -99,6 +78,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.8  2010/02/22 19:32:33  glen
+- use %lua_{remove|add}_etc_shells macros
+- FHS and setup macros should be automatic
+
 Revision 1.7  2008/10/26 17:44:40  areq
 - R36
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/mksh/mksh.spec?r1=1.7&r2=1.8&f=u

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

Reply via email to