awips2/rpms/python.site-packages/Installer.dynamicserialize/component.spec

77 lines
2.7 KiB
RPMSpec
Raw Normal View History

2022-05-05 12:34:50 -05:00
# Change the brp-python-bytecompile script to use the AWIPS2 version of Python. #7237
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's/\/usr\/bin\/python/\/awips2\/python\/bin\/python/g')
%define _python_pkgs_dir "%{_baseline_workspace}/pythonPackages"
%define _installed_python %(if [ -f /awips2/python/bin/python ]; then /awips2/python/bin/python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))'; else echo 0; fi)
%define _installed_python_short %(if [ -f /awips2/python/bin/python ]; then /awips2/python/bin/python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))'; else echo 0; fi)
#
# AWIPS II Python dynamicserialize Spec File
#
Name: awips2-python-dynamicserialize
Summary: AWIPS II Python dynamicserialize Distribution
Version: %{_component_version}
Release: %{_installed_python}.%{_component_release}%{?dist}
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: noarch
URL: N/A
License: N/A
Distribution: N/A
Vendor: %{_build_vendor}
2022-05-05 12:34:50 -05:00
Packager: %{_build_site}
AutoReq: no
Requires: awips2-python = %{_installed_python}
Requires: awips2-python-thrift
Provides: awips2-python-dynamicserialize = %{version}
BuildRequires: awips2-python
BuildRequires: awips2-python-thrift
%description
AWIPS II Python dynamicserialize Site-Package - 64-bit.
%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
%install
mkdir -p %{_build_root}/awips2/python/lib/python%{_installed_python_short}/site-packages/dynamicserialize
if [ $? -ne 0 ]; then
exit 1
fi
DYNAMICSERIALIZE_SRC_DIR="%{_python_pkgs_dir}/dynamicserialize"
cp -rv ${DYNAMICSERIALIZE_SRC_DIR}/* \
%{_build_root}/awips2/python/lib/python%{_installed_python_short}/site-packages/dynamicserialize
# Find plugin-contributed files and add them to the site packages.
find %{_baseline_workspace} -path '%{_baseline_workspace}/*/pythonPackages/dynamicserialize' \
-exec cp {} -rv %{_build_root}/awips2/python/lib/python%{_installed_python_short}/site-packages \;
bash %{_baseline_workspace}/build.edex/opt/tools/update_dstypes.sh %{_build_root}/awips2/python/lib/python%{_installed_python_short}/site-packages/dynamicserialize
%pre
if [ -d /awips2/python/lib/python%{_installed_python_short}/site-packages/dynamicserialize ]; then
rm -rf /awips2/python/lib/python%{_installed_python_short}/site-packages/dynamicserialize
fi
%clean
rm -rf %{_build_root}
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2/python/lib/python%{_installed_python_short}/site-packages/dynamicserialize
/awips2/python/lib/python%{_installed_python_short}/site-packages/dynamicserialize/*