%global install_loc %{_datadir}/eclipse/dropins/checkstyle
%global cs_ver 5.6
Summary: Checkstyle plugin for Eclipse
Name: eclipse-checkstyle
Version: 5.6.1
Release: 4%{?dist}
License: LGPLv2+
Group: Development/Tools
URL: http://eclipse-cs.sourceforge.net
BuildArch: noarch
# Source tarball generated from the below shell script
Source0: %{name}-%{version}.tar.xz
# Script to generate above tarball
Source10: eclipse-eclipsecs-fetch-src.sh
# Unpack plugins so we can symlink to system jars
Patch1: unpack-plugins.patch
Requires: eclipse-platform
Requires: eclipse-jdt
Requires: checkstyle >= 0:%{cs_ver}
Requires: antlr-tool
Requires: guava
Requires: apache-commons-beanutils
Requires: apache-commons-collections
Requires: apache-commons-io
Requires: apache-commons-lang
Requires: apache-commons-logging
Requires: dom4j
Requires: jfreechart
Requires: jfreechart-swt
BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: maven-local
BuildRequires: tycho
BuildRequires: xml-maven-plugin
BuildRequires: eclipse-pde
BuildRequires: checkstyle >= 0:%{cs_ver}
BuildRequires: antlr-tool
BuildRequires: guava
BuildRequires: apache-commons-beanutils
BuildRequires: apache-commons-collections
BuildRequires: apache-commons-io
BuildRequires: apache-commons-lang
BuildRequires: apache-commons-logging
BuildRequires: dom4j
BuildRequires: jfreechart
BuildRequires: jfreechart-swt
%description
The Eclipse Checkstyle plugin integrates the Checkstyle Java code
auditor into the Eclipse IDE. The plugin provides real-time feedback
to the user about violations of rules that check for coding style and
possible error prone code constructs.
%prep
%setup -q
%patch1
# Delete pre-built binaries
find -name '*.class' -exec rm -f '{}' \;
find -name '*.jar' -exec rm -f '{}' \;
find -name '*.zip' -exec rm -f '{}' \;
# Fix checkstyle libs manifest
sed -i -e "s|checkstyle-%{cs_ver}-all.jar|checkstyle.jar,antlr.jar,guava.jar,commons-beanutils.jar,commons-collections.jar,commons-logging.jar|g" \
net.sf.eclipsecs.checkstyle/META-INF/MANIFEST.MF net.sf.eclipsecs.checkstyle/build.properties
sed -i -e "s|Bundle-ActivationPolicy: lazy|Bundle-ActivationPolicy: lazy\nEclipse-BundleShape: dir|g" net.sf.eclipsecs.core/META-INF/MANIFEST.MF
sed -i -e "s|Bundle-ActivationPolicy: lazy|Bundle-ActivationPolicy: lazy\nEclipse-BundleShape: dir|g" net.sf.eclipsecs.ui/META-INF/MANIFEST.MF
pushd net.sf.eclipsecs.checkstyle
ln -s $(build-classpath checkstyle) checkstyle.jar
ln -s $(build-classpath guava) guava.jar
ln -s $(build-classpath antlr) antlr.jar
ln -s $(build-classpath commons-beanutils) commons-beanutils.jar
ln -s $(build-classpath commons-collections) commons-collections.jar
ln -s $(build-classpath commons-logging) commons-logging.jar
popd
pushd net.sf.eclipsecs.core
ln -s %{_javadir}/commons-io.jar lib/commons-io-1.2.jar
ln -s %{_javadir}/commons-lang.jar lib/commons-lang-2.3.jar
ln -s %{_javadir}/dom4j.jar lib/dom4j-1.6.1.jar
popd
pushd net.sf.eclipsecs.ui
ln -s %{_javadir}/jcommon/jcommon.jar lib/jcommon-1.0.16.jar
ln -s %{_javadir}/jfreechart/jfreechart.jar lib/jfreechart-1.0.14.jar
ln -s %{_javadir}/jfreechart/jfreechart-swt.jar lib/jfreechart-1.0.14-swt.jar
popd
%pom_disable_module ../net.sf.eclipsecs-updatesite net.sf.eclipsecs.parent/pom.xml
%build
%mvn_build -j -- -f net.sf.eclipsecs.parent/pom.xml
%install
%mvn_install
pushd $RPM_BUILD_ROOT%{install_loc}/eclipse/plugins/net.sf.eclipsecs.checkstyle_*
rm *.jar
ln -s $(build-classpath checkstyle) checkstyle.jar
ln -s $(build-classpath guava) guava.jar
ln -s $(build-classpath antlr) antlr.jar
ln -s $(build-classpath commons-beanutils) commons-beanutils.jar
ln -s $(build-classpath commons-collections) commons-collections.jar
ln -s $(build-classpath commons-logging) commons-logging.jar
popd
pushd $RPM_BUILD_ROOT%{install_loc}/eclipse/plugins/net.sf.eclipsecs.core_*
rm lib/*.jar
ln -s %{_javadir}/commons-io.jar lib/commons-io-1.2.jar
ln -s %{_javadir}/commons-lang.jar lib/commons-lang-2.3.jar
ln -s %{_javadir}/dom4j.jar lib/dom4j-1.6.1.jar
popd
pushd $RPM_BUILD_ROOT%{install_loc}/eclipse/plugins/net.sf.eclipsecs.ui_*
rm lib/*.jar
ln -s %{_javadir}/jcommon.jar lib/jcommon-1.0.16.jar
ln -s %{_javadir}/jfreechart/jfreechart.jar lib/jfreechart-1.0.14.jar
ln -s %{_javadir}/jfreechart/jfreechart-swt.jar lib/jfreechart-1.0.14-swt.jar
popd
%files -f .mfiles
%doc net.sf.eclipsecs-feature/license.html
%changelog
* Fri Dec 5 2014 Alexander Kurtakov <akurtako@redhat.com> 5.6.1-4
- Build with xmvn.
* Wed Sep 17 2014 Alexander Kurtakov <akurtako@redhat.com> 5.6.1-3
- Fix build for new jcommon path.
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Aug 16 2013 Mat Booth <fedora@matbooth.co.uk> 5.6.1-1
- Update to 5.6.1
- Build with maven/tycho
- Drop upstreamed patches
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Mon Apr 22 2013 Mat Booth <fedora@matbooth.co.uk> 5.1.0-8
- Fix broken symlink to beanutils, remove unused patches.
- Add missing runtime requirements.
- Patch out checks that have been removed in later versions of checkstyle.
- Minor changes to conform better to guidelines.
* Thu Feb 21 2013 Alexander Kurtakov <akurtako@redhat.com> 5.1.0-7
- Switch to eclipse-pdebuild command.
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Oct 25 2010 Alexander Kurtakov <akurtako@redhat.com> 5.1.0-2
- Don't have strict requires on checkstyle.
* Wed Jul 7 2010 Alexander Kurtakov <akurtako@redhat.com> 5.1.0-1
- Update to 5.1.
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Tue Jul 21 2009 Alexander Kurtakov <akurtako@redhat.com> 4.0.1-13
- Fix build with Eclipse 3.5.
- Remove gcj_support.
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Wed Jul 30 2008 Andrew Overholt <overholt@redhat.com> 4.0.1-11
- Update for Eclipse SDK 3.4
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 4.0.1-10
- Autorebuild for GCC 4.3
* Wed Aug 15 2007 Rob Myers <rob.myers@gtri.gatech.edu> 4.0.1-9
- Require eclipse-jdt because checkstyle isn't useful without it
* Fri Aug 03 2007 Rob Myers <rob.myers@gtri.gatech.edu> 4.0.1-8
- update for eclipse 3.3
* Thu Aug 02 2007 Rob Myers <rob.myers@gtri.gatech.edu> 4.0.1-7
- update license from LGPL to LGPLv2+
* Wed May 16 2007 Rob Myers <rob.myers@gtri.gatech.edu> 4.0.1-6
- remove epoch from changelog
* Tue May 15 2007 Rob Myers <rob.myers@gtri.gatech.edu> 4.0.1-5
- add eclipse_ver
- include licenses
- spec cleanup
* Sat May 12 2007 Rob Myers <rob.myers@gtri.gatech.edu> 4.0.1-4
- add gcj_support
- use wildcard to match eclipse library jar for all build architectures
- fine tune Requires
* Fri May 11 2007 Rob Myers <rob.myers@gtri.gatech.edu> 4.0.1-1
- first build for fc7