Name: maven-plugin-log4j
Version: 1.0.1
Release: 1%{?dist}
Summary: Log4j Appender for Maven Plugin
Group: Development/Libraries
License: ASL 2.0
URL: http://www.pyx4j.com/pyx4j-maven-plugins/
Source0: http://www.pyx4j.com/maven2-release/com/pyx4j/%{name}/%{version}/%{name}-%{version}-sources.jar
Source1: http://www.pyx4j.com/maven2-release/com/pyx4j/%{name}/%{version}/%{name}-%{version}.pom
# maven-plugin-log4j package don't include the license file
Source2: http://www.apache.org/licenses/LICENSE-2.0.txt
BuildRequires: java-devel
BuildRequires: log4j
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: maven-local
BuildRequires: maven-compiler-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-surefire-plugin
Requires: log4j
Requires: mvn(org.apache.maven:maven-plugin-api)
Requires: java
BuildArch: noarch
%description
maven-plugin-log4j is not a maven plugin.
This is Log4j Appender for Maven Plugin.
It simplify the used of libraries that
are using log4j inside Maven Plugin by
redirecting log4j log and debug massages
to maven log.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -c
mkdir -p src/main/{java,resources}
rm -r META-INF
mv com src/main/java/
mv log4j.xml src/main/resources
cp -p %{SOURCE1} pom.xml
%pom_remove_parent
%pom_xpath_inject "pom:project" "com.pyx4j%{version}"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-compiler-plugin']" "org.apache.maven.pluginsany"
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-compiler-plugin']/pom:configuration" \
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-compiler-plugin']" \
"1.5"
%pom_add_dep org.apache.maven:maven-plugin-api
#org.apache.maven:maven-artifact
#org.codehaus.plexus:plexus-utils
cp -p %{SOURCE2} .
sed -i 's/\r//' LICENSE-2.0.txt
%build
mvn-rpmbuild -Dproject.build.sourceEncoding=UTF-8 package javadoc:aggregate
%install
mkdir -p %{buildroot}%{_javadir}
install -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
mkdir -p %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%files
%{_javadir}/%{name}.jar
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%doc LICENSE-2.0.txt
%files javadoc
%{_javadocdir}/%{name}
%doc LICENSE-2.0.txt
%changelog
* Thu May 02 2013 gil cattaneo 1.0.1-1
- initial rpm