Lines 56-62
Link Here
|
56 |
_java-osgi_plugin() { |
56 |
_java-osgi_plugin() { |
57 |
# We hardcode Gentoo as the vendor name |
57 |
# We hardcode Gentoo as the vendor name |
58 |
|
58 |
|
59 |
cat > "${_OSGI_T}/tmp_jar/plugin.properties" <<-EOF |
59 |
cat > "${_OSGI_T}/osgi/plugin.properties" <<-EOF |
60 |
bundleName="${1}" |
60 |
bundleName="${1}" |
61 |
vendorName="Gentoo" |
61 |
vendorName="Gentoo" |
62 |
EOF |
62 |
EOF |
Lines 85-97
Link Here
|
85 |
local absoluteJarPath="$(_canonicalise ${1})" |
85 |
local absoluteJarPath="$(_canonicalise ${1})" |
86 |
local jarName="$(basename ${1})" |
86 |
local jarName="$(basename ${1})" |
87 |
|
87 |
|
88 |
mkdir "${_OSGI_T}/tmp_jar" || die "Unable to create directory ${_OSGI_T}/tmp_jar" |
|
|
89 |
[[ -d "${_OSGI_T}/osgi" ]] || mkdir "${_OSGI_T}/osgi" || die "Unable to create directory ${_OSGI_T}/osgi" |
88 |
[[ -d "${_OSGI_T}/osgi" ]] || mkdir "${_OSGI_T}/osgi" || die "Unable to create directory ${_OSGI_T}/osgi" |
90 |
|
89 |
|
91 |
cd "${_OSGI_T}/tmp_jar" && jar xf "${absoluteJarPath}" && cd - > /dev/null \ |
90 |
cat > "${_OSGI_T}/osgi/MANIFEST.MF" <<-EOF |
92 |
|| die "Unable to uncompress correctly the original jar" |
|
|
93 |
|
94 |
cat > "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" <<-EOF |
95 |
Manifest-Version: 1.0 |
91 |
Manifest-Version: 1.0 |
96 |
Bundle-ManifestVersion: 2 |
92 |
Bundle-ManifestVersion: 2 |
97 |
Bundle-Name: %bundleName |
93 |
Bundle-Name: %bundleName |
Lines 104-112
Link Here
|
104 |
|
100 |
|
105 |
_java-osgi_plugin "${3}" |
101 |
_java-osgi_plugin "${3}" |
106 |
|
102 |
|
107 |
jar cfm "${_OSGI_T}/osgi/${jarName}" "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" \ |
103 |
cp "${absoluteJarPath}" "${_OSGI_T}/osgi" |
108 |
-C "${_OSGI_T}/tmp_jar/" . > /dev/null || die "Unable to recreate the OSGi compliant jar" |
104 |
jar ufm "${_OSGI_T}/osgi/${jarName}" "${_OSGI_T}/osgi/MANIFEST.MF" \ |
109 |
rm -rf "${_OSGI_T}/tmp_jar" |
105 |
-C "${_OSGI_T}/osgi/" plugin.properties \ |
|
|
106 |
|| die "Unable to update jar to be OSGi compliant" |
110 |
} |
107 |
} |
111 |
|
108 |
|
112 |
# ----------------------------------------------------------------------------- |
109 |
# ----------------------------------------------------------------------------- |
Lines 193-220
Link Here
|
193 |
local absoluteJarPath="$(_canonicalise ${1})" |
190 |
local absoluteJarPath="$(_canonicalise ${1})" |
194 |
local jarName="$(basename ${1})" |
191 |
local jarName="$(basename ${1})" |
195 |
|
192 |
|
196 |
mkdir "${_OSGI_T}/tmp_jar" || die "Unable to create directory ${_OSGI_T}/tmp_jar" |
|
|
197 |
[[ -d "${_OSGI_T}/osgi" ]] || mkdir "${_OSGI_T}/osgi" || die "Unable to create directory ${_OSGI_T}/osgi" |
193 |
[[ -d "${_OSGI_T}/osgi" ]] || mkdir "${_OSGI_T}/osgi" || die "Unable to create directory ${_OSGI_T}/osgi" |
198 |
|
194 |
|
199 |
cd "${_OSGI_T}/tmp_jar" && jar xf "${absoluteJarPath}" && cd - > /dev/null \ |
|
|
200 |
|| die "Unable to uncompress correctly the original jar" |
201 |
|
202 |
[[ -e "${2}" ]] || die "Manifest file ${2} not found" |
195 |
[[ -e "${2}" ]] || die "Manifest file ${2} not found" |
203 |
|
196 |
|
204 |
# We automatically change the version if automatic version rewriting is on |
197 |
# We automatically change the version if automatic version rewriting is on |
205 |
|
198 |
|
206 |
if (( ${4} )); then |
199 |
if (( ${4} )); then |
207 |
cat "${2}" | sed "s/Bundle-Version:.*/Bundle-Version: ${PV}/" > \ |
200 |
cat "${2}" | sed "s/Bundle-Version:.*/Bundle-Version: ${PV}/" > \ |
208 |
"${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" |
201 |
"${_OSGI_T}/osgi/MANIFEST.MF" |
209 |
else |
202 |
else |
210 |
cat "${2}" > "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" |
203 |
cat "${2}" > "${_OSGI_T}/osgi/MANIFEST.MF" |
211 |
fi |
204 |
fi |
212 |
|
205 |
|
213 |
_java-osgi_plugin "${3}" |
206 |
_java-osgi_plugin "${3}" |
214 |
|
207 |
|
215 |
jar cfm "${_OSGI_T}/osgi/${jarName}" "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" \ |
208 |
cp "${absoluteJarPath}" "${_OSGI_T}/osgi" |
216 |
-C "${_OSGI_T}/tmp_jar/" . > /dev/null || die "Unable to recreate the OSGi compliant jar" |
209 |
jar ufm "${_OSGI_T}/osgi/${jarName}" "${_OSGI_T}/osgi/MANIFEST.MF" \ |
217 |
rm -rf "${_OSGI_T}/tmp_jar" |
210 |
-C "${_OSGI_T}/osgi/" plugin.properties \ |
|
|
211 |
|| die "Unable to update jar to be OSGi compliant" |
218 |
} |
212 |
} |
219 |
|
213 |
|
220 |
# ----------------------------------------------------------------------------- |
214 |
# ----------------------------------------------------------------------------- |