Fix OSGi provides/requires generation in Java libdir

- Resolves: rhbz#1166156
This commit is contained in:
Mikolaj Izdebski 2014-11-21 06:15:35 +01:00
parent 8b7596336b
commit 0aabe81a8e
6 changed files with 119 additions and 4 deletions

View File

@ -1,7 +1,7 @@
From eafaa146aace0885d17ff472db0a63aef75f2ce5 Mon Sep 17 00:00:00 2001
From: Michal Srb <msrb@redhat.com>
Date: Thu, 18 Sep 2014 10:48:07 +0200
Subject: [PATCH 1/3] [mvn_artifact] Append dependencies to metadata, if we
Subject: [PATCH 1/5] [mvn_artifact] Append dependencies to metadata, if we
have them
---

View File

@ -1,7 +1,7 @@
From dee96bf521cdbae4c80ee328968e1ff5200f2aab Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Thu, 30 Oct 2014 15:20:20 +0100
Subject: [PATCH 2/3] Use wrapper script to inject extra JVM arguments
Subject: [PATCH 2/5] Use wrapper script to inject extra JVM arguments
---
install | 1 +

View File

@ -1,7 +1,7 @@
From 97ee162d443fd954208c277c43f7195339b01e8d Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Thu, 30 Oct 2014 08:36:56 +0100
Subject: [PATCH 3/3] Use architecture-independent location of
Subject: [PATCH 3/5] Use architecture-independent location of
abrt-java-connector
The connector's library has been moved to architecture-independent

View File

