Accepting request 867810 from home:eeich:branches:science
- Fix update_so_version.sh, write so versions to file being included. OBS-URL: https://build.opensuse.org/request/show/867810 OBS-URL: https://build.opensuse.org/package/show/science/hdf5?expand=0&rev=143
This commit is contained in:
parent
bf5699679e
commit
7175d87ee7
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jan 29 22:05:44 UTC 2021 - Egbert Eich <eich@suse.com>
|
||||||
|
|
||||||
|
- Fix update_so_version.sh, write so versions to file being included.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Nov 6 10:41:02 UTC 2020 - Ana Guerrero Lopez <aguerrero@suse.com>
|
Fri Nov 6 10:41:02 UTC 2020 - Ana Guerrero Lopez <aguerrero@suse.com>
|
||||||
|
|
||||||
|
14
hdf5.spec
14
hdf5.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package hdf5
|
# spec file for package hdf5
|
||||||
#
|
#
|
||||||
# Copyright (c) 2020 SUSE LLC
|
# Copyright (c) 2021 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -412,14 +412,8 @@ ExclusiveArch: do_not_build
|
|||||||
%define vname %{pname}
|
%define vname %{pname}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# TODO: The so numbers autodetected by update_so_version.sh
|
# Run 'sh ./update_so_version.sh' when updating hdf5!
|
||||||
# do not match the so numbers that are actually built.
|
%include %{_sourcedir}/so_versions
|
||||||
%define sonum 103
|
|
||||||
%define sonum_CXX 103
|
|
||||||
%define sonum_F 102
|
|
||||||
%define sonum_HL 100
|
|
||||||
%define sonum_HL_CXX 100
|
|
||||||
%define sonum_HL_F 100
|
|
||||||
|
|
||||||
Name: %{package_name}
|
Name: %{package_name}
|
||||||
Version: %vers
|
Version: %vers
|
||||||
@ -429,7 +423,7 @@ License: BSD-3-Clause
|
|||||||
Group: Productivity/Scientific/Other
|
Group: Productivity/Scientific/Other
|
||||||
URL: https://www.hdfgroup.org/HDF5/
|
URL: https://www.hdfgroup.org/HDF5/
|
||||||
Source0: https://www.hdfgroup.org/ftp/HDF5/releases/%{pname}-%{short_ver}/%{pname}-%{src_ver}/src/%{pname}-%{src_ver}.tar.bz2
|
Source0: https://www.hdfgroup.org/ftp/HDF5/releases/%{pname}-%{short_ver}/%{pname}-%{src_ver}/src/%{pname}-%{src_ver}.tar.bz2
|
||||||
Source100: _multibuild
|
Source100: so_versions
|
||||||
Source1000: update_so_version.sh
|
Source1000: update_so_version.sh
|
||||||
Patch0: hdf5-LD_LIBRARY_PATH.patch
|
Patch0: hdf5-LD_LIBRARY_PATH.patch
|
||||||
# not really needed but we want to get noticed if hdf5 doesn' t know our host
|
# not really needed but we want to get noticed if hdf5 doesn' t know our host
|
||||||
|
6
so_versions
Normal file
6
so_versions
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
%define sonum 103
|
||||||
|
%define sonum_CXX 103
|
||||||
|
%define sonum_F 102
|
||||||
|
%define sonum_HL 100
|
||||||
|
%define sonum_HL_CXX 100
|
||||||
|
%define sonum_HL_F 100
|
@ -6,15 +6,10 @@ exit_error()
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg()
|
|
||||||
{
|
|
||||||
echo "dbg: $@" >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup()
|
cleanup()
|
||||||
{
|
{
|
||||||
rm -f lt_vers.sh sonum_spec.sed
|
rm -f ${spectmp}
|
||||||
rm -f hdf5.spec.tmp
|
rm -f ${shtmp}
|
||||||
}
|
}
|
||||||
|
|
||||||
## We are going to parse these variables from tarball:
|
## We are going to parse these variables from tarball:
|
||||||
@ -24,47 +19,46 @@ cleanup()
|
|||||||
# LT_HL_VERS_INTERFACE
|
# LT_HL_VERS_INTERFACE
|
||||||
# LT_HL_CXX_VERS_INTERFACE
|
# LT_HL_CXX_VERS_INTERFACE
|
||||||
# LT_HL_F_VERS_INTERFACE
|
# LT_HL_F_VERS_INTERFACE
|
||||||
# LT_TOOLS_VERS_INTERFACE
|
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
VER="$(grep -m1 "^Version:" hdf5.spec)" || exit_error "can't grep version"
|
spectmp=$(mktemp hdf-XXXX.spec)
|
||||||
|
shtmp=$(mktemp lt-XXXX.sh)
|
||||||
|
outtmp=$(mktemp so-XXXX)
|
||||||
|
sed -e "s/@BUILD_FLAVOR@/standard/" hdf5.spec > ${spectmp}
|
||||||
|
VER="$(rpmspec --define "_sourcedir $(pwd)" -P ${spectmp} | grep -m1 "^Version:")" || \
|
||||||
|
exit_error "can't grep version"
|
||||||
read x VER <<<$VER
|
read x VER <<<$VER
|
||||||
|
|
||||||
SRC="$(grep -m1 "^Source0:" hdf5.spec)" || exit_error "can't grep source"
|
SRC="$(rpmspec --define "_sourcedir $(pwd)" -P ${spectmp} | grep -m1 "^Source0:")" || \
|
||||||
|
exit_error "can't grep source"
|
||||||
read x SRC <<<$SRC
|
read x SRC <<<$SRC
|
||||||
SRC=$(basename "$SRC" | sed "s/%{version}/$VER/")
|
SRC=$(basename "$SRC" | sed "s/%{version}/$VER/")
|
||||||
|
|
||||||
test -f "$SRC" || exit_error "tarball '$SRC' does not exist"
|
test -f "$SRC" || exit_error "tarball '$SRC' does not exist"
|
||||||
dbg "inspecting $SRC"
|
|
||||||
|
|
||||||
tar --wildcards -x -O -f "$SRC" "*/config/lt_vers.am" \
|
tar --wildcards -x -O -f "$SRC" "*/config/lt_vers.am" \
|
||||||
| tr -d ' \t' \
|
| tr -d ' \t' \
|
||||||
| grep "^LT_.*INTERFACE=" \
|
| grep -E "^LT_.*INTERFACE=|^LT_.*AGE=" \
|
||||||
> lt_vers.sh \
|
> ${shtmp} \
|
||||||
|| exit_error "can't grep interface versions"
|
|| exit_error "can't grep interface versions"
|
||||||
|
|
||||||
# we expect exactly 7 variables
|
source ./${shtmp} || exit_error "can't source ${shtmp}"
|
||||||
. lt_vers.sh || exit_error "can't source lt_vers.sh"
|
|
||||||
test $(wc -l < lt_vers.sh) -le "7" \
|
|
||||||
|| exit_error "more than 7 vars found, update this script!"
|
|
||||||
|
|
||||||
for infix in "" _CXX _F _HL _HL_CXX _HL_F _TOOLS; do
|
for infix in "" _CXX _F _HL _HL_CXX _HL_F; do
|
||||||
var="LT${infix}_VERS_INTERFACE"
|
current="LT${infix}_VERS_INTERFACE"
|
||||||
test "${!var}" -gt 0 || exit_error "$var='${!var}' bad or undefined"
|
age="LT${infix}_VERS_AGE"
|
||||||
dbg "update $var=${!var}"
|
currv=$(eval "echo \$$current")
|
||||||
def_sonum="sonum${infix}"
|
agev=$(eval "echo \$$age")
|
||||||
# create sed scripts for spec file
|
if [ -n "$currv" -a -n "$agev" ]; then
|
||||||
echo "s/^%define $def_sonum .*/%define $def_sonum ${!var}/" >> sonum_spec.sed
|
echo %define sonum${infix} $((currv - agev)) >> ${outtmp}
|
||||||
|
else
|
||||||
|
rm -f ${outtmp}
|
||||||
|
cleanup
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# update spec file if needed
|
[ -e ${outtmp} ] && mv ${outtmp} so_versions
|
||||||
sed -f sonum_spec.sed hdf5.spec > hdf5.spec.tmp
|
|
||||||
if diff -q hdf5.spec.tmp hdf5.spec &>/dev/null; then
|
|
||||||
dbg "hdf5.spec was up-to-date"
|
|
||||||
else
|
|
||||||
mv hdf5.spec.tmp hdf5.spec
|
|
||||||
echo "hdf5.spec updated" >&2
|
|
||||||
fi
|
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user