1 ## |
1 ## |
2 ## bison.spec -- OpenPKG RPM Package Specification |
2 ## bison.spec -- OpenPKG RPM Package Specification |
3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> |
3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
4 ## |
4 ## |
5 ## Permission to use, copy, modify, and distribute this software for |
5 ## Permission to use, copy, modify, and distribute this software for |
6 ## any purpose with or without fee is hereby granted, provided that |
6 ## any purpose with or without fee is hereby granted, provided that |
7 ## the above copyright notice and this permission notice appear in all |
7 ## the above copyright notice and this permission notice appear in all |
8 ## copies. |
8 ## copies. |
34 Distribution: OpenPKG Community |
34 Distribution: OpenPKG Community |
35 Class: CORE |
35 Class: CORE |
36 Group: CompilerCompiler |
36 Group: CompilerCompiler |
37 License: GPL |
37 License: GPL |
38 Version: %{V_new} |
38 Version: %{V_new} |
39 Release: 20090106 |
39 Release: 20120720 |
40 |
40 |
41 # package options |
41 # package options |
42 %option with_old no |
42 %option with_old no |
43 |
43 |
44 # list of sources |
44 # list of sources |
45 Source0: ftp://ftp.gnu.org/gnu/bison/bison-%{V_new}.tar.gz |
45 Source0: http://ftp.gnu.org/gnu/bison/bison-%{V_new}.tar.gz |
46 Source1: ftp://ftp.gnu.org/gnu/bison/bison-%{V_old}.tar.gz |
46 Source1: http://ftp.gnu.org/gnu/bison/bison-%{V_old}.tar.gz |
47 Patch0: bison.patch |
47 Patch0: bison.patch |
48 |
48 |
49 # build information |
49 # build information |
50 Prefix: %{l_prefix} |
50 BuildPreReq: OpenPKG, openpkg >= 20100101, m4, make |
51 BuildRoot: %{l_buildroot} |
51 PreReq: OpenPKG, openpkg >= 20100101, m4 |
52 BuildPreReq: OpenPKG, openpkg >= 20040212, m4, make |
|
53 PreReq: OpenPKG, openpkg >= 20040212, m4 |
|
54 AutoReq: no |
|
55 AutoReqProv: no |
|
56 Conflicts: yacc |
52 Conflicts: yacc |
57 |
53 |
58 %description |
54 %description |
59 Bison is a general-purpose parser generator that converts a grammar |
55 Bison is a general-purpose parser generator that converts a grammar |
60 description for an LALR(1) context-free grammar into a C program |
56 description for an LALR(1) context-free grammar into a C program |
66 should be able to use bison with little trouble. |
62 should be able to use bison with little trouble. |
67 |
63 |
68 %track |
64 %track |
69 prog bison:new = { |
65 prog bison:new = { |
70 version = %{V_new} |
66 version = %{V_new} |
71 url = ftp://ftp.gnu.org/gnu/bison/ |
67 url = http://ftp.gnu.org/gnu/bison/ |
72 regex = bison-(2.\d+(.\d+)*[a-z]?)\.tar\.gz |
68 regex = bison-(2.\d+(.\d+)*[a-z]?)\.tar\.gz |
73 } |
69 } |
74 prog bison:old = { |
70 prog bison:old = { |
75 version = %{V_old} |
71 version = %{V_old} |
76 url = ftp://ftp.gnu.org/gnu/bison/ |
72 url = http://ftp.gnu.org/gnu/bison/ |
77 regex = bison-(1\.3\d+)\.tar\.gz |
73 regex = bison-(1\.3\d+)\.tar\.gz |
78 } |
74 } |
79 |
75 |
80 %prep |
76 %prep |
81 %setup -q -c -n bison-%{V_new} |
77 %setup -q -c -n bison-%{V_new} |
82 %patch -p0 -d bison-%{V_new} |
78 %patch -p0 -d bison-%{V_new} |
83 %setup -q -T -D -a 1 |
79 %setup -q -T -D -a 1 |
84 %{l_shtool} subst \ |
80 %{l_shtool} subst \ |
|
81 -e 's;ac_config_files.*etc/bench\.pl";;' \ |
|
82 bison-%{V_new}/configure |
|
83 %{l_shtool} subst \ |
85 -e 's;^\( *SUBDIRS = .*\) examples\(.*\)$;\1\2;' \ |
84 -e 's;^\( *SUBDIRS = .*\) examples\(.*\)$;\1\2;' \ |
|
85 -e 's;^\( *SUBDIRS = .*\) tests\(.*\)$;\1\2;' \ |
|
86 -e 's;^\( *SUBDIRS = .*\) etc\(.*\)$;\1\2;' \ |
86 bison-%{V_new}/Makefile.in |
87 bison-%{V_new}/Makefile.in |
|
88 touch bison-%{V_new}/doc/bison.1 |
87 |
89 |
88 %build |
90 %build |
89 ( cd bison-%{V_new} |
91 ( cd bison-%{V_new} |
90 CC="%{l_cc}" \ |
92 CC="%{l_cc}" \ |
91 CFLAGS="%{l_cflags -O}" \ |
93 CFLAGS="%{l_cflags -O}" \ |
92 ./configure \ |
94 CONFIG_SHELL="%{l_bash}" \ |
|
95 GREP="grep" \ |
|
96 "%{l_bash}" configure \ |
93 --prefix=%{l_prefix} \ |
97 --prefix=%{l_prefix} \ |
94 --mandir=%{l_prefix}/man \ |
98 --mandir=%{l_prefix}/man \ |
95 --infodir=%{l_prefix}/info \ |
99 --infodir=%{l_prefix}/info \ |
96 --disable-nls |
100 --disable-nls |
97 %{l_make} -f Makefile %{l_mflags} |
101 %{l_make} -f Makefile %{l_mflags} |
98 ) || exit $? |
102 ) || exit $? |
99 %if "%{with_old}" == "yes" |
103 %if "%{with_old}" == "yes" |
100 ( cd bison-%{V_old} |
104 ( cd bison-%{V_old} |
101 CC="%{l_cc}" \ |
105 CC="%{l_cc}" \ |
102 CFLAGS="%{l_cflags -O}" \ |
106 CFLAGS="%{l_cflags -O}" \ |
|
107 GREP="grep" \ |
103 ./configure \ |
108 ./configure \ |
104 --prefix=%{l_prefix} \ |
109 --prefix=%{l_prefix} \ |
105 --mandir=%{l_prefix}/man \ |
110 --mandir=%{l_prefix}/man \ |
106 --infodir=%{l_prefix}/info \ |
111 --infodir=%{l_prefix}/info \ |
107 --disable-nls |
112 --disable-nls |
108 %{l_make} -f Makefile %{l_mflags} |
113 %{l_make} -f Makefile %{l_mflags} |
109 ) || exit $? |
114 ) || exit $? |
110 %endif |
115 %endif |
111 |
116 |
112 %install |
117 %install |
113 rm -rf $RPM_BUILD_ROOT |
|
114 %if "%{with_old}" == "yes" |
118 %if "%{with_old}" == "yes" |
115 ( cd bison-%{V_old} |
119 ( cd bison-%{V_old} |
116 %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" |
120 %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" |
117 mv $RPM_BUILD_ROOT%{l_prefix}/bin/bison \ |
121 mv $RPM_BUILD_ROOT%{l_prefix}/bin/bison \ |
118 $RPM_BUILD_ROOT%{l_prefix}/bin/bison-old |
122 $RPM_BUILD_ROOT%{l_prefix}/bin/bison-old |