%global eclipse_base %{_libdir}/eclipse
%global install_loc %{_datadir}/eclipse/dropins/checkstyle
%global cs_ver 5.1
%global eclipse_ver 3.5
Summary: Checkstyle plugin for Eclipse
Name: eclipse-checkstyle
Version: 5.1.0
Release: 9%{?dist}
License: LGPLv2+
Group: Development/Tools
URL: http://eclipse-cs.sourceforge.net
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
Source0: %{name}-%{version}.tar.xz
Source10: eclipse-eclipsecs-fetch-src.sh
Patch0: itext-rtf-remove.patch
Patch1: unpack-plugins.patch
Patch2: remove-double-locking-check.patch
Requires: eclipse-platform >= 1:%{eclipse_ver}
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
BuildRequires: java-devel
BuildRequires: jpackage-utils >= 0:1.5
BuildRequires: eclipse-pde >= 1:%{eclipse_ver}
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: jfreechart
BuildRequires: dom4j
%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
%patch0 -R
%patch1
%patch2
find -name '*.class' -exec rm -f '{}' \;
find -name '*.jar' -exec rm -f '{}' \;
sed -i -e "s|checkstyle-all-5.1.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
ln -s $(build-classpath checkstyle) net.sf.eclipsecs.checkstyle/checkstyle.jar
ln -s $(build-classpath antlr) net.sf.eclipsecs.checkstyle/antlr.jar
ln -s $(build-classpath guava) net.sf.eclipsecs.checkstyle/guava.jar
ln -s $(build-classpath commons-beanutils) net.sf.eclipsecs.checkstyle/commons-beanutils.jar
ln -s $(build-classpath commons-collections) net.sf.eclipsecs.checkstyle/commons-collections.jar
ln -s $(build-classpath commons-logging) net.sf.eclipsecs.checkstyle/commons-logging.jar
ln -s %{_javadir}/commons-io.jar net.sf.eclipsecs.core/lib/commons-io-1.2.jar
ln -s %{_javadir}/commons-lang.jar net.sf.eclipsecs.core/lib/commons-lang-2.3.jar
ln -s %{_javadir}/dom4j.jar net.sf.eclipsecs.core/lib/dom4j-1.6.1.jar
ln -s %{_javadir}/jcommon.jar net.sf.eclipsecs.ui/lib/jcommon-1.0.9.jar
ln -s %{_javadir}/jfreechart/jfreechart.jar net.sf.eclipsecs.ui/lib/jfreechart-1.0.5.jar
ln -s %{_javadir}/itext.jar net.sf.eclipsecs.ui/lib/itext-2.0.1.jar
rm -fr net.sf.eclipsecs.ui/src/net/sf/eclipsecs/ui/stats/export/internal/RTFStatsExporter.java
%build
eclipse-pdebuild -f net.sf.eclipsecs
%install
install -d -m 755 $RPM_BUILD_ROOT%{install_loc}
unzip -q -o -d $RPM_BUILD_ROOT%{install_loc} \
build/rpmBuild/net.sf.eclipsecs.zip
pushd $RPM_BUILD_ROOT%{install_loc}/eclipse/plugins
rm -fr net.sf.eclipsecs.checkstyle_0.0.0/*.jar
ln -s $(build-classpath checkstyle) net.sf.eclipsecs.checkstyle_0.0.0/checkstyle.jar
ln -s $(build-classpath guava) net.sf.eclipsecs.checkstyle_0.0.0/guava.jar
ln -s $(build-classpath antlr) net.sf.eclipsecs.checkstyle_0.0.0/antlr.jar
ln -s $(build-classpath commons-beanutils) net.sf.eclipsecs.checkstyle_0.0.0/commons-beanutils.jar
ln -s $(build-classpath commons-collections) net.sf.eclipsecs.checkstyle_0.0.0/commons-collections.jar
ln -s $(build-classpath commons-logging) net.sf.eclipsecs.checkstyle_0.0.0/commons-logging.jar
rm -fr net.sf.eclipsecs.core_0.0.0/lib/*.jar
ln -s %{_javadir}/commons-io.jar net.sf.eclipsecs.core_0.0.0/lib/commons-io-1.2.jar
ln -s %{_javadir}/commons-lang.jar net.sf.eclipsecs.core_0.0.0/lib/commons-lang-2.3.jar
ln -s %{_javadir}/dom4j.jar net.sf.eclipsecs.core_0.0.0/lib/dom4j-1.6.1.jar
rm -fr net.sf.eclipsecs.ui_0.0.0/lib/*.jar
ln -s %{_javadir}/jcommon.jar net.sf.eclipsecs.ui_0.0.0/lib/jcommon-1.0.9.jar
ln -s %{_javadir}/jfreechart/jfreechart.jar net.sf.eclipsecs.ui_0.0.0/lib/jfreechart-1.0.5.jar
ln -s %{_javadir}/itext.jar net.sf.eclipsecs.ui_0.0.0/lib/itext-2.0.1.jar
popd
%files
%doc net.sf.eclipsecs-feature/license.html
%{install_loc}
%changelog
* 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