]> git.pld-linux.org Git - packages/javacc.git/blob - javacc.spec
fix bootstrap
[packages/javacc.git] / javacc.spec
1 #
2 #
3 # Conditional build:
4 %bcond_with     bootstrap               # bootstrap build
5
6 Summary:        A parser/scanner generator for Java
7 Summary(pl.UTF-8):      Generator analizatorów/skanerów dla Javy
8 Name:           javacc
9 Version:        5.0
10 Release:        1
11 License:        BSD
12 Group:          Development/Languages/Java
13 Source0:        http://java.net/projects/javacc/downloads/download/%{name}-%{version}src.tar.gz
14 # Source0-md5:  871d78a2a5859c2eebc712c1f8135be5
15 Source1:        %{name}
16 Source2:        jjdoc
17 Source3:        jjtree
18 Patch0:         build.xml.patch
19 URL:            https://javacc.dev.java.net/
20 BuildRequires:  /bin/bash
21 BuildRequires:  ant
22 BuildRequires:  glibc-localedb-all
23 BuildRequires:  java-junit >= 3.8.1
24 %{!?with_bootstrap:BuildRequires:       javacc}
25 BuildRequires:  jpackage-utils
26 BuildRequires:  rpmbuild(macros) >= 1.300
27 Requires:       jpackage-utils >= 1.5
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 Java Compiler Compiler (JavaCC) is the most popular parser generator
33 for use with Java applications. A parser generator is a tool that
34 reads a grammar specification and converts it to a Java program that
35 can recognize matches to the grammar. In addition to the parser
36 generator itself, JavaCC provides other standard capabilities related
37 to parser generation such as tree building (via a tool called JJTree
38 included with JavaCC), actions, debugging, etc.
39
40 %description -l pl.UTF-8
41 Java Compiler Compiler (JavaCC) to najbardziej popularny generator
42 analizatorów do używania w aplikacjach Javy. Generator analizatorów to
43 narzędzie czytające specyfikację gramatyki i przekształcające ją na
44 program w Javie rozpoznający dopasowania do gramatyki. Oprócz samego
45 generatora analizatorów JavaCC udostępnia inne standardowe możliwości
46 związane z generowaniem analizatorów, takie jak budowanie drzewa
47 (poprzez narzędzie o nazwie JJTree dołączone do JavaCC), akcje,
48 diagnostykę itp.
49
50 %package manual
51 Summary:        Manual for JavaCC
52 Summary(pl.UTF-8):      Podręcznik do JavaCC
53 Group:          Documentation
54
55 %description manual
56 Manual for JavaCC.
57
58 %description manual -l pl.UTF-8
59 Podręcznik do JavaCC.
60
61 %package demo
62 Summary:        Examples for JavaCC
63 Summary(pl.UTF-8):      Przykłady do JavaCC
64 Group:          Documentation
65
66 %description demo
67 Examples for JavaCC.
68
69 %description demo -l pl.UTF-8
70 Przykłady do JavaCC.
71
72 %prep
73 %setup -qc
74 mv %{name}/* .; rmdir %{name}
75 %patch0 -p1
76
77 cp -p %{SOURCE1} javacc
78 cp -p %{SOURCE2} jjdoc
79 cp -p %{SOURCE3} jjtree
80
81 # Remove binary information in the source tar
82 rm lib/junit3.8.1/junit.jar
83 %if %{without bootstrap}
84 rm bootstrap/javacc.jar
85 %endif
86
87 find examples -type f | xargs %undos
88
89 sed -i -e 's/source="1.4"/source="1.5"/g' src/org/javacc/{parser,jjdoc,jjtree}/build.xml
90
91 mv www/doc .
92
93 %build
94 %if %{without bootstrap}
95 # Use the bootstrap javacc.jar to generate some required
96 # source java files. After these source files are generated we
97 # remove the bootstrap jar and build the binary from source.
98 jar=$(find-jar javacc)
99 ln -sf $jar bootstrap/javacc.jar
100 %endif
101
102 %ant -f src/org/javacc/parser/build.xml parser-files
103 %ant -f src/org/javacc/jjtree/build.xml tree-files
104
105 required_jars="junit"
106 export CLASSPATH=$(build-classpath $required_jars)
107
108 %ant \
109         jar
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113 install -d $RPM_BUILD_ROOT%{_javadir}
114 cp -p bin/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
115 ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
116
117 install -d $RPM_BUILD_ROOT%{_bindir}
118 install -p javacc jjdoc jjtree $RPM_BUILD_ROOT%{_bindir}
119
120 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
121 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %files
127 %defattr(644,root,root,755)
128 %doc LICENSE README
129 %attr(755,root,root) %{_bindir}/javacc
130 %attr(755,root,root) %{_bindir}/jjdoc
131 %attr(755,root,root) %{_bindir}/jjtree
132 %{_javadir}/javacc-%{version}.jar
133 %{_javadir}/javacc.jar
134
135 %files manual
136 %defattr(644,root,root,755)
137 %doc doc/*
138
139 %files demo
140 %defattr(644,root,root,755)
141 %{_examplesdir}/%{name}-%{version}
This page took 0.066989 seconds and 4 git commands to generate.