awips2/rpms/python.site-packages/Installer.shapely/component.spec
Bryan Kowal 976834171e Issue #1416: added the python package shapely
- shapely and dependencies will now be built as part of the
  32-bit build and the 64-bit build from source
- shapely will also be included as part of the AWIPS II
  MSFT Windows environment


Former-commit-id: ef0b12813d [formerly 8d1e29448a] [formerly 5e22c24657 [formerly 82872ebbfb8f2793fb7d95842d33ba8a0cd41ae6]]
Former-commit-id: 5e22c24657
Former-commit-id: 6103e7c485
2012-12-17 15:27:43 -06:00

146 lines
No EOL
3.1 KiB
RPMSpec

%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 shapely Spec File
#
Name: awips2-python-shapely
Summary: AWIPS II Python shapely Distribution
Version: 1.2.16
Release: 1
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
provides: awips2-python-shapely
%description
AWIPS II Python shapely 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
if [ -d ${RPM_BUILD_ROOT} ]; then
rm -rf ${RPM_BUILD_ROOT}
if [ $? -ne 0 ]; then
exit 1
fi
fi
rm -rf %{_build_root}
mkdir -p %{_build_root}
mkdir -p %{_build_root}/build-python
PYTHON_RPM_DIR="%{_baseline_workspace}/rpms/python.site-packages"
INSTALL_SETUPTOOLS_SH="${PYTHON_RPM_DIR}/deploy.builder/install-setuptools.sh"
# install setuptools
/bin/bash ${INSTALL_SETUPTOOLS_SH} %{_baseline_workspace} \
%{_python_pkgs_dir} %{_build_root}/build-python
if [ $? -ne 0 ]; then
exit 1
fi
rm -rf %{_build_root}/build-python
mkdir -p %{_build_root}/build-python
mkdir -p %{_build_root}/awips2/python/lib
mkdir -p %{_build_root}/awips2/python/bin
mkdir -p %{_build_root}/awips2/python/include
%build
# build geos
__GEOS_TAR=geos-3.3.6.tar.bz2
__GEOS_UNTARRED=geos-3.3.6
PYTHON_RPM_DIR="%{_baseline_workspace}/rpms/python.site-packages"
INSTALLER_SHAPELY_DIR="${PYTHON_RPM_DIR}/Installer.shapely"
cp ${INSTALLER_SHAPELY_DIR}/${__GEOS_TAR} \
%{_build_root}/build-python
if [ $? -ne 0 ]; then
exit 1
fi
cd %{_build_root}/build-python
tar -xvf ${__GEOS_TAR}
if [ $? -ne 0 ]; then
exit 1
fi
cd ${__GEOS_UNTARRED}
./configure --prefix=%{_build_root}/awips2/python
if [ $? -ne 0 ]; then
exit 1
fi
make
if [ $? -ne 0 ]; then
exit 1
fi
make install
if [ $? -ne 0 ]; then
exit 1
fi
# build the shapely python site-package
SHAPELY_SRC_DIR="%{_python_pkgs_dir}/shapely"
__SHAPELY=shapely
__SHAPELY_TAR=Shapely-1.2.16.tar.gz
__SHAPELY_UNTARRED=Shapely-1.2.16
cp %{_python_pkgs_dir}/${__SHAPELY}/${__SHAPELY_TAR} \
%{_build_root}/build-python
if [ $? -ne 0 ]; then
exit 1
fi
cd %{_build_root}/build-python
tar -xvf ${__SHAPELY_TAR}
if [ $? -ne 0 ]; then
exit 1
fi
export CPPFLAGS="-I%{_build_root}/awips2/python/include"
export CPPFLAGS="${CPPFLAGS} -L%{_build_root}/awips2/python/lib"
cd ${__SHAPELY_UNTARRED}
/awips2/python/bin/python setup.py build
if [ $? -ne 0 ]; then
exit 1
fi
/awips2/python/bin/python setup.py install \
--root=%{_build_root} \
--prefix=/awips2/python
if [ $? -ne 0 ]; then
exit 1
fi
rm -rf %{_build_root}/build-python
if [ $? -ne 0 ]; then
exit 1
fi
%install
%clean
rm -rf %{_build_root}
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2/python/bin
/awips2/python/bin/*
%dir /awips2/python/lib
/awips2/python/lib/*
%dir /awips2/python/include
/awips2/python/include/*