@ -0,0 +1,71 @@
From bd3bfd39508792f91621cba0b6279eeeef4aa866 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Thu, 30 Oct 2014 09:18:08 +0100
Subject: [PATCH 4/5] Make sure %{_libdir} is not use
Javapackages as noarch package cannot safely reference libdir.
---
build | 1 -
configure | 2 --
depgenerators/fileattrs/osgi.attr | 2 +-
python/javapackages/common/osgi.py | 2 +-
4 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/build b/build
index 336ac2a..67da1b3 100755
--- a/build
+++ b/build
@@ -54,7 +54,6 @@ expand()
sed \
-e "s|%{bindir}|${bindir}|" \
- -e "s|%{libdir}|${libdir}|" \
-e "s|%{datadir}|${datadir}|" \
-e "s|%{javaconfdir}|${javaconfdir}|" \
-e "s|%{javadir}|${javadir}|" \
diff --git a/configure b/configure
index ab9388d..da9c9a1 100755
--- a/configure
+++ b/configure
@@ -44,7 +44,6 @@ function set_pyinterpreter() {
vars="
bindir
datadir
-libdir
localstatedir
mandir
prefix
@@ -82,7 +81,6 @@ eval $(for _; do echo "$_"; done |
test -z "${prefix}" && prefix="/usr/local"
test -z "${bindir}" && bindir="${prefix}/bin"
test -z "${datadir}" && datadir="${prefix}/share"
-test -z "${libdir}" && libdir="${prefix}/lib"
test -z "${localstatedir}" && localstatedir="${prefix}/var"
test -z "${mandir}" && mandir="${datadir}/man"
test -z "${rundir}" && rundir="${localstatedir}/run"
diff --git a/depgenerators/fileattrs/osgi.attr b/depgenerators/fileattrs/osgi.attr
index 58bba2d..f65cb0a 100644
--- a/depgenerators/fileattrs/osgi.attr
+++ b/depgenerators/fileattrs/osgi.attr
@@ -2,4 +2,4 @@
%__osgi_provides_opts %{_builddir}/%{?buildsubdir}
%__osgi_requires %{_rpmconfigdir}/osgi.req
%__osgi_requires_opts %{_builddir}/%{?buildsubdir}
-%__osgi_path ^(.*\\.jar$|((%{_libdir}|%{_datadir}).*/MANIFEST.MF))
+%__osgi_path ^(.*\\.jar$|((%{_prefix}/lib|%{_datadir})/.*/MANIFEST.MF))
diff --git a/python/javapackages/common/osgi.py b/python/javapackages/common/osgi.py
index fdfdc3b..a1d72fc 100644
--- a/python/javapackages/common/osgi.py
+++ b/python/javapackages/common/osgi.py
@@ -177,7 +177,7 @@ def _check_path(path):
# who knows where the manifest can be in buildroot
# TODO: improve this check somehow(?)
# this is an attempt to identify only MANIFEST.MF files
- # which are in %{_datadir} or %{_libdir}
+ # which are in %{_datadir} or %{_prefix}/lib
if "/usr/share/" in path or "/usr/lib" in path:
return True
return False
--
1.9.3

View File

@ -0,0 +1,36 @@
From f0a2e4226028c4a68d956ef9ac1d4d43fdbe961e Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Thu, 20 Nov 2014 16:22:52 +0100
Subject: [PATCH 5/5] Improve patterns for matching OSGi manifests
---
depgenerators/fileattrs/osgi.attr | 2 +-
python/javapackages/common/osgi.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/depgenerators/fileattrs/osgi.attr b/depgenerators/fileattrs/osgi.attr
index f65cb0a..edacd4d 100644
--- a/depgenerators/fileattrs/osgi.attr
+++ b/depgenerators/fileattrs/osgi.attr
@@ -2,4 +2,4 @@
%__osgi_provides_opts %{_builddir}/%{?buildsubdir}
%__osgi_requires %{_rpmconfigdir}/osgi.req
%__osgi_requires_opts %{_builddir}/%{?buildsubdir}
-%__osgi_path ^(.*\\.jar$|((%{_prefix}/lib|%{_datadir})/.*/MANIFEST.MF))
+%__osgi_path ^(.*\\.jar|((%{_prefix}/lib|%{_datadir})/.*/META-INF/MANIFEST.MF))$
diff --git a/python/javapackages/common/osgi.py b/python/javapackages/common/osgi.py
index a1d72fc..66610c2 100644
--- a/python/javapackages/common/osgi.py
+++ b/python/javapackages/common/osgi.py
@@ -93,7 +93,7 @@ def split_bundle_name(bundles):
def open_manifest(path):
mf = None
- if path.endswith("META-INF/MANIFEST.MF"):
+ if path.endswith("/META-INF/MANIFEST.MF"):
mf = open(path, "rb")
if zipfile.is_zipfile(path):
# looks like "zipfile.is_zipfile()" is not reliable
--
1.9.3

View File

@ -7,7 +7,7 @@
Name: javapackages-tools
Version: 4.2.0
Release: 6%{?dist}
Release: 7%{?dist}
Summary: Macros and scripts for Java packaging support
@ -20,6 +20,8 @@ Patch2: 0001-pom_editor-Fix-missing-space-between-xmlns-declarati.patch
Patch3: 0002-Use-wrapper-script-to-inject-extra-JVM-arguments.patch
Patch4: 0003-Use-architecture-independent-location-of-abrt-java-c.patch
Patch5: 0001-fix-rhbz#1155185.patch
Patch6: 0004-Make-sure-_libdir-is-not-use.patch
Patch7: 0005-Improve-patterns-for-matching-OSGi-manifests.patch
BuildArch: noarch
@ -177,6 +179,8 @@ This package provides non-essential macros and scripts to support Java packaging
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%if 0%{?with_python3}
find . -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python3}|'
@ -242,6 +246,10 @@ popd
%doc LICENSE
%changelog
* Fri Nov 21 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-7
- Fix OSGi provides/requires generation in Java libdir
- Resolves: rhbz#1166156
* Wed Nov 12 2014 Michal Srb <msrb@redhat.com> - 4.2.0-6
- Fix cache problem (Resolves: rhbz#1155185)