[log4j] Add patch to fix ant groupId

Stanislav Ochotnicky sochotni at fedoraproject.org
Thu Dec 9 15:15:06 UTC 2010


commit 3c3da337c5bad8f0d9a4e93edaf66a9227dcbff0
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Thu Dec 9 15:51:46 2010 +0100

    Add patch to fix ant groupId
    
    Also:
    - Versionless jars & javadocs

 0011-Fix-ant-groupId.patch |   35 +++++++++++++++++++++++++++++++++++
 log4j.spec                 |   31 ++++++++++++++++---------------
 2 files changed, 51 insertions(+), 15 deletions(-)
---
diff --git a/0011-Fix-ant-groupId.patch b/0011-Fix-ant-groupId.patch
new file mode 100644
index 0000000..d7a80db
--- /dev/null
+++ b/0011-Fix-ant-groupId.patch
@@ -0,0 +1,35 @@
+From af23b075c392a2e8b33b3ee0c9d5d26406a6d193 Mon Sep 17 00:00:00 2001
+From: Stanislav Ochotnicky <sochotnicky at redhat.com>
+Date: Thu, 9 Dec 2010 13:30:44 +0100
+Subject: [PATCH 11/11] Fix ant groupId
+
+---
+ pom.xml |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/pom.xml b/pom.xml
+index 406fa43..efcfe26 100644
+--- a/pom.xml
++++ b/pom.xml
+@@ -264,14 +264,14 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
+         </executions>
+         <dependencies>
+           <dependency>
+-            <groupId>ant</groupId>
++            <groupId>org.apache.ant</groupId>
+             <artifactId>ant-nodeps</artifactId>
+-            <version>1.6.5</version>
++            <version>1.8.1</version>
+           </dependency>
+           <dependency>
+-            <groupId>ant</groupId>
++            <groupId>org.apache.ant</groupId>
+             <artifactId>ant-junit</artifactId>
+-            <version>1.6.5</version>
++            <version>1.8.11</version>
+           </dependency>
+           <dependency>
+             <groupId>junit</groupId>
+-- 
+1.7.3.2
+
diff --git a/log4j.spec b/log4j.spec
index bd747a8..0bb69c5 100644
--- a/log4j.spec
+++ b/log4j.spec
@@ -3,7 +3,7 @@
 
 Name:           log4j
 Version:        1.2.16
-Release:        4%{?dist}
+Release:        5%{?dist}
 Epoch:          0
 Summary:        Java logging package
 BuildArch:      noarch
@@ -30,6 +30,7 @@ Patch6:         0007-Remove-mvn-rat-plugin.patch
 Patch7:         0008-Remove-ant-contrib-from-dependencies.patch
 Patch8:         0009-Remove-ant-run-of-tests.patch
 Patch9:         0010-Fix-javadoc-link.patch
+Patch10:        0011-Fix-ant-groupId.patch
 
 BuildRequires:  %{__perl}
 BuildRequires:  java >= 1:1.6.0
@@ -61,7 +62,6 @@ Requires(post):    jpackage-utils
 Requires(postun):  jpackage-utils
 Requires:       xml-commons-apis
 Requires:       jaxp_parser_impl
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
 Log4j is a tool to help the programmer output log statements to a
@@ -96,6 +96,7 @@ Requires:       jpackage-utils
 %patch7 -p1 -b .remove-and-contrib
 %patch8 -p1 -b .remove-tests
 %patch9 -p1 -b .xlink-javadoc
+%patch10 -p1 -b .ant-groupid
 
 sed -i 's/\r//g' LICENSE NOTICE site/css/*.css site/xref/*.css \
     site/xref-test/*.css
@@ -125,12 +126,9 @@ mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
     install
 
 %install
-rm -rf %{buildroot}
-
 # jars
 #install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
-install -pD -T -m 644 target/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
+install -pD -T -m 644 target/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
 
 # pom
 install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
@@ -138,9 +136,8 @@ install -pm 644 pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}.pom
 %add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
 
 # javadoc
-install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-cp -pr target/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
+install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
+cp -pr target/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
 
 # scripts
 install -pD -T -m 755 %{SOURCE2} %{buildroot}%{_bindir}/logfactor5
@@ -171,11 +168,6 @@ install -pD -T -m 644 %{SOURCE7} \
 contribs/KitchingSimon/udpserver.pl
 
 
-
-%clean
-%__rm -rf %{buildroot}
-
-
 %post
 %update_maven_depmap
 # Note that we're using versioned catalog, so this is always ok.
@@ -209,6 +201,12 @@ if [ -x %{_bindir}/install-catalog -a -d %{_sysconfdir}/sgml ]; then
     %{_datadir}/sgml/%{name}/catalog > /dev/null || :
 fi
 
+%pre javadoc
+# workaround rpm bug, can be removed in F-17
+[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
+rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
+
+
 %files
 %defattr(-,root,root,-)
 %doc LICENSE NOTICE
@@ -228,11 +226,14 @@ fi
 %files javadoc
 %defattr(-,root,root,-)
 %doc LICENSE NOTICE
-%doc %{_javadocdir}/%{name}-%{version}
 %doc %{_javadocdir}/%{name}
 
 
 %changelog
+* Thu Dec  9 2010 Stanislav Ochotnicky <sochotnicky at redhat.com> - 0:1.2.16-5
+- Add patch to fix ant groupId
+- Versionless jars & javadocs
+
 * Tue Sep  7 2010 Stanislav Ochotnicky <sochotnicky at redhat.com> - 0:1.2.16-4
 - Fix BRs to include ant-junit
 - Fix changed path for javadocs after build run


More information about the scm-commits mailing list