diff --git a/checkstyle-4.1-checks-modifier-AllTests.patch b/checkstyle-4.1-checks-modifier-AllTests.patch deleted file mode 100644 index b9ea4e9..0000000 --- a/checkstyle-4.1-checks-modifier-AllTests.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- src/tests/com/puppycrawl/tools/checkstyle/checks/modifier/AllTests.java.sav 2006-02-15 15:14:06.000000000 +0100 -+++ src/tests/com/puppycrawl/tools/checkstyle/checks/modifier/AllTests.java 2006-02-15 15:14:34.000000000 +0100 -@@ -13,8 +13,8 @@ - TestSuite suite = - new TestSuite("Test for com.puppycrawl.tools.checkstyle.checks.modifier"); - -- suite.addTest(new TestSuite(ModifierOrderCheckTest.class)); -- suite.addTest(new TestSuite(RedundantModifierTest.class)); -+// suite.addTest(new TestSuite(ModifierOrderCheckTest.class)); -+// suite.addTest(new TestSuite(RedundantModifierTest.class)); - - return suite; - } diff --git a/checkstyle-4.1-checks-naming-AllTests.patch b/checkstyle-4.1-checks-naming-AllTests.patch deleted file mode 100644 index 146b687..0000000 --- a/checkstyle-4.1-checks-naming-AllTests.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- src/tests/com/puppycrawl/tools/checkstyle/checks/naming/AllTests.java.sav 2006-02-15 15:15:52.000000000 +0100 -+++ src/tests/com/puppycrawl/tools/checkstyle/checks/naming/AllTests.java 2006-02-15 15:16:36.000000000 +0100 -@@ -14,13 +14,13 @@ - new TestSuite("Test for com.puppycrawl.tools.checkstyle.checks.naming"); - - suite.addTest(new TestSuite(AbstractClassNameCheckTest.class)); -- suite.addTest(new TestSuite(ConstantNameCheckTest.class)); -- suite.addTest(new TestSuite(LocalFinalVariableNameCheckTest.class)); -- suite.addTest(new TestSuite(LocalVariableNameCheckTest.class)); -- suite.addTest(new TestSuite(MemberNameCheckTest.class)); -+// suite.addTest(new TestSuite(ConstantNameCheckTest.class)); -+// suite.addTest(new TestSuite(LocalFinalVariableNameCheckTest.class)); -+// suite.addTest(new TestSuite(LocalVariableNameCheckTest.class)); -+// suite.addTest(new TestSuite(MemberNameCheckTest.class)); - suite.addTest(new TestSuite(MethodNameCheckTest.class)); - suite.addTest(new TestSuite(PackageNameCheckTest.class)); -- suite.addTest(new TestSuite(ParameterNameCheckTest.class)); -+// suite.addTest(new TestSuite(ParameterNameCheckTest.class)); - suite.addTest(new TestSuite(StaticVariableNameCheckTest.class)); - suite.addTest(new TestSuite(TypeNameCheckTest.class)); - diff --git a/checkstyle-4.1-checks-sizes-AllTests.patch b/checkstyle-4.1-checks-sizes-AllTests.patch deleted file mode 100644 index 4cea619..0000000 --- a/checkstyle-4.1-checks-sizes-AllTests.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/tests/com/puppycrawl/tools/checkstyle/checks/sizes/AllTests.java.sav 2006-02-15 15:17:15.000000000 +0100 -+++ src/tests/com/puppycrawl/tools/checkstyle/checks/sizes/AllTests.java 2006-02-15 15:17:39.000000000 +0100 -@@ -17,7 +17,7 @@ - suite.addTest(new TestSuite(ExecutableStatementCountCheckTest.class)); - suite.addTest(new TestSuite(FileLengthCheckTest.class)); - suite.addTest(new TestSuite(LineLengthCheckTest.class)); -- suite.addTest(new TestSuite(MethodLengthCheckTest.class)); -+// suite.addTest(new TestSuite(MethodLengthCheckTest.class)); - suite.addTest(new TestSuite(ParameterNumberCheckTest.class)); - - return suite; diff --git a/checkstyle-4.1-checks-whitespace-AllTests.patch b/checkstyle-4.1-checks-whitespace-AllTests.patch deleted file mode 100644 index 2d7f4fb..0000000 --- a/checkstyle-4.1-checks-whitespace-AllTests.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- src/tests/com/puppycrawl/tools/checkstyle/checks/whitespace/AllTests.java.sav 2006-02-15 15:18:32.000000000 +0100 -+++ src/tests/com/puppycrawl/tools/checkstyle/checks/whitespace/AllTests.java 2006-02-15 15:19:28.000000000 +0100 -@@ -15,15 +15,15 @@ - - suite.addTest(new TestSuite(EmptyForInitializerPadCheckTest.class)); - suite.addTest(new TestSuite(EmptyForIteratorPadCheckTest.class)); -- suite.addTest(new TestSuite(MethodParamPadCheckTest.class)); -- suite.addTest(new TestSuite(NoWhitespaceAfterCheckTest.class)); -- suite.addTest(new TestSuite(NoWhitespaceBeforeCheckTest.class)); -- suite.addTest(new TestSuite(OperatorWrapCheckTest.class)); -- suite.addTest(new TestSuite(ParenPadCheckTest.class)); -+// suite.addTest(new TestSuite(MethodParamPadCheckTest.class)); -+// suite.addTest(new TestSuite(NoWhitespaceAfterCheckTest.class)); -+// suite.addTest(new TestSuite(NoWhitespaceBeforeCheckTest.class)); -+// suite.addTest(new TestSuite(OperatorWrapCheckTest.class)); -+// suite.addTest(new TestSuite(ParenPadCheckTest.class)); - suite.addTest(new TestSuite(TabCharacterCheckTest.class)); -- suite.addTest(new TestSuite(TypecastParenPadCheckTest.class)); -- suite.addTest(new TestSuite(WhitespaceAfterCheckTest.class)); -- suite.addTest(new TestSuite(WhitespaceAroundTest.class)); -+// suite.addTest(new TestSuite(TypecastParenPadCheckTest.class)); -+// suite.addTest(new TestSuite(WhitespaceAfterCheckTest.class)); -+// suite.addTest(new TestSuite(WhitespaceAroundTest.class)); - - return suite; - } diff --git a/checkstyle-4.1-grammars-AllTests.patch b/checkstyle-4.1-grammars-AllTests.patch deleted file mode 100644 index 173084f..0000000 --- a/checkstyle-4.1-grammars-AllTests.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- src/tests/com/puppycrawl/tools/checkstyle/grammars/AllTests.java.sav 2006-02-15 15:20:16.000000000 +0100 -+++ src/tests/com/puppycrawl/tools/checkstyle/grammars/AllTests.java 2006-02-15 15:20:40.000000000 +0100 -@@ -16,9 +16,9 @@ - //$JUnit-BEGIN$ - suite.addTest(new TestSuite(GeneratedJava14LexerTest.class)); - suite.addTest(new TestSuite(Post13KeywordsAsIdentifiersOKTest.class)); -- suite.addTest(new TestSuite(HexFloatsTest.class)); -+// suite.addTest(new TestSuite(HexFloatsTest.class)); - suite.addTest(new TestSuite(EmbeddedNullCharTest.class)); -- suite.addTest(new TestSuite(VarargTest.class)); -+// suite.addTest(new TestSuite(VarargTest.class)); - //$JUnit-END$ - return suite; - } diff --git a/checkstyle-4.1-script b/checkstyle-4.1-script deleted file mode 100644 index d6b8c21..0000000 --- a/checkstyle-4.1-script +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# Checkstyle script -# JPackage Project -# $Id: checkstyle.checkstyle.script,v 1.1 2002/07/11 17:37:37 scop Exp $ - -# Source functions library -if [ -f /usr/share/java-utils/java-functions ] ; then - . /usr/share/java-utils/java-functions -else - echo "Can't find functions library, aborting" - exit 1 -fi - -# Configuration -MAIN_CLASS=com.puppycrawl.tools.checkstyle.Main -BASE_JARS="checkstyle.jar antlr.jar regexp.jar jakarta-commons-beanutils.jar jakarta-commons-cli.jar jakarta-commons-logging.jar jakarta-commons-collections.jar jaxp_parser_impl.jar" -CLASSPATH=$CLASSPATH:$(build-classpath checkstyle-optional 2>/dev/null) || : - -# Set parameters -set_jvm -set_classpath $BASE_JARS -set_flags $BASE_FLAGS -set_options $BASE_OPTIONS - -# Let's start -run "$@" diff --git a/checkstyle-4.1.catalog b/checkstyle-4.1.catalog deleted file mode 100644 index 190f1ed..0000000 --- a/checkstyle-4.1.catalog +++ /dev/null @@ -1,17 +0,0 @@ --- Checkstyle DTD catalog -- --- JPackage Project -- - -PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" - configuration_1_2.dtd - -PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" - configuration_1_1.dtd - -PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.0//EN - configuration_1_0.dtd - -PUBLIC "-//Puppy Crawl//DTD Package Names 1.0//EN" - packages_1_0.dtd - -PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" - suppressions_1_0.dtd diff --git a/checkstyle-build.patch b/checkstyle-build.patch new file mode 100644 index 0000000..3bb1438 --- /dev/null +++ b/checkstyle-build.patch @@ -0,0 +1,78 @@ +diff --git a/build.xml b/build.xml +index b06580a..8e53668 100644 +--- a/build.xml ++++ b/build.xml +@@ -12,10 +12,10 @@ + + + +- ++ + +- +- ++ ++ + + + +@@ -299,7 +299,7 @@ + excludes="**/Generated*.java,**/gui/*"/> + + +- ++ + + + +@@ -508,8 +508,8 @@ For users of JDK 1.5 at least version 1.6.2 of Ant is required. + filesetmanifest="skip"> + + +- +- ++ ++ + + + +@@ -589,7 +589,7 @@ For users of JDK 1.5 at least version 1.6.2 of Ant is required. + Windowtitle="Checkstyle API" + classpathref="javadoc.classpath" + Use="true" +- Footer="<a target="_top" href="./{@docRoot}/../index.html">Back to the Checkstyle Home Page</a>" ++ Footer="<a target="_top" href="/usr/share/doc/checkstyle-manual-5.1/index.html">Back to the Checkstyle Home Page</a>" + useExternalFile="yes" + encoding="iso-8859-1" + source="${checkstyle.minimum.javaversion}" +@@ -636,10 +636,11 @@ For users of JDK 1.5 at least version 1.6.2 of Ant is required. + path="${checkstyle.dest}"> + + +- ++ + + + +@@ -648,7 +649,7 @@ For users of JDK 1.5 at least version 1.6.2 of Ant is required. + + + +- ++ + + + +# $Id: checkstyle.checkstyle.script,v 1.1 2002/07/11 17:37:37 scop Exp $ + +# Source functions library +if [ -f /usr/share/java-utils/java-functions ] ; then + . /usr/share/java-utils/java-functions +else + echo "Can't find functions library, aborting" + exit 1 +fi + +# Configuration +MAIN_CLASS=com.puppycrawl.tools.checkstyle.Main +BASE_JARS="checkstyle.jar antlr.jar regexp.jar jakarta-commons-beanutils.jar jakarta-commons-cli.jar jakarta-commons-logging.jar jakarta-commons-collections.jar jaxp_parser_impl.jar" +CLASSPATH=$CLASSPATH:$(build-classpath checkstyle-optional 2>/dev/null) || : + +# Set parameters +set_jvm +set_classpath $BASE_JARS +set_flags $BASE_FLAGS +set_options $BASE_OPTIONS + +# Let's start +run "$@" diff --git a/checkstyle.catalog b/checkstyle.catalog new file mode 100644 index 0000000..190f1ed --- /dev/null +++ b/checkstyle.catalog @@ -0,0 +1,17 @@ +-- Checkstyle DTD catalog -- +-- JPackage Project -- + +PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" + configuration_1_2.dtd + +PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" + configuration_1_1.dtd + +PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.0//EN + configuration_1_0.dtd + +PUBLIC "-//Puppy Crawl//DTD Package Names 1.0//EN" + packages_1_0.dtd + +PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" + suppressions_1_0.dtd diff --git a/checkstyle.spec b/checkstyle.spec index e01b307..615ca6f 100644 --- a/checkstyle.spec +++ b/checkstyle.spec @@ -29,44 +29,24 @@ # Name: checkstyle -Version: 4.1 -Release: 7%{?dist} -Epoch: 0 +Version: 5.1 +Release: 1%{?dist} Summary: Java source code checker # src/checkstyle/com/puppycrawl/tools/checkstyle/grammars/java.g is GPLv2+ # Most of the files in contrib/usage/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/transmogrify/ are BSD License: LGPLv2+ and GPLv2+ and BSD Group: Development/Tools -Source0: http://download.sf.net/checkstyle/checkstyle-src-4.1.tar.gz -Source1: %{name}-%{version}-script -Source2: %{name}-%{version}.catalog - -Patch0: %{name}-%{version}-build.patch -#Patch1: %{name}-%{version}-javadoc-crosslink.patch - -Patch2: %{name}-%{version}-checks-AllTests.patch -Patch3: %{name}-%{version}-checks-blocks-AllTests.patch -Patch4: %{name}-%{version}-checks-coding-AllTests.patch -Patch5: %{name}-%{version}-checks-design-AllTests.patch -Patch6: %{name}-%{version}-checks-imports-AllTests.patch -Patch7: %{name}-%{version}-checks-indentation-AllTests.patch -Patch8: %{name}-%{version}-checks-javadoc-AllTests.patch -Patch9: %{name}-%{version}-checks-metrics-AllTests.patch -Patch10: %{name}-%{version}-checks-modifier-AllTests.patch -Patch11: %{name}-%{version}-checks-naming-AllTests.patch -Patch12: %{name}-%{version}-checks-sizes-AllTests.patch -Patch13: %{name}-%{version}-checks-whitespace-AllTests.patch -Patch14: %{name}-%{version}-grammars-AllTests.patch +Source0: http://download.sf.net/checkstyle/checkstyle-src-%{version}.tar.gz +Source1: %{name}-script +Source2: %{name}.catalog + +Patch0: %{name}-build.patch URL: http://checkstyle.sourceforge.net/ -Requires: ant >= 0:1.6 -Requires: antlr >= 0:2.7.1, regexp >= 0:1.2, jakarta-commons-logging -Requires: jakarta-commons-cli, jakarta-commons-beanutils -Requires: jakarta-commons-collections, jpackage-utils >= 0:1.5 -Requires: jaxp_parser_impl BuildRequires: ant >= 0:1.6, ant-nodeps >= 0:1.6 BuildRequires: ant-junit >= 0:1.6, junit, antlr >= 0:2.7.1 -BuildRequires: java-devel >= 1.6.0 +BuildRequires: ant-trax +BuildRequires: java-devel >= 1:1.6.0 BuildRequires: jakarta-commons-beanutils BuildRequires: jakarta-commons-cli, xalan-j2, jpackage-utils >= 0:1.5 BuildRequires: jakarta-commons-logging, jakarta-commons-collections, xerces-j2 @@ -74,6 +54,14 @@ BuildRequires: antlr-javadoc, xml-commons-apis-javadoc BuildRequires: jakarta-commons-beanutils-javadoc, ant-javadoc, /usr/bin/perl BuildRequires: jdom BuildRequires: velocity +BuildRequires: emma +BuildRequires: junit4 +BuildRequires: guava +Requires: ant >= 0:1.6 +Requires: antlr >= 0:2.7.1, regexp >= 0:1.2, jakarta-commons-logging +Requires: jakarta-commons-cli, jakarta-commons-beanutils +Requires: jakarta-commons-collections, jpackage-utils >= 0:1.5 +Requires: jaxp_parser_impl Requires: antlr >= 0:2.7.1 Requires: java Requires: jpackage-utils @@ -87,6 +75,8 @@ Requires: velocity BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Obsoletes: %{name}-optional < %{version}-%{release} + %description A tool for checking Java source code for adherence to a set of rules. @@ -112,39 +102,20 @@ Summary: Manual for %{name} %description manual Manual for %{name}. -%package optional -Group: Development/Tools -Summary: Optional functionality for %{name} -Requires: %{name} = %{epoch}:%{version} -Requires(post): sed -Requires(postun): sed - -%description optional -Optional functionality for %{name}. - %prep %setup -q -n %{name}-src-%{version} -%patch0 -b .sav -#%patch1 -p0 -%patch2 -b .sav -%patch3 -b .sav -%patch4 -b .sav -%patch5 -b .sav -%patch6 -b .sav -%patch7 -b .sav -%patch8 -b .sav -%patch9 -b .sav -%patch10 -b .sav -%patch11 -b .sav -%patch12 -b .sav -%patch13 -b .sav -%patch14 -b .sav +%patch0 -p1 -b .sav %__perl -p -i -e 's|\./{\@docRoot}/\.\./index\.html|%{_docdir}/%{name}-manual-%{version}/index.html|' build.xml # remove all binary libs find . -name "*.jar" -exec %__rm -f {} \; +# fix encoding issues in docs +sed -i 's/\r//' LICENSE LICENSE.apache20 README RIGHTS.antlr \ + build.xml checkstyle_checks.xml sun_checks.xml suppressions.xml \ + src/xdocs/css/*.css contrib/hooks/*.pl + %build -export OPT_JAR_LIST="ant/ant-junit junit ant/ant-nodeps jdom velocity" +export OPT_JAR_LIST="ant/ant-junit ant/ant-trax junit ant/ant-nodeps jdom velocity" export CLASSPATH=$(build-classpath commons-collections) pushd lib @@ -153,22 +124,20 @@ ln -sf $(build-classpath commons-beanutils-core) . ln -sf $(build-classpath commons-collections) . ln -sf $(build-classpath commons-cli) . ln -sf $(build-classpath commons-logging) . +ln -sf $(build-classpath emma) . +ln -sf $(build-classpath emma_ant) . +ln -sf $(build-classpath junit4 ) . +ln -sf $(build-classpath guava ) . -# FIXME: re-enable when Fedora has emma -#ln -sf $(build-classpath emma) . -#ln -sf $(build-classpath emma_ant) . popd -# FIXME: target run.tests disabled because it will need emma which Fedora does -# not have yet - %ant \ -Dbuild.sysclasspath=first \ -Dant.javadoc=%{_javadocdir}/ant \ -Dantlr.javadoc=%{_javadocdir}/antlr \ -Djaxp.javadoc=%{_javadocdir}/xml-commons-apis \ -Dbeanutils.javadoc=%{_javadocdir}/jakarta-commons-beanutils \ - build.bindist + build.bindist run.tests %install %__rm -rf %{buildroot} @@ -177,8 +146,6 @@ popd %__mkdir_p %{buildroot}%{_javadir} %__cp -pa target/dist/%{name}-%{version}/%{name}-%{version}.jar \ %{buildroot}%{_javadir} -%__cp -pa target/dist/%{name}-%{version}/%{name}-optional-%{version}.jar \ - %{buildroot}%{_javadir} (cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do %__ln_s ${jar} `echo $jar| %__sed "s|-%{version}||g"`; @@ -186,12 +153,10 @@ popd ) # script -%__mkdir_p %{buildroot}%{_bindir} -%__cp -pa %{SOURCE1} %{buildroot}%{_bindir}/%{name} +install -Dpm 755 %{SOURCE1} %{buildroot}%{_bindir}/%{name} # dtds -%__mkdir_p %{buildroot}%{_datadir}/xml/%{name} -%__cp -pa %{SOURCE2} %{buildroot}%{_datadir}/xml/%{name}/catalog +install -Dpm 644 %{SOURCE2} %{buildroot}%{_datadir}/xml/%{name}/catalog %__cp -pa src/checkstyle/com/puppycrawl/tools/checkstyle/*.dtd \ %{buildroot}%{_datadir}/xml/%{name} @@ -212,13 +177,6 @@ popd checkstyle antlr regexp jakarta-commons-beanutils jakarta-commons-cli jakarta-commons-logging jakarta-commons-collections jaxp_parser_impl EOF -# fix encoding issues in docs -for i in LICENSE LICENSE.apache README RIGHTS.antlr \ - build.xml checkstyle_checks.xml java.header sun_checks.xml suppressions.xml \ - target/dist/%{name}-%{version}/docs/css/*; do - tr -d \\r < $i > temp_file; mv temp_file $i -done - %clean %__rm -rf %{buildroot} @@ -238,43 +196,36 @@ if [ -x %{_bindir}/install-catalog -a -d %{_sysconfdir}/sgml ]; then %{_datadir}/xml/%{name}/catalog > /dev/null || : fi -%post optional -%__grep -q checkstyle-optional %{_sysconfdir}/ant.d/%{name} || \ -%__sed -i -e 's|checkstyle|checkstyle checkstyle-optional|' %{_sysconfdir}/ant.d/%{name} || : - -%postun optional -%__grep -q checkstyle-optional %{_sysconfdir}/ant.d/%{name} && \ -%__sed -i -e 's|checkstyle-optional ||' %{_sysconfdir}/ant.d/%{name} || : - %files -%defattr(0644,root,root,0755) -%doc LICENSE LICENSE.apache README RIGHTS.antlr +%defattr(-,root,root,-) +%doc LICENSE LICENSE.apache20 README RIGHTS.antlr %doc build.xml checkstyle_checks.xml java.header sun_checks.xml suppressions.xml %{_javadir}/%{name}.jar %{_javadir}/%{name}-%{version}.jar %{_datadir}/xml/%{name} -%attr(0755,root,root) %{_bindir}/* +%{_bindir}/* %config(noreplace) %{_sysconfdir}/ant.d/%{name} %files demo -%defattr(0644,root,root,0755) +%defattr(-,root,root,-) %{_datadir}/%{name} %files javadoc -%defattr(0644,root,root,0755) +%defattr(-,root,root,-) %doc %{_javadocdir}/* %files manual -%defattr(0644,root,root,0755) +%defattr(-,root,root,-) %doc target/dist/%{name}-%{version}/docs/* -%files optional -%defattr(0644,root,root,0755) -%{_javadir}/%{name}-optional.jar -%{_javadir}/%{name}-optional-%{version}.jar - %changelog +* Wed Jun 9 2010 Stanislav Ochotnicky - 5.1-1 +- Rebase to new version +- Cleanup of whole spec file +- Enable emma (present in Fedora now) +- Drop epoch + * Fri Jul 24 2009 Fedora Release Engineering - 0:4.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild