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

Group:          Development/Tools
License:        BSD
URL:            http://www.antlr3.org/works
Source0:        https://github.com/antlr/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
Source2:        %{name}.appdata.xml
# Fix compilation with JGoodies Forms >= 1.7.1
Patch0:         %{name}-1.5.2-jgoodies-forms_1.7.1.patch
# Add xdg-open to the list of available browsers to open the help
Patch1:         %{name}-1.5.2-browsers.patch

BuildRequires:  desktop-file-utils
BuildRequires:  libappstream-glib
BuildRequires:  maven-local
BuildRequires:  mvn(com.jgoodies:jgoodies-forms)
BuildRequires:  mvn(org.antlr:antlr)
BuildRequires:  mvn(org.antlr:antlr-runtime)
BuildRequires:  mvn(org.antlr:stringtemplate)
BuildRequires:  mvn(org.sonatype.oss:oss-parent:pom:)
Requires:       graphviz
# Owns /usr/share/icons/hicolor
Requires:       hicolor-icon-theme
# Antlrworks requires javac
Requires:       java-devel >= 1:1.6.0
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
%autosetup -p0

# Remove MacOSX-specific code
rm -r src/org/antlr/xjlib/appkit/app/MacOS/

%pom_remove_dep com.apple:AppleJavaExtensions
%pom_change_dep com.jgoodies:forms com.jgoodies:jgoodies-forms


%build
%mvn_build -j


%install
%mvn_install

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

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

install -Dpm 0644 %{SOURCE2} $RPM_BUILD_ROOT/%{_datadir}/appdata/%{name}.appdata.xml


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

appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml


%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 -f .mfiles
%doc History.txt
%{_bindir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/apps/*.*
%{_datadir}/appdata/*.appdata.xml


%changelog
* Tue Feb 14 2017 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.5.2-6
- Build antlrworks using Maven
- Spec cleanup
- Add AppData file

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Jul 27 2015 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.5.2-3
- Fix build with latest versions of stringtemplate4

* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Jul 11 2014 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.5.2-1
- Update to 1.5.2

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* 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 Mohamed El Morabity <melmorabity@fedoraproject.org> 1.4-4
- Bump release

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

* Thu Jun  3 2010 Mohamed El Morabity <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 Mohamed El Morabity <melmorabity@fedoraproject.org> 1.4-1
- Initial RPM release