[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Update of the fish package



On Tue, 1 Aug 2006 19:55:56 +0200, Axel Liljencrantz wrote:

> On 8/1/06, Hans de Goede <j w r degoede hhs xxx> wrote:
> >
> > >
> > > Look at e.g.
> > >
> > > http://roo.no-ip.org/fish/darcs/fish.spec
> > >
> > > can you honestly say that 'nobody could understand the spec'?
> >
> > I understand it, but I concider myself not the average packagers and
> > even for me it hurts my eyes. I know the only conditional stuff in there
> > are the X-requires but thats a 3 times nested if. Now as a C-programmer
> > I generally try to avoid nested conditional statements more then 2
> > levels deep, for a spec file 3 levels of nesting is just wrong.
> >
> > So I think your example actually makes a strong point for those
> > objecting to one spec for all.
> 
> Then we must simply agree to disagree. Strongly.
> 
> As a C programmer, I try to avoid tripple-nested if-statements, but
> duplicating 200 lines of code N times (where N is currently 4, but can
> potentially be a large number) simply because 1-2 lines differ between
> versions is an order of magnitude worse.

Much nicer to the eyes:

# Locate correct build time-dependencies for providing X headers
%if "%fedora" >= "5"
# Modern Fedora version, has modular X.org
BuildRequires:          xorg-x11-proto-devel libX11-devel libXt-devel
%endif

%if "%fedora" < "5"
%if "%fedora" >= "3"
# Semi-old Fedora version, has non-modular X.org
BuildRequires:          xorg-x11-devel
%endif
%endif

%if "%fedora" < "3"
# Ancient Fedora version, has XFree86
BuildRequires:          XFree86-devel
%endif

%if 0%{!?fedora}
# 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)/inclu
de
BuildRequires:          %{xinclude}/X11/StringDefs.h, %{xinclude}/X11/Xlib.h
BuildRequires:          %{xinclude}/X11/Intrinsic.h,  %{xinclude}/X11/Xatom.h
%endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]