bison/bison.spec

changeset 22
0d4f475bfc81
child 24
e27cb96c604b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/bison/bison.spec	Wed Jan 07 14:58:25 2009 +0100
     1.3 @@ -0,0 +1,137 @@
     1.4 +##
     1.5 +##  bison.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package versions
    1.28 +%define       V_new      2.4.1
    1.29 +%define       V_old      1.35
    1.30 +
    1.31 +#   package information
    1.32 +Name:         bison
    1.33 +Summary:      Yacc-compatible LALR(1) Parser Generator
    1.34 +URL:          http://www.gnu.org/software/bison/
    1.35 +Vendor:       Free Software Foundation
    1.36 +Packager:     OpenPKG Foundation e.V.
    1.37 +Distribution: OpenPKG Community
    1.38 +Class:        CORE
    1.39 +Group:        CompilerCompiler
    1.40 +License:      GPL
    1.41 +Version:      %{V_new}
    1.42 +Release:      20081213
    1.43 +
    1.44 +#   package options
    1.45 +%option       with_old   no
    1.46 +
    1.47 +#   list of sources
    1.48 +Source0:      ftp://ftp.gnu.org/gnu/bison/bison-%{V_new}.tar.gz
    1.49 +Source1:      ftp://ftp.gnu.org/gnu/bison/bison-%{V_old}.tar.gz
    1.50 +Patch0:       bison.patch
    1.51 +
    1.52 +#   build information
    1.53 +Prefix:       %{l_prefix}
    1.54 +BuildRoot:    %{l_buildroot}
    1.55 +BuildPreReq:  OpenPKG, openpkg >= 20040212, m4, make
    1.56 +PreReq:       OpenPKG, openpkg >= 20040212, m4
    1.57 +AutoReq:      no
    1.58 +AutoReqProv:  no
    1.59 +Conflicts:    yacc
    1.60 +
    1.61 +%description
    1.62 +    Bison is a general-purpose parser generator that converts a grammar
    1.63 +    description for an LALR(1) context-free grammar into a C program
    1.64 +    to parse that grammar. Once you are proficient with bison, you may
    1.65 +    use it to develop a wide range of language parsers, from those used
    1.66 +    in simple desk calculators to complex programming languages. Bison
    1.67 +    is upward compatible with yacc: all properly-written yacc grammars
    1.68 +    ought to work with bison with no change. Anyone familiar with yacc
    1.69 +    should be able to use bison with little trouble.
    1.70 +
    1.71 +%track
    1.72 +    prog bison:new = {
    1.73 +        version   = %{V_new}
    1.74 +        url       = ftp://ftp.gnu.org/gnu/bison/
    1.75 +        regex     = bison-(2.\d+(.\d+)*[a-z]?)\.tar\.gz
    1.76 +    }
    1.77 +    prog bison:old = {
    1.78 +        version   = %{V_old}
    1.79 +        url       = ftp://ftp.gnu.org/gnu/bison/
    1.80 +        regex     = bison-(1\.3\d+)\.tar\.gz
    1.81 +    }
    1.82 +
    1.83 +%prep
    1.84 +    %setup -q -c -n bison-%{V_new}
    1.85 +    %patch -p0 -d bison-%{V_new}
    1.86 +    %setup -q -T -D -a 1
    1.87 +    %{l_shtool} subst \
    1.88 +        -e 's;^\( *SUBDIRS = .*\) examples\(.*\)$;\1\2;' \
    1.89 +        bison-%{V_new}/Makefile.in
    1.90 +
    1.91 +%build
    1.92 +    ( cd bison-%{V_new}
    1.93 +      CC="%{l_cc}" \
    1.94 +      CFLAGS="%{l_cflags -O}" \
    1.95 +      CONFIG_SHELL=/bin/sh \
    1.96 +      ./configure \
    1.97 +          --prefix=%{l_prefix} \
    1.98 +          --mandir=%{l_prefix}/man \
    1.99 +          --infodir=%{l_prefix}/info \
   1.100 +          --disable-nls
   1.101 +      %{l_make} -f Makefile %{l_mflags}
   1.102 +    ) || exit $?
   1.103 +%if "%{with_old}" == "yes"
   1.104 +    ( cd bison-%{V_old}
   1.105 +      CC="%{l_cc}" \
   1.106 +      CFLAGS="%{l_cflags -O}" \
   1.107 +      ./configure \
   1.108 +          --prefix=%{l_prefix} \
   1.109 +          --mandir=%{l_prefix}/man \
   1.110 +          --infodir=%{l_prefix}/info \
   1.111 +          --disable-nls
   1.112 +      %{l_make} -f Makefile %{l_mflags}
   1.113 +    ) || exit $?
   1.114 +%endif
   1.115 +
   1.116 +%install
   1.117 +    rm -rf $RPM_BUILD_ROOT
   1.118 +%if "%{with_old}" == "yes"
   1.119 +    ( cd bison-%{V_old}
   1.120 +      %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   1.121 +      mv $RPM_BUILD_ROOT%{l_prefix}/bin/bison \
   1.122 +         $RPM_BUILD_ROOT%{l_prefix}/bin/bison-old
   1.123 +      mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison.1 \
   1.124 +         $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison-old.1
   1.125 +    ) || exit $?
   1.126 +%endif
   1.127 +    ( cd bison-%{V_new}
   1.128 +      %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   1.129 +    ) || exit $?
   1.130 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
   1.131 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
   1.132 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
   1.133 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.134 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   1.135 +
   1.136 +%files -f files
   1.137 +
   1.138 +%clean
   1.139 +    rm -rf $RPM_BUILD_ROOT
   1.140 +

mercurial