# This is a post-release snapshot due to upstream not tagging
# their releases
%global git_tag 18383ddec6f6af9f60646db673dcb298d6c290b1
%global git_short_tag %(c=%{git_tag}; echo ${c:0:7})
Name: eclipse-xtext-antlr-generator
Version: 2.1.1
Release: 6.git%{git_short_tag}%{?dist}
Summary: Xtext adapter to ANTLR's generator
License: EPL
URL: http://www.xtext.org
Source0: https://github.com/xtext/org.xtext.antlr.generator/archive/%{git_tag}.tar.gz
# Unbundle antlr 3.2
Patch0: unbundle-antlr.patch
BuildArch: noarch
BuildRequires: tycho
BuildRequires: antlr32-java >= 3.2-12
BuildRequires: antlr32-tool >= 3.2-12
BuildRequires: stringtemplate
BuildRequires: antlr
Requires: antlr32-java >= 3.2-12
Requires: antlr32-tool >= 3.2-12
Requires: stringtemplate
Requires: antlr
%description
Xtext adapter to ANTLR's generator.
%prep
%setup -q -n org.xtext.antlr.generator-%{git_tag}
%patch0
find -name *.jar -exec rm -rf {} \;
find -name *.class -exec rm -rf {} \;
# Remove bundled antlr32 and symlink to system version instead
rm -rf org.antlr.generator/{antlr,org,source-bundle}
mkdir org.antlr.generator/antlr
build-jar-repository -s -p org.antlr.generator/antlr \
stringtemplate antlr antlr32/antlr-3.2
# Remove stuff we are not interested in building
rm -r de.itemis.antlr.xtext.updatesite \
de.itemis.xtext.antlr.{{build,sdk,tests}.feature,releng,tests}
# Remove unused log4j dependency
sed -i -e '/org\.apache\.log4j/d' de.itemis.xtext.antlr/META-INF/MANIFEST.MF
# Generate poms
find -name pom.xml -delete
xmvn -o org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms -DgroupId=org.eclipse.xtext
# Don't install poms
%mvn_package "::pom::" __noinstall
%build
%mvn_build -j
%install
%mvn_install
# Need to recreate the symlinks to libraries that were setup in "prep"
# This will cause some benign dangling-symlink rpmlint warnings
pushd %{buildroot}%{_datadir}/eclipse/*/xtext-antlr-generator/eclipse/plugins/org.antlr.generator_*
rm antlr/*.jar
build-jar-repository -s -p antlr \
stringtemplate antlr antlr32/antlr-3.2
popd
%files -f .mfiles
%license de.itemis.xtext.antlr.feature/epl-v10.html
%changelog
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-6.git18383dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-5.git18383dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-4.git18383dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 24 2015 Mat Booth <mat.booth@redhat.com> - 2.1.1-3.git18383dd
- Update dep on antlr32
* Fri Nov 20 2015 Mat Booth <mat.booth@redhat.com> - 2.1.1-2.git18383dd
- Use license macro
* Wed Nov 18 2015 Mat Booth <mat.booth@redhat.com> - 2.1.1-1.git18383dd
- Initial packaging