Imported Upstream version 20220101
[platform/upstream/byacc.git] / package / byacc.spec
1 Summary: byacc - public domain Berkeley LALR Yacc parser generator
2 %define AppProgram byacc
3 %define AltProgram byacc2
4 %define AppVersion 20220101
5 %define UseProgram yacc
6 # $Id: byacc.spec,v 1.62 2022/01/01 14:59:55 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 byacc2
24 Summary:        Curses library with POSIX thread support.
25
26 %description -n byacc2
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 make
62 popd
63
64 mkdir BUILD-byacc2
65 pushd BUILD-byacc2
66 CONFIGURE_TOP=%{my_srcdir} \
67 %configure %{CFG_OPTS} \
68   --enable-btyacc \
69   --program-transform-name='s,\<yacc,byacc2,g' \
70   --with-max-table-size=123456 \
71 make
72 popd
73
74 %install
75 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
76
77 pushd BUILD-byacc
78 make install DESTDIR=$RPM_BUILD_ROOT
79 ( cd $RPM_BUILD_ROOT%{_bindir} && ln -vs %{AppProgram} %{UseProgram} )
80 popd
81
82 pushd BUILD-byacc2
83 make install DESTDIR=$RPM_BUILD_ROOT
84 popd
85
86 %clean
87 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
88
89 %files
90 %defattr(-,root,root)
91 %{_prefix}/bin/%{AppProgram}
92 %{_prefix}/bin/%{UseProgram}
93 %{_mandir}/man1/%{AppProgram}.*
94
95 %files -n byacc2
96 %defattr(-,root,root)
97 %{_prefix}/bin/%{AltProgram}
98 %{_mandir}/man1/%{AltProgram}.*
99
100 %changelog
101 # each patch should add its ChangeLog entries here
102
103 * Sat Jan 01 2022 Thomas Dickey
104 - rename btyacc package to byacc2 to co-exist with traditional btyacc
105
106 * Fri May 25 2018 Thomas Dickey
107 - add btyacc package
108
109 * Sun Jul 09 2017 Thomas Dickey
110 - use predefined "configure"
111
112 * Sun Jun 06 2010 Thomas Dickey
113 - initial version