]> git.pld-linux.org Git - packages/fish.git/blobdiff - fish.spec
macros for add lua shells
[packages/fish.git] / fish.spec
index 370d830b9cff845a285fd14443fb3422c672f651..49ba5c484f908325859217f9524225c801949a9b 100644 (file)
--- a/fish.spec
+++ b/fish.spec
@@ -12,6 +12,7 @@ BuildRequires:        autoconf >= 2.60
 BuildRequires: doxygen
 BuildRequires: gettext-tools
 BuildRequires: ncurses-devel
+BuildRequires: rpmbuild(macros) >= 1.462
 Suggests:      python
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -48,20 +49,13 @@ rm -rf $RPM_BUILD_ROOT
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-umask 022
-if [ ! -f /etc/shells ]; then
-        echo "%{_bindir}/fish" >> /etc/shells
-else
-        grep -q '^%{_bindir}/fish$' /etc/shells || echo "%{_bindir}/fish" >> /etc/shells
-fi
+%post -p <lua>
+%lua_add_etc_shells %{_bindir}/fish
 
-%preun
-if [ "$1" = "0" ]; then
-        umask 022
-        grep -v '^%{_bindir}/fish$' /etc/shells > /etc/shells.new
-        mv -f /etc/shells.new /etc/shells
-fi
+%preun -p <lua>
+if arg[2] == 0 then
+       %lua_remove_etc_shells %{_bindir}/fish
+end
 
 %files -f %{name}.lang
 %defattr(644,root,root,755)
This page took 0.073724 seconds and 4 git commands to generate.