Репозитории ALT
5.1: | 4.2.5-alt1_1jpp5 |
4.1: | 3.6-alt1_1jpp1.7 |
4.0: | 3.6-alt1_1jpp1.7 |
Группа :: Разработка/Java
Пакет: pmd
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: oro
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2009, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%define gcj_support 0
%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
%bcond_with maven
Name: pmd
Version: 4.2.5
Release: alt1_1jpp5
Epoch: 0
Summary: Scans Java source code and looks for potential problems
License: BSD Style
Url: http://pmd.sourceforge.net/
Group: Development/Java
# svn export https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_4_2_5 pmd-4.2.5 && tar cjf pmd-4.2.5.tar.bz2 pmd-4.2.5
Source0: pmd-4.2.5.tar.bz2
Source1: pmd-4.2.5.pom
Source2: pom-maven2jpp-mapdeps.xsl
Source3: pmd-4.2.4-jpp-depmap.xml
Patch0: pmd-4.2.4-project.patch
Patch1: pmd-ruby.patch
Patch2: pmd-4.2.4-no-retroweaver.patch
Patch3: pmd-4.2.4-no-classpath-in-manifest.patch
Requires(post): jpackage-utils >= 0:1.7.3
Requires(postun): jpackage-utils >= 0:1.7.3
Requires: ant >= 0:1.6
Requires: backport-util-concurrent >= 0:2.1
# FIXME: (dwalluck): Should be 1.1.1
Requires: jaxen >= 0:1.1
Requires: objectweb-asm >= 0:3.1
Requires: junit4 >= 0:4.4
BuildRequires: ant >= 0:1.6
BuildRequires: ant-junit >= 0:1.6
BuildRequires: backport-util-concurrent >= 0:2.1
BuildRequires: jaxen >= 0:1.1
BuildRequires: jpackage-utils >= 0:1.7.3
BuildRequires: junit4 >= 0:4.4
BuildRequires: objectweb-asm >= 0:3.1
%if %with maven
BuildRequires: maven >= 0:1.1
BuildRequires: maven-plugins-base >= 0:1.1
BuildRequires: maven-plugin-faq >= 0:1.1
BuildRequires: maven-plugin-developer-activity >= 0:1.1
BuildRequires: maven-plugin-file-activity >= 0:1.1
BuildRequires: maven-plugin-jxr >= 0:1.1
BuildRequires: maven-plugin-license >= 0:1.1
BuildRequires: maven-plugin-tasklist >= 0:1.1
BuildRequires: maven-plugin-test >= 0:1.1
BuildRequires: maven-plugin-xdoc >= 0:1.1
BuildRequires: saxon
BuildRequires: saxon-scripts
%endif
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
%else
BuildArch: noarch
%endif
%description
PMD scans Java source code and looks for potential
problems like:
+ Unused local variables
+ Empty catch blocks
+ Unused parameters
+ Empty 'if' statements
+ Duplicate import statements
+ Unused private methods
+ Classes which could be Singletons
+ Short/long variable and method names
PMD has plugins for JDeveloper, JEdit, JBuilder,
NetBeans/Sun ONE Studio, IntelliJ IDEA, TextPad,
Maven, Ant, Eclipse, Gel, and Emacs.
%if %with maven
%package manual
Summary: Manual for %{name}
Group: Development/Documentation
%description manual
Documentation for %{name}.
%endif
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Documentation
%description javadoc
%{summary}.
%prep
%setup -q
%patch0 -p0
%patch1 -p0
%patch2 -p1
%patch3 -p1
%{_bindir}/find . -name "*.sh" | %{_bindir}/xargs -t %{__chmod} 0755
%{_bindir}/find . -name "*.jar" | xargs -t %{__rm}
%{__ln_s} $(build-classpath objectweb-asm/asm) lib/asm-3.0.jar
%if %with maven
%{__mkdir_p} .maven/cache/maven-pmd-plugin-1.10/lib/
%{__ln_s} $(build-classpath objectweb-asm/asm) .maven/cache/maven-pmd-plugin-1.10/lib/asm-3.0.jar
%endif
%build
%if %with maven
for p in $(find . -name project.xml); do
pushd $(dirname $p)
%{__cp} -p project.xml project.xml.orig
%{_bindir}/saxon -o project.xml project.xml.orig %{SOURCE2} map=%{SOURCE3}
popd
done
%{_bindir}/maven \
-Dmaven.repo.remote=file:///usr/share/maven/repository \
-Dmaven.home.local=$(pwd)/.maven \
-Dmaven.test.failure.ignore=true \
jar javadoc xdoc
%else
export OPT_JAR_LIST=`%{__cat} %{_sysconfdir}/ant.d/junit`
export CLASSPATH=$(build-classpath \
backport-util-concurrent \
jaxen \
junit4 \
objectweb-asm \
)
CLASSPATH=$CLASSPATH:target/classes:target/test-classes
cd bin
%{ant} -Dbuild.sysclasspath=only dist javadoc
%endif
%install
# jar
install -d -m 755 %{buildroot}%{_javadir}
%if %with maven
install -p -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%else
install -p -m 644 lib/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%endif
(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do %{__ln_s} ${jar} ${jar/-%{version}/}; done)
install -d -m 755 %{buildroot}%{_datadir}/%{name}-%{version}/etc
%{__cp} -pr etc/* %{buildroot}%{_datadir}/%{name}-%{version}/etc
install -d -m 755 %{buildroot}%{_datadir}/%{name}-%{version}/rulesets
%{__cp} -pr rulesets/* %{buildroot}%{_datadir}/%{name}-%{version}/rulesets
%{__ln_s} %{name}-%{version} %{buildroot}%{_datadir}/%{name}
# pom
install -d -m 755 %{buildroot}%{_datadir}/maven2/poms
install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom
%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
%if %with maven
%{__cp} -pr target/docs/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
# FIXME: (dwalluck): breaks -bi --short-circuit
rm -rf target/docs/apidocs
%else
%{__cp} -pr docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%endif
%{__ln_s} %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
# manual
%if %with maven
install -d -m 755 %{buildroot}%{_docdir}/%{name}-%{version}
%{__cp} -pr target/docs/* %{buildroot}%{_docdir}/%{name}-%{version}/
%endif
%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
%files
%doc LICENSE.txt
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%{_datadir}/maven2/poms/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%{_datadir}/%{name}
%{_datadir}/%{name}-%{version}
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif
%if %with maven
%files manual
%doc %{_docdir}/%{name}-%{version}
%endif
%files javadoc
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
…
Полный changelog можно просмотреть здесь
BuildRequires: oro
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2009, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%define gcj_support 0
%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
%bcond_with maven
Name: pmd
Version: 4.2.5
Release: alt1_1jpp5
Epoch: 0
Summary: Scans Java source code and looks for potential problems
License: BSD Style
Url: http://pmd.sourceforge.net/
Group: Development/Java
# svn export https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_4_2_5 pmd-4.2.5 && tar cjf pmd-4.2.5.tar.bz2 pmd-4.2.5
Source0: pmd-4.2.5.tar.bz2
Source1: pmd-4.2.5.pom
Source2: pom-maven2jpp-mapdeps.xsl
Source3: pmd-4.2.4-jpp-depmap.xml
Patch0: pmd-4.2.4-project.patch
Patch1: pmd-ruby.patch
Patch2: pmd-4.2.4-no-retroweaver.patch
Patch3: pmd-4.2.4-no-classpath-in-manifest.patch
Requires(post): jpackage-utils >= 0:1.7.3
Requires(postun): jpackage-utils >= 0:1.7.3
Requires: ant >= 0:1.6
Requires: backport-util-concurrent >= 0:2.1
# FIXME: (dwalluck): Should be 1.1.1
Requires: jaxen >= 0:1.1
Requires: objectweb-asm >= 0:3.1
Requires: junit4 >= 0:4.4
BuildRequires: ant >= 0:1.6
BuildRequires: ant-junit >= 0:1.6
BuildRequires: backport-util-concurrent >= 0:2.1
BuildRequires: jaxen >= 0:1.1
BuildRequires: jpackage-utils >= 0:1.7.3
BuildRequires: junit4 >= 0:4.4
BuildRequires: objectweb-asm >= 0:3.1
%if %with maven
BuildRequires: maven >= 0:1.1
BuildRequires: maven-plugins-base >= 0:1.1
BuildRequires: maven-plugin-faq >= 0:1.1
BuildRequires: maven-plugin-developer-activity >= 0:1.1
BuildRequires: maven-plugin-file-activity >= 0:1.1
BuildRequires: maven-plugin-jxr >= 0:1.1
BuildRequires: maven-plugin-license >= 0:1.1
BuildRequires: maven-plugin-tasklist >= 0:1.1
BuildRequires: maven-plugin-test >= 0:1.1
BuildRequires: maven-plugin-xdoc >= 0:1.1
BuildRequires: saxon
BuildRequires: saxon-scripts
%endif
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
%else
BuildArch: noarch
%endif
%description
PMD scans Java source code and looks for potential
problems like:
+ Unused local variables
+ Empty catch blocks
+ Unused parameters
+ Empty 'if' statements
+ Duplicate import statements
+ Unused private methods
+ Classes which could be Singletons
+ Short/long variable and method names
PMD has plugins for JDeveloper, JEdit, JBuilder,
NetBeans/Sun ONE Studio, IntelliJ IDEA, TextPad,
Maven, Ant, Eclipse, Gel, and Emacs.
%if %with maven
%package manual
Summary: Manual for %{name}
Group: Development/Documentation
%description manual
Documentation for %{name}.
%endif
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Documentation
%description javadoc
%{summary}.
%prep
%setup -q
%patch0 -p0
%patch1 -p0
%patch2 -p1
%patch3 -p1
%{_bindir}/find . -name "*.sh" | %{_bindir}/xargs -t %{__chmod} 0755
%{_bindir}/find . -name "*.jar" | xargs -t %{__rm}
%{__ln_s} $(build-classpath objectweb-asm/asm) lib/asm-3.0.jar
%if %with maven
%{__mkdir_p} .maven/cache/maven-pmd-plugin-1.10/lib/
%{__ln_s} $(build-classpath objectweb-asm/asm) .maven/cache/maven-pmd-plugin-1.10/lib/asm-3.0.jar
%endif
%build
%if %with maven
for p in $(find . -name project.xml); do
pushd $(dirname $p)
%{__cp} -p project.xml project.xml.orig
%{_bindir}/saxon -o project.xml project.xml.orig %{SOURCE2} map=%{SOURCE3}
popd
done
%{_bindir}/maven \
-Dmaven.repo.remote=file:///usr/share/maven/repository \
-Dmaven.home.local=$(pwd)/.maven \
-Dmaven.test.failure.ignore=true \
jar javadoc xdoc
%else
export OPT_JAR_LIST=`%{__cat} %{_sysconfdir}/ant.d/junit`
export CLASSPATH=$(build-classpath \
backport-util-concurrent \
jaxen \
junit4 \
objectweb-asm \
)
CLASSPATH=$CLASSPATH:target/classes:target/test-classes
cd bin
%{ant} -Dbuild.sysclasspath=only dist javadoc
%endif
%install
# jar
install -d -m 755 %{buildroot}%{_javadir}
%if %with maven
install -p -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%else
install -p -m 644 lib/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%endif
(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do %{__ln_s} ${jar} ${jar/-%{version}/}; done)
install -d -m 755 %{buildroot}%{_datadir}/%{name}-%{version}/etc
%{__cp} -pr etc/* %{buildroot}%{_datadir}/%{name}-%{version}/etc
install -d -m 755 %{buildroot}%{_datadir}/%{name}-%{version}/rulesets
%{__cp} -pr rulesets/* %{buildroot}%{_datadir}/%{name}-%{version}/rulesets
%{__ln_s} %{name}-%{version} %{buildroot}%{_datadir}/%{name}
# pom
install -d -m 755 %{buildroot}%{_datadir}/maven2/poms
install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom
%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
%if %with maven
%{__cp} -pr target/docs/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
# FIXME: (dwalluck): breaks -bi --short-circuit
rm -rf target/docs/apidocs
%else
%{__cp} -pr docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%endif
%{__ln_s} %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
# manual
%if %with maven
install -d -m 755 %{buildroot}%{_docdir}/%{name}-%{version}
%{__cp} -pr target/docs/* %{buildroot}%{_docdir}/%{name}-%{version}/
%endif
%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
%files
%doc LICENSE.txt
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%{_datadir}/maven2/poms/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%{_datadir}/%{name}
%{_datadir}/%{name}-%{version}
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif
%if %with maven
%files manual
%doc %{_docdir}/%{name}-%{version}
%endif
%files javadoc
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
…
Полный changelog можно просмотреть здесь