[apache-commons-digester] Build with maven 3.
by Alexander Kurtakov
commit 032d038263e06faa4a621a09c741d45e6f112c71
Author: Alexander Kurtakov < <akurtako(a)redhat.com>
Date: Wed Nov 30 15:39:38 2011 +0200
Build with maven 3.
- Adapt to current guidelines.
apache-commons-digester.spec | 63 ++++++++++++-----------------------------
1 files changed, 19 insertions(+), 44 deletions(-)
---
diff --git a/apache-commons-digester.spec b/apache-commons-digester.spec
index 4058168..0999f85 100644
--- a/apache-commons-digester.spec
+++ b/apache-commons-digester.spec
@@ -3,7 +3,7 @@
Name: apache-%{short_name}
Version: 1.8.1
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: XML to Java object mapping module
Group: Development/Libraries
License: ASL 2.0
@@ -11,30 +11,26 @@ URL: http://commons.apache.org/%{base_name}/
Source0: http://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-...
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
BuildArch: noarch
BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: apache-commons-beanutils >= 1.8
BuildRequires: apache-commons-logging >= 1.1.1
-BuildRequires: maven2-plugin-antrun
-BuildRequires: maven2-plugin-assembly
-BuildRequires: maven2-plugin-compiler
-BuildRequires: maven2-plugin-idea
-BuildRequires: maven2-plugin-install
-BuildRequires: maven2-plugin-jar
-BuildRequires: maven2-plugin-javadoc
-BuildRequires: maven2-plugin-resources
+BuildRequires: maven-antrun-plugin
+BuildRequires: maven-assembly-plugin
+BuildRequires: maven-compiler-plugin
+BuildRequires: maven-idea-plugin
+BuildRequires: maven-install-plugin
+BuildRequires: maven-jar-plugin
+BuildRequires: maven-javadoc-plugin
+BuildRequires: maven-resources-plugin
BuildRequires: maven-doxia-sitetools
BuildRequires: maven-plugin-bundle
BuildRequires: maven-surefire-maven-plugin
BuildRequires: maven-surefire-provider-junit
Requires: java
Requires: jpackage-utils
-Requires(post):jpackage-utils
-Requires(postun):jpackage-utils
Requires: apache-commons-beanutils >= 1.8
Requires: apache-commons-logging >= 1.1.1
@@ -62,56 +58,36 @@ Obsoletes: jakarta-%{short_name}-javadoc < %{version}-%{release}
sed -i 's/\r//' RELEASE-NOTES*.txt LICENSE.txt NOTICE.txt
%build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mkdir -p $MAVEN_REPO_LOCAL
-
-mvn-jpp -Dmaven.compile.source=1.5 -Dmaven.compile.target=1.5 \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL install javadoc:javadoc
+mvn-rpmbuild install javadoc:javadoc
%install
-rm -rf %{buildroot}
-
# jars
install -pD -T target/%{short_name}-%{version}.jar \
- %{buildroot}%{_javadir}/%{short_name}-%{version}.jar
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|%{short_name}|%{name}|g"`; done)
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
+ %{buildroot}%{_javadir}/%{short_name}.jar
+ln -s %{short_name}.jar %{buildroot}/%{_javadir}/%{name}.jar
# javadocs
-install -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
-cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
-ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
+install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
# pom
install -pD -T -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom
-%add_to_maven_depmap org.apache.commons %{short_name} %{version} JPP %{short_name}
-
-# following line is only for backwards compatibility. New packages
-# should use proper groupid org.apache.commons
-%add_to_maven_depmap %{short_name} %{short_name} %{version} JPP %{short_name}
-
-%clean
-rm -rf %{buildroot}
-
-%post
-%update_maven_depmap
-
-%postun
-%update_maven_depmap
+%add_maven_depmap JPP-%{short_name}.pom %{short_name}.jar -a "%{short_name}:%{short_name}"
%files
-%defattr(-,root,root,-)
%doc LICENSE.txt NOTICE.txt RELEASE-NOTES*
%{_mavendepmapfragdir}/*
%{_mavenpomdir}/*
%{_javadir}/*
%files javadoc
-%defattr(-,root,root,-)
-%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
+* Wed Nov 30 2011 Alexander Kurtakov <akurtako(a)redhat.com> 1.8.1-9
+- Build with maven 3.
+- Adapt to current guidelines.
+
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 1.8.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
@@ -217,4 +193,3 @@ rm -rf %{buildroot}
* Thu May 08 2003 Henri Gomez <hgomez(a)users.sourceforge.net> 1.5-2jpp
- 1.5
-
12 years, 5 months
[apache-commons-codec] Build with maven 3.
by Alexander Kurtakov
commit 3a3cec5b3e9d363e3a00cb105b9175e33f49144e
Author: Alexander Kurtakov < <akurtako(a)redhat.com>
Date: Wed Nov 30 15:03:03 2011 +0200
Build with maven 3.
- Adapt to current guidelines.
apache-commons-codec.spec | 61 +++++++++++----------------------------------
1 files changed, 15 insertions(+), 46 deletions(-)
---
diff --git a/apache-commons-codec.spec b/apache-commons-codec.spec
index 4d167ed..21cfaee 100644
--- a/apache-commons-codec.spec
+++ b/apache-commons-codec.spec
@@ -1,14 +1,9 @@
%global base_name codec
%global short_name commons-%{base_name}
-# enable OSGi automatic dep solving
-%global _use_internal_dependency_generator 0
-%global __find_provides /usr/lib/rpm/osgideps.pl -p
-%global __find_requires /usr/lib/rpm/osgideps.pl -r
-
Name: apache-%{short_name}
Version: 1.4
-Release: 12%{?dist}
+Release: 13%{?dist}
Summary: Implementations of common encoders and decoders
Group: Development/Libraries
License: ASL 2.0
@@ -16,28 +11,25 @@ URL: http://commons.apache.org/%{base_name}/
Source0: http://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-...
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: java-devel >= 1:1.6.0
BuildRequires: jpackage-utils
-BuildRequires: maven2-plugin-antrun
-BuildRequires: maven2-plugin-assembly
-BuildRequires: maven2-plugin-compiler
-BuildRequires: maven2-plugin-idea
-BuildRequires: maven2-plugin-install
-BuildRequires: maven2-plugin-jar
-BuildRequires: maven2-plugin-javadoc
-BuildRequires: maven2-plugin-resources
+BuildRequires: maven-antrun-plugin
+BuildRequires: maven-assembly-plugin
+BuildRequires: maven-compiler-plugin
+BuildRequires: maven-idea-plugin
+BuildRequires: maven-install-plugin
+BuildRequires: maven-jar-plugin
+BuildRequires: maven-javadoc-plugin
+BuildRequires: maven-resources-plugin
BuildRequires: maven-doxia-sitetools
BuildRequires: maven-plugin-bundle
BuildRequires: maven-surefire-maven-plugin
BuildRequires: maven-surefire-provider-junit
Requires: java >= 1:1.6.0
Requires: jpackage-utils
-Requires(post):jpackage-utils
-Requires(postun):jpackage-utils
Provides: jakarta-%{short_name} = %{version}-%{release}
Obsoletes: jakarta-%{short_name} < %{version}-%{release}
@@ -65,16 +57,9 @@ Obsoletes: jakarta-%{short_name}-javadoc < %{version}-%{release}
sed -i 's/\r//' RELEASE-NOTES*.txt LICENSE.txt NOTICE.txt
%build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mkdir -p $MAVEN_REPO_LOCAL
-
-mvn-jpp \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
- install javadoc:javadoc
+mvn-rpmbuild install javadoc:javadoc
%install
-rm -rf %{buildroot}
-
# jars
install -pD -T target/%{short_name}-%{version}.jar \
%{buildroot}%{_javadir}/%{short_name}.jar
@@ -86,39 +71,23 @@ cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
# pom
install -pD -T -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom
-%add_to_maven_depmap org.apache.commons %{short_name} %{version} JPP %{short_name}
-
-# following line is only for backwards compatibility. New packages
-# should use proper groupid org.apache.commons
-%add_to_maven_depmap %{short_name} %{short_name} %{version} JPP %{short_name}
-
-%clean
-rm -rf %{buildroot}
-
-%post
-%update_maven_depmap
-
-%postun
-%update_maven_depmap
-
-%pre javadoc
-# workaround for rpm bug, can be removed in F-17
-[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
-rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
+%add_maven_depmap JPP-%{short_name}.pom %{short_name}.jar -a "%{short_name}:%{short_name}"
%files
-%defattr(-,root,root,-)
%doc LICENSE.txt NOTICE.txt RELEASE-NOTES*
%{_mavendepmapfragdir}/*
%{_mavenpomdir}/*
%{_javadir}/*
%files javadoc
-%defattr(-,root,root,-)
%doc LICENSE.txt
%{_javadocdir}/%{name}
%changelog
+* Wed Nov 30 2011 Alexander Kurtakov <akurtako(a)redhat.com> 1.4-13
+- Build with maven 3.
+- Adapt to current guidelines.
+
* Thu Feb 10 2011 mbooth <mbooth(a)sd.matbooth.co.uk> 1.4-12
- Drop versioned jars and javadocs.
12 years, 5 months
[apache-commons-pool] Adapt to current guidelines.
by Alexander Kurtakov
commit 0a852ed9c46569a0129045f21a71a14f948456b9
Author: Alexander Kurtakov < <akurtako(a)redhat.com>
Date: Wed Nov 30 14:29:46 2011 +0200
Adapt to current guidelines.
apache-commons-pool.spec | 38 ++++++++++----------------------------
sources | 1 -
2 files changed, 10 insertions(+), 29 deletions(-)
---
diff --git a/apache-commons-pool.spec b/apache-commons-pool.spec
index 5e990e2..5aec0dc 100644
--- a/apache-commons-pool.spec
+++ b/apache-commons-pool.spec
@@ -3,13 +3,12 @@
Name: apache-%{short_name}
Version: 1.5.6
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Apache Commons Pool Package
Group: Development/Libraries
License: ASL 2.0
URL: http://commons.apache.org/%{base_name}/
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{ve...
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: java-devel >= 1:1.6.0
@@ -50,51 +49,34 @@ This package contains the API documentation for %{name}.
mvn-rpmbuild install javadoc:javadoc
%install
-rm -rf %{buildroot}
-
# jars
install -d -m 0755 %{buildroot}%{_javadir}
-install -pm 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"`; done)
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
+install -pm 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
+(cd %{buildroot}%{_javadir} && for jar in *%{name}*; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"`; done)
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
-install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom
-%add_to_maven_depmap org.apache.commons %{short_name} %{version} JPP %{short_name}
-
-# following line is only for backwards compatibility. New packages
-# should use proper groupid org.apache.commons and also artifactid
-%add_to_maven_depmap %{short_name} %{short_name} %{version} JPP %{short_name}
+install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "%{short_name}:%{short_name}"
# javadoc
-install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}-%{version}
-cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}-%{version}/
-ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
-
-%post
-%update_maven_depmap
-
-%postun
-%update_maven_depmap
-
-%clean
-rm -rf %{buildroot}
+install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}/
%files
-%defattr(-,root,root,-)
%doc README.txt LICENSE.txt NOTICE.txt RELEASE-NOTES.txt
%{_javadir}/*
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*
%files javadoc
-%defattr(-,root,root,-)
%doc LICENSE.txt
-%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
+* Wed Nov 30 2011 Alexander Kurtakov <akurtako(a)redhat.com> 1.5.6-2
+- Adapt to current guidelines.
+
* Fri Apr 15 2011 Chris Spike <spike(a)fedoraproject.org> 1.5.6-1
- Updated to 1.5.6
- Fixed build for maven 3
diff --git a/sources b/sources
index 7557ee2..cb5b3fd 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-1a71f00c8ab265efae3724295636f2e0 commons-pool-1.5.5-src.tar.gz
e024ffad4a52ebd5986c74851f688c0d commons-pool-1.5.6-src.tar.gz
12 years, 5 months
[apache-commons-cli] Build with maven 3.
by Alexander Kurtakov
commit 15512b57f223b30b6d855e795cc48520d958bb86
Author: Alexander Kurtakov < <akurtako(a)redhat.com>
Date: Wed Nov 30 13:40:41 2011 +0200
Build with maven 3.
- Adapt to current guidelines.
apache-commons-cli.spec | 49 +++++++++++-----------------------------------
1 files changed, 12 insertions(+), 37 deletions(-)
---
diff --git a/apache-commons-cli.spec b/apache-commons-cli.spec
index dd79c98..bbecf5a 100644
--- a/apache-commons-cli.spec
+++ b/apache-commons-cli.spec
@@ -3,13 +3,12 @@
Name: apache-%{short_name}
Version: 1.2
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Command Line Interface Library for Java
Group: Development/Libraries
License: ASL 2.0
URL: http://commons.apache.org/%{base_name}/
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{ve...
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: java-devel >= 1:1.6.0
@@ -19,9 +18,6 @@ BuildRequires: apache-commons-parent
Requires: java >= 1:1.6.0
Requires: jpackage-utils
-Requires(post): jpackage-utils
-Requires(postun): jpackage-utils
-
# This should go away with F-17
Provides: jakarta-%{short_name} = 0:%{version}-%{release}
Obsoletes: jakarta-%{short_name} < 0:1.1-6
@@ -44,60 +40,39 @@ This package contains the API documentation for %{name}.
%setup -q -n %{short_name}-%{version}-src
%build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mvn-jpp \
- -e \
- -Dmaven2.jpp.mode=true \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
- install javadoc:javadoc
+mvn-rpmbuild install javadoc:javadoc
%install
-rm -rf %{buildroot}
-
# jars
install -d -m 0755 %{buildroot}%{_javadir}
-install -pm 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"`; done)
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
+install -pm 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
+(cd %{buildroot}%{_javadir} && for jar in *%{name}*; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"`; done)
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
-install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom
-%add_to_maven_depmap org.apache.commons %{short_name} %{version} JPP %{short_name}
-
-# following line is only for backwards compatibility. New packages
-# should use proper groupid org.apache.commons and also artifactid
-%add_to_maven_depmap %{short_name} %{short_name} %{version} JPP %{short_name}
+install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "%{short_name}:%{short_name}"
# javadoc
-install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}-%{version}
-cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}-%{version}/
-ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
-
-%post
-%update_maven_depmap
-
-%postun
-%update_maven_depmap
-
-%clean
-rm -rf %{buildroot}
+install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}/
%files
-%defattr(-,root,root,-)
%doc LICENSE.txt NOTICE.txt README.txt RELEASE-NOTES.txt
%{_javadir}/*
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*
%files javadoc
-%defattr(-,root,root,-)
%doc LICENSE.txt
-%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
+* Wed Nov 30 2011 Alexander Kurtakov <akurtako(a)redhat.com> 1.2-5
+- Build with maven 3.
+- Adapt to current guidelines.
+
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 1.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
12 years, 5 months
[Bug 727331] New: /usr/bin/complete-ant-cmd.pl lacks executable permissions
by Red Hat Bugzilla
Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.
Summary: /usr/bin/complete-ant-cmd.pl lacks executable permissions
https://bugzilla.redhat.com/show_bug.cgi?id=727331
Summary: /usr/bin/complete-ant-cmd.pl lacks executable
permissions
Product: Fedora
Version: 15
Platform: All
OS/Version: Linux
Status: NEW
Severity: low
Priority: unspecified
Component: ant
AssignedTo: pcheung(a)redhat.com
ReportedBy: loganjerry(a)gmail.com
QAContact: extras-qa(a)fedoraproject.org
CC: pcheung(a)redhat.com, akurtako(a)redhat.com,
mmatejov(a)redhat.com,
java-sig-commits(a)lists.fedoraproject.org
Classification: Fedora
Story Points: ---
Type: ---
Description of problem:
I have bash-completion installed, and tried to tab-complete an ant command, as
follows:
$ ant -f plugins/linux/s[tab]
bash: /usr/bin/complete-ant-cmd.pl: Permission denied
$ ls -l /usr/bin/complete-ant-cmd.pl
-rw-r--r--. 1 root root 3219 Dec 20 2010 /usr/bin/complete-ant-cmd.pl
Version-Release number of selected component (if applicable):
ant-scripts-1.8.2-3.fc15.noarch
How reproducible:
Always
Steps to Reproduce:
1. Type "ant -f ", then type a partial pathname.
2. Press the Tab key.
3.
Actual results:
Bash complains that it cannot execute /usr/bin/complete-ant-cmd.pl.
Expected results:
Completion of the partial pathname.
Additional info:
--
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
12 years, 5 months
[javapackages] Make sure to verify correct naming of jar/pom files
by Stanislav Ochotnicky
commit a58f069159155af98bff2fefb9521121da4b69fa
Author: Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Date: Tue Nov 29 15:06:40 2011 +0100
Make sure to verify correct naming of jar/pom files
This used to pass without throwing error:
%add_maven_depmap JPP-%{name}.pom ant/%{name}.jar
scripts/maven_depmap.py | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/scripts/maven_depmap.py b/scripts/maven_depmap.py
index 43ecc84..cdc467a 100644
--- a/scripts/maven_depmap.py
+++ b/scripts/maven_depmap.py
@@ -57,6 +57,10 @@ class IncompatibleFilenames(Exception):
def __init__(self, pom_path, jar_path):
self.args=("Filenames of pom %s and jar %s does not match properly. Check that jar subdirectories match '.' in pom name." % (pom_path, jar_path),)
+class MissingJarFile(Exception):
+ def __init__(self):
+ self.args=("Jar seems to be missing in standard directories. Make sure you have installed it")
+
def _get_tag_under_parent(dom, parent, tag):
"""get first xml tag under parent tag within dom"""
tags = dom.getElementsByTagName(tag)
@@ -73,19 +77,35 @@ def _get_jpp_from_filename(pom_path, jar_path = None):
is "xbean-main". Therefore for jar name to be compatible it has be
in %{_javadir}/xbean/xbean-main.jar
"""
+ # this is not nice, because macros can change but handling these
+ # in rpm macros is ugly as hell
+ javadirs=["/usr/share/java", "/usr/share/java-jni", "/usr/lib/java",
+ "/usr/lib64/java"]
pomname = basename(pom_path)
if jar_path:
if not os.path.isfile(jar_path):
raise IOError("Jar path doesn't exist")
+ jarpart = None
+ for jdir in javadirs:
+ if jdir in jar_path:
+ javadir_re = re.compile(".*%s/" % jdir)
+ jarpart = re.sub(javadir_re, "", jar_path)
+ if not jarpart:
+ raise MissingJarFile()
+
if pomname[3] == '.':
- jpp_gid = "JPP/%s" % basename(dirname(jar_path))
- jpp_aid = basename(jar_path)[:-4]
+ if '/' not in jarpart:
+ raise IncompatibleFilenames(pom_path, jar_path)
+ jpp_gid = "JPP/%s" % dirname(jarpart)
+ jpp_aid = basename(jarpart)[:-4]
# we assert that jar and pom parts match
if not pomname == "JPP.%s-%s.pom" % (jpp_gid[4:], jpp_aid):
raise IncompatibleFilenames(pom_path, jar_path)
else:
+ if '/' in jarpart:
+ raise IncompatibleFilenames(pom_path, jar_path)
jpp_gid = "JPP"
- jpp_aid = basename(jar_path)[:-4]
+ jpp_aid = basename(jarpart)[:-4]
# we assert that jar and pom parts match
if not pomname == "JPP-%s.pom" % jpp_aid:
raise IncompatibleFilenames(pom_path, jar_path)
12 years, 5 months
[javapackages] Add default parameters for add_maven_depmap
by Stanislav Ochotnicky
commit 8c8ddf26203795f95d33d52f502aa704be2b7793
Author: Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Date: Tue Nov 29 15:02:17 2011 +0100
Add default parameters for add_maven_depmap
Now when it is called without arguments it behaves as if it was calle as:
%add_maven_depmap JPP-%{name}.pom %{name}.jar
macros.fjava | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/macros.fjava b/macros.fjava
index 0c14779..9d52d92 100644
--- a/macros.fjava
+++ b/macros.fjava
@@ -42,24 +42,36 @@
#
%add_maven_depmap(f:a:) \
+# default values \
+%if %# == 0 \
+ _pompart="JPP-%{name}.pom" \
+ _jarpart="%{name}.jar" \
+%else \
+ _pompart="%1" \
+ _jarpart="%2" \
+%endif \
install -dm 755 $RPM_BUILD_ROOT/%{_mavendepmapfragdir}\
-_jpath="jar_missing_in_jar_paths" \
-if [ -f %{buildroot}/%{_javadir}/%2 ]; then \
- _jpath="%{buildroot}/%{_javadir}/%2" \
-elif [ -f %{buildroot}/%{_javajnidir}/%2 ]; then \
- _jpath="%{buildroot}/%{_javajnidir}/%2" \
-elif [ -f %{buildroot}/%{_jnidir}/%2 ]; then \
- _jpath="%{buildroot}/%{_jnidir}/%2" \
+_jpath="$_jarpart" \
+if [ -f %{buildroot}/%{_javadir}/$_jarpart ]; then \
+ _jpath="%{buildroot}/%{_javadir}/$_jarpart" \
+elif [ -f %{buildroot}/%{_javajnidir}/$_jarpart ]; then \
+ _jpath="%{buildroot}/%{_javajnidir}/$_jarpart" \
+elif [ -f %{buildroot}/%{_jnidir}/$_jarpart ]; then \
+ _jpath="%{buildroot}/%{_jnidir}/$_jarpart" \
fi \
python -m %{_datadir}/java-utils/maven_depmap %{-a} \\\
%{buildroot}%{_mavendepmapfragdir}/%{name}%{-f*:-%{-f*}} \\\
- %{buildroot}%{_mavenpomdir}/%1 \\\
+ %{buildroot}%{_mavenpomdir}/$_pompart \\\
%if %# == 2 \
"${_jpath}" \\\
%endif \
+%if %# == 0 \
+ "${_jpath}" \\\
+%endif \
\
%{nil}
#==============================================================================
+
12 years, 5 months