36f1d62cb74cc30fc174b29ad7025c1311c5d896
[platform/upstream/byacc.git] / package / byacc.spec
1 Summary: byacc - public domain Berkeley LALR Yacc parser generator
2 %define AppProgram byacc
3 %define AltProgram btyacc
4 %define AppVersion 20211224
5 %define UseProgram yacc
6 # $Id: byacc.spec,v 1.60 2021/12/25 00:13:22 tom Exp $
7 Name: %{AppProgram}
8 Version: %{AppVersion}
9 Release: 1
10 License: Public Domain, MIT
11 Group: Applications/Development
12 URL: ftp://invisible-island.net/%{AppProgram}
13 Source0: %{AppProgram}-%{AppVersion}.tgz
14 Packager: Thomas E. Dickey <dickey@invisible-island.net>
15
16 %description
17 This package provides a parser generator utility that reads a grammar
18 specification from a file and generates an LR(1) parser for it.  The
19 parsers consist of a set of LALR(1) parsing tables and a driver
20 routine written in the C programming language.  It has a public domain
21 license which includes the generated C.
22
23 %package -n btyacc
24 Summary:        Curses library with POSIX thread support.
25
26 %description -n btyacc
27 This package provides a parser generator utility that reads a grammar
28 specification from a file and generates an LR(1) parser for it.  The
29 parsers consist of a set of LALR(1) parsing tables and a driver
30 routine written in the C programming language.  It has a public domain
31 license which includes the generated C.
32
33 This package has the backtracking extension.
34
35 %prep
36
37 %define debug_package %{nil}
38
39 %setup -q -n %{AppProgram}-%{AppVersion}
40
41 %build
42 %define my_srcdir ..
43 %define CFG_OPTS \\\
44   --verbose \\\
45   --disable-echo \\\
46   --enable-stdnoreturn \\\
47   --target %{_target_platform} \\\
48   --prefix=%{_prefix} \\\
49   --srcdir=%{my_srcdir} \\\
50   --bindir=%{_bindir} \\\
51   --libdir=%{_libdir} \\\
52   --mandir=%{_mandir}
53
54 %global _configure ../configure
55
56 mkdir BUILD-byacc
57 pushd BUILD-byacc
58 CONFIGURE_TOP=%{my_srcdir} \
59 %configure %{CFG_OPTS} \
60   --program-prefix=b \
61   --program-transform-name='s,\^,b,'
62 make
63 popd
64
65 mkdir BUILD-btyacc
66 pushd BUILD-btyacc
67 CONFIGURE_TOP=%{my_srcdir} \
68 %configure %{CFG_OPTS} \
69   --enable-btyacc \
70   --program-prefix=bt \
71   --with-max-table-size=123456 \
72   --program-transform-name='s,\^,bt,'
73 make
74 popd
75
76 %install
77 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
78
79 pushd BUILD-byacc
80 make install DESTDIR=$RPM_BUILD_ROOT
81 ( cd $RPM_BUILD_ROOT%{_bindir} && ln -vs %{AppProgram} %{UseProgram} )
82 popd
83
84 pushd BUILD-btyacc
85 make install DESTDIR=$RPM_BUILD_ROOT
86 popd
87
88 %clean
89 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
90
91 %files
92 %defattr(-,root,root)
93 %{_prefix}/bin/%{AppProgram}
94 %{_prefix}/bin/%{UseProgram}
95 %{_mandir}/man1/%{AppProgram}.*
96
97 %files -n btyacc
98 %defattr(-,root,root)
99 %{_prefix}/bin/%{AltProgram}
100 %{_mandir}/man1/%{AltProgram}.*
101
102 %changelog
103 # each patch should add its ChangeLog entries here
104
105 * Fri May 25 2018 Thomas Dickey
106 - add btyacc package
107
108 * Sun Jul 09 2017 Thomas Dickey
109 - use predefined "configure"
110
111 * Sun Jun 06 2010 Thomas Dickey
112 - initial version