From 4abefdea9200ad3e0a9a28554f073581b82a3531 Mon Sep 17 00:00:00 2001 From: gil Date: Jun 28 2013 15:19:10 +0000 Subject: swith to pom macros, packaged in /usr/share/java --- diff --git a/apache-commons-vfs.spec b/apache-commons-vfs.spec index 4b156a3..313f7bc 100644 --- a/apache-commons-vfs.spec +++ b/apache-commons-vfs.spec @@ -2,34 +2,26 @@ %global short_name commons-%{base_name} Name: apache-commons-vfs Version: 2.0 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Commons Virtual File System License: ASL 2.0 Url: http://commons.apache.org/%{base_name}/ Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz -# add maven-compiler-plugin configuration -# fix ant gId -# remove/disable jackrabbit-webdav support -# remove org.apache.commons commons-build-plugin -# remove org.codehaus.mojo findbugs-maven-plugin -# remove maven-scm -# remove old vfs stuff -Patch0: %{name}-%{version}-build.patch - -BuildRequires: maven-local -BuildRequires: mvn(com.jcraft:jsch) -BuildRequires: mvn(commons-collections:commons-collections) -BuildRequires: mvn(commons-httpclient:commons-httpclient) -BuildRequires: mvn(commons-logging:commons-logging) -BuildRequires: mvn(commons-net:commons-net) -BuildRequires: mvn(org.apache.ant:ant) -BuildRequires: mvn(org.apache.commons:commons-compress) -BuildRequires: mvn(org.apache.commons:commons-parent) -BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) -BuildRequires: mvn(org.jdom:jdom) + +BuildRequires: maven-local +BuildRequires: mvn(com.jcraft:jsch) +BuildRequires: mvn(commons-collections:commons-collections) +BuildRequires: mvn(commons-httpclient:commons-httpclient) +BuildRequires: mvn(commons-logging:commons-logging) +BuildRequires: mvn(commons-net:commons-net) +BuildRequires: mvn(org.apache.ant:ant) +BuildRequires: mvn(org.apache.commons:commons-compress) +BuildRequires: mvn(org.apache.commons:commons-parent) +BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) +BuildRequires: mvn(org.jdom:jdom) # test deps -BuildRequires: mvn(junit:junit) +BuildRequires: mvn(junit:junit) BuildArch: noarch Provides: %{name}2 = %{version}-%{release} @@ -77,15 +69,76 @@ This package contains javadoc for %{name}. %setup -q -n %{short_name}-%{version} perl -pi -e 's/\r$//g;' *.txt -%patch0 -p1 +# Remove unused dependencies +%pom_remove_dep :maven-scm-api +%pom_remove_dep :maven-scm-provider-svnexe +# Remove not available module +%pom_remove_dep :commons-vfs-sandbox +# Disable unwanted module +%pom_disable_module dist + +# Fix plugin configuration +%pom_xpath_inject "pom:project/pom:reporting/pom:plugins/pom:plugin[pom:artifactId='maven-javadoc-plugin']/pom:configuration" " +*.webdav.*" +# Fix ant gId +%pom_xpath_remove "pom:project/pom:dependencyManagement/pom:dependencies/pom:dependency[pom:artifactId='ant']/pom:groupId" +%pom_xpath_inject "pom:project/pom:dependencyManagement/pom:dependencies/pom:dependency[pom:artifactId='ant']" " +org.apache.ant" + +%pom_xpath_remove "pom:project/pom:dependencies/pom:dependency[pom:artifactId='ant']/pom:groupId" core +%pom_xpath_inject "pom:project/pom:dependencies/pom:dependency[pom:artifactId='ant']" " +org.apache.ant" core + +# Remove unwanted dependency +%pom_remove_dep :jackrabbit-webdav core + +# Disable jackrabbit-webdav support +%pom_add_plugin org.apache.maven.plugins:maven-compiler-plugin core " + + + default-compile + compile + + + **/webdav/* + + + + compile + + + + default-testCompile + test-compile + + + **/webdav/test/* + + + + testCompile + + +" + rm -rf core/src/main/java/org/apache/commons/vfs2/provider/webdav rm -rf core/src/test/java/org/apache/commons/vfs2/provider/webdav sed -i 's|"webdav",||' core/src/test/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilderTest.java -sed -i "s|dist||" pom.xml - # not really needed %pom_remove_plugin :maven-checkstyle-plugin +%pom_remove_plugin :commons-build-plugin +%pom_remove_plugin :findbugs-maven-plugin + +# Fix installation directory and symlink +%mvn_file :%{short_name}2 %{name} +%mvn_file :%{short_name}2 %{name}2 +%mvn_file :%{short_name}2 %{short_name} +%mvn_file :%{short_name}2 %{short_name}2 +%mvn_file :%{short_name}2-examples %{name}-examples +%mvn_file :%{short_name}2-examples %{name}2-examples +%mvn_file :%{short_name}2-examples %{short_name}-examples +%mvn_file :%{short_name}2-examples %{short_name}2-examples %mvn_alias :commons-vfs2 "org.apache.commons:%{short_name}" "%{short_name}:%{short_name}" %mvn_alias :commons-vfs2-examples "org.apache.commons:%{short_name}-examples" "%{short_name}:%{short_name}-examples" @@ -103,9 +156,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/ant.d echo "ant commons-logging %{short_name}" > %{short_name} install -p -m 644 %{short_name} %{buildroot}%{_sysconfdir}/ant.d/%{short_name} - %files -f .mfiles-commons-vfs2 -%dir %{_javadir}/%{name} %doc LICENSE.txt NOTICE.txt README.txt RELEASE-NOTES.txt %files examples -f .mfiles-commons-vfs2-examples @@ -117,6 +168,10 @@ install -p -m 644 %{short_name} %{buildroot}%{_sysconfdir}/ant.d/%{short_name} %config %{_sysconfdir}/ant.d/%{short_name} %changelog +* Fri Jun 28 2013 gil cattaneo 2.0-9 +- swith to pom macros +- packaged in /usr/share/java instead of /usr/share/java/apache-commons-vfs + * Fri Jun 28 2013 Michal Srb - 2.0-8 - Fix directory ownership