Blob Blame History Raw
Name:           antlrworks
Version:        1.4.3
Release:        9%{?dist}
Summary:        Grammar development environment for ANTLR v3 grammars

Group:          Development/Tools
License:        BSD
URL:            http://www.antlr3.org/works
Source0:        http://www.antlr3.org/download/%{name}-%{version}-src.zip
Source1:        %{name}.desktop
# Disable embedding of dependency jars files into antlrworks jar file
Patch0:         %{name}-1.4-build.patch
# Add xdg-open and epiphany as available web browsers to open help (sent
# upstream)
Patch1:         %{name}-1.4-browsers.patch
# Fix compilation with JGoodies Forms >= 1.4.2
Patch2:         %{name}-1.4-jgoodies-forms_1.4.2.patch
# Fix compilation with OpenJDK 7
Patch3:         %{name}-1.4.3-jdk7.patch
# Fix compilation with JGoodies Forms >= 1.6.0
Patch4:         %{name}-1.4.3-jgoodies-forms_1.6.0.patch
# Fix compilation with JGoodies Forms >= 1.7.1
Patch5:         %{name}-1.4.3-jgoodies-forms_1.7.1.patch

BuildRequires:  ant
BuildRequires:  antlr-tool
BuildRequires:  antlr3-tool >= 3.3
BuildRequires:  desktop-file-utils
BuildRequires:  java-devel >= 1:1.6.0
BuildRequires:  jgoodies-forms >= 1.7.1
BuildRequires:  stringtemplate
Requires:       antlr-tool
Requires:       antlr3-tool >= 3.3
Requires:       graphviz
# Owns /usr/share/icons/hicolor
Requires:       hicolor-icon-theme
# Antlrworks requires javac
Requires:       java-devel >= 1:1.6.0
Requires:       jgoodies-forms >= 1.7.1
BuildArch:      noarch

%description
ANTLRWorks is a novel grammar development environment for ANTLR v3 grammars
written by Jean Bovet (with suggested use cases from Terence Parr). It combines
an excellent grammar-aware editor with an interpreter for rapid prototyping and
a language-agnostic debugger for isolating grammar errors. ANTLRWorks helps
eliminate grammar nondeterminisms, one of the most difficult problems for
beginners and experts alike, by highlighting nondeterministic paths in the
syntax diagram associated with a grammar. ANTLRWorks' goal is to make grammars
more accessible to the average programmer, improve maintainability and
readability of grammars by providing excellent grammar navigation and
refactoring tools, and address the most common questions and problems
encountered by grammar developers.


%prep
%setup -q -c
%patch0 -p0 -b .build
%patch1 -p1 -b .browsers
%patch2 -p0 -b .jgoodies-forms_1.4.2
%patch3 -p1 -b .jdk7
%patch4 -p0 -b .jgoodies-forms_1.6.0
%patch5 -p0 -b .jgoodies-forms_1.7.1

find -name '*.class' -o -name '*.jar' -exec rm '{}' \;


%build
export CLASSPATH=$(build-classpath antlr antlr3 antlr3-runtime jgoodies-forms stringtemplate stringtemplate4)
ant build


%install
install -Dpm 0644 dist/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar

%jpackage_script org.antlr.works.IDE "-Xmx400m" "" antlrworks:antlr:antlr3:antlr3-runtime:jgoodies-common:jgoodies-forms:stringtemplate:stringtemplate4 %{name} true

desktop-file-install \
  --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE1}

install -Dpm 0644 resources/icons/app.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
for i in 16 32 64; do
  install -Dpm 0644 resources/icons/app_${i}x$i.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x$i/apps/%{name}.png
done

desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop


%post
touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null || :


%postun
if [ $1 -eq 0 ]; then
  touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null
  gtk-update-icon-cache %{_datadir}/icons/hicolor/ &>/dev/null || :
fi


%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor/ &>/dev/null || :


%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/apps/*.png
%{_javadir}/*.jar


%changelog
* Sat May 11 2013 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4.3-9
- Fix compilation with JGoodies Forms 1.7.1

* Tue Jan 29 2013 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4.3-8
- Fix compilation with JGoodies Forms 1.6.0 (thanks to Mary Ellen Foster)

* Mon Jan 28 2013 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4.3-7
- Add missing Requires on antlr-tool (RHBZ #904572), until RHBZ #904979 is fixed

* Sat Jul 21 2012 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4.3-6
- Add stringtemplate as BuildRequires

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Feb 16 2012 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4.3-4
- Add missing jgoodies-common jar in wrapper script

* Tue Feb 07 2012 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4.3-3
- Add version condition on antlr3-tool
- Fix wrapper script generation

* Thu Feb 02 2012 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4.3-2
- Remove unintended line break

* Thu Feb 02 2012 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4.3-1
- Update to 1.4.3

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Dec 21 2011 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.4-6
- Add jgoodies-common jar in the launcher classpath
- Fix compilation with JGoodies Common 1.4.2
- Spec cleanup

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sat Jun 12 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.4-4
- Bump release

* Fri Jun  4 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.4-3
- Remove manual installation of antlrworks.desktop (managed by
  desktop-file-install)

* Thu Jun  3 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.4-2
- Remove release.txt and readme.txt from sources
- Add hicolor-icon-theme as a Requires since it owns
  %%{_datadir}/icons/hicolor
- Add call to desktop-file-install

* Fri May 14 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.4-1
- Initial RPM release