Tweak spec file as per suggestions from Michael Schwendt

darcs-hash:20060801135709-ac50b-07c6191b7464ba90dd64c78ae18df8b59e8e18ad.gz
This commit is contained in:
axel 2006-08-01 23:57:09 +10:00
parent dc3634dc94
commit 6b1570b745

View file

@ -1,5 +1,3 @@
%define xinclude %( if test -d /usr/X11R6/include; then echo /usr/X11R6/include; else echo /usr/include; fi )
Summary: A friendly interactive shell Summary: A friendly interactive shell
Name: @PACKAGE_NAME@ Name: @PACKAGE_NAME@
@ -14,10 +12,38 @@ Source0: http://roo.no-ip.org/%{name}/files/%{version}/%{name}-%{
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ncurses-devel gettext groff BuildRequires: ncurses-devel gettext groff
BuildRequires: %{xinclude}/X11/StringDefs.h, %{xinclude}/X11/Xlib.h
BuildRequires: %{xinclude}/X11/Intrinsic.h, %{xinclude}/X11/Xatom.h
# Locate correct build-dependencies for providing X headers
%if "%fedora" >= "5"
# Modern Fedora version, has modular X.org
BuildRequires: xorg-x11-proto-devel libX11-devel libXt-devel
%else
%if "%fedora" >= "3"
# Semi-old Fedora version, has non-modular X.org
BuildRequires: xorg-x11-devel
%else
%if 0%{?fedora}
# Ancient Fedora version, has XFree86
BuildRequires: XFree86-devel
%else
# This is not a Fedora system, try guessing BuildRequires by
# looking at the directory structure
%define xinclude /usr%(if [ -d /usr/X11R6/include ]; then echo /X11R6; fi)/include
BuildRequires: %{xinclude}/X11/StringDefs.h, %{xinclude}/X11/Xlib.h
BuildRequires: %{xinclude}/X11/Intrinsic.h, %{xinclude}/X11/Xatom.h
%endif
%endif
%endif
%description %description
@ -53,6 +79,7 @@ rm -rf $RPM_BUILD_ROOT
%post %post
# Add fish to the list of allowed shells in /etc/shells
if ! grep %_bindir/fish %_sysconfdir/shells >/dev/null; then if ! grep %_bindir/fish %_sysconfdir/shells >/dev/null; then
echo %_bindir/fish >>%_sysconfdir/shells echo %_bindir/fish >>%_sysconfdir/shells
fi fi
@ -61,6 +88,7 @@ fi
%postun %postun
# Remove fish from the list of allowed shells in /etc/shells
if [ "$1" = 0 ]; then if [ "$1" = 0 ]; then
grep -v %_bindir/fish %_sysconfdir/shells >%_sysconfdir/fish.tmp grep -v %_bindir/fish %_sysconfdir/shells >%_sysconfdir/fish.tmp
mv %_sysconfdir/fish.tmp %_sysconfdir/shells mv %_sysconfdir/fish.tmp %_sysconfdir/shells