awips2/rpms/python.site-packages/Installer.h5py/component.spec
Steve Harris 98059f9ef1 12.9.1-5 baseline
Former-commit-id: 77cbd6c1e5 [formerly a1d931fd44] [formerly 61f269f54c] [formerly 77cbd6c1e5 [formerly a1d931fd44] [formerly 61f269f54c] [formerly f2fac39428 [formerly 61f269f54c [formerly d85b989f77196d20eb2d2a21cf4daa13d50474ae]]]]
Former-commit-id: f2fac39428
Former-commit-id: d9faed979f [formerly 7fb0b17bd5] [formerly 54140b7733222bbc423315196e9781453b12f896 [formerly 72824561cb]]
Former-commit-id: 84e9e52a92ae5e740b0daf680a98316f7435f7f7 [formerly 9b5c2094ed]
Former-commit-id: 2d928d328e
2012-08-21 15:27:03 -05:00

184 lines
3.5 KiB
Ruby

%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%define _build_arch %(uname -i)
%define _python_pkgs_dir "%{_baseline_workspace}/pythonPackages"
#
# AWIPS II Python h5py Spec File
#
Name: awips2-python-h5py
Summary: AWIPS II Python h5py Distribution
Version: 1.3.0
Release: 3
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: %{_build_arch}
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
requires: awips2-python
requires: awips2-python-numpy
requires: libz.so.1
provides: awips2-python-h5py
%description
AWIPS II Python h5py Site-Package
%prep
# Verify That The User Has Specified A BuildRoot.
if [ "%{_build_root}" = "" ]
then
echo "A Build Root has not been specified."
echo "Unable To Continue ... Terminating"
exit 1
fi
rm -rf %{_build_root}
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}/awips2/python/lib
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}/build-python
if [ $? -ne 0 ]; then
exit 1
fi
PRE_REQS_HDF5_TAR=""
if [ "%{_build_arch}" = "i386" ]; then
PRE_REQS_HDF5_TAR="hdf5-1.8.4-patch1-linux-shared.tar.gz"
else
if [ "%{_build_arch}" = "x86_64" ]; then
PRE_REQS_HDF5_TAR="hdf5-1.8.4-patch1-linux-x86_64-shared.tar.gz"
else
echo "ERROR: Unrecognized Architecture."
exit 1
fi
fi
PRE_REQS_DIR="%{_baseline_workspace}/rpms/python.site-packages/deploy.builder/pre-reqs"
cp -v ${PRE_REQS_DIR}/${PRE_REQS_HDF5_TAR} \
%{_build_root}
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
pushd . > /dev/null
cd %{_build_root}
/bin/tar -xvf ${PRE_REQS_HDF5_TAR}
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
rm -f ${PRE_REQS_HDF5_TAR}
popd > /dev/null
%build
HDF5_PATH=
if [ "%{_build_arch}" = "i386" ]; then
HDF5_PATH="%{_build_root}/hdf5-1.8.4-patch1-linux-shared"
else
HDF5_PATH="%{_build_root}/hdf5-1.8.4-patch1-linux-x86_64-shared"
fi
H5PY_SRC_DIR="%{_python_pkgs_dir}/h5py"
SZIP_SRC_DIR="%{_baseline_workspace}/rpms/python.site-packages/Installer.h5py/src"
SZIP_TAR="szip-2.1.tar"
# Copy the h5py source.
cp -rv ${H5PY_SRC_DIR}/* \
%{_build_root}/build-python
if [ $? -ne 0 ]; then
exit 1
fi
# Copy the szip source.
cp -rv ${SZIP_SRC_DIR}/${SZIP_TAR} \
%{_build_root}/build-python
if [ $? -ne 0 ]; then
exit 1
fi
pushd . > /dev/null
# build h5py
cd %{_build_root}/build-python
export LD_LIBRARY_PATH=/awips2/python/lib
/awips2/python/bin/python setup.py build \
--hdf5=${HDF5_PATH}
if [ $? -ne 0 ]; then
exit 1
fi
# build szip
/bin/tar -xf ${SZIP_TAR}
if [ $? -ne 0 ]; then
exit 1
fi
cd szip-2.1
./configure
if [ $? -ne 0 ]; then
exit 1
fi
make
if [ $? -ne 0 ]; then
exit 1
fi
cp -P src/.libs/libsz.so* \
%{_build_root}/awips2/python/lib
if [ $? -ne 0 ]; then
exit 1
fi
cd ..
/bin/rm -f ${SZIP_TAR}
if [ $? -ne 0 ]; then
exit 1
fi
/bin/rm -rf szip-2.1
if [ $? -ne 0 ]; then
exit 1
fi
popd > /dev/null
%install
HDF5_PATH=
if [ "%{_build_arch}" = "i386" ]; then
HDF5_PATH="%{_build_root}/hdf5-1.8.4-patch1-linux-shared"
else
HDF5_PATH="%{_build_root}/hdf5-1.8.4-patch1-linux-x86_64-shared"
fi
pushd . > /dev/null
cd %{_build_root}/build-python
export LD_LIBRARY_PATH=/awips2/python/lib
/awips2/python/bin/python setup.py install \
--root=%{_build_root} \
--prefix=/awips2/python
popd > /dev/null
rm -rf ${HDF5_PATH}
rm -rf %{_build_root}/build-python
%pre
%post
%preun
%postun
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2/python/lib
/awips2/python/lib/*