Blame SOURCES/macros.openstack-common

838cdc
# Macros for building OpenStack RPMs.
838cdc
#
838cdc
838cdc
#
838cdc
# Python macros
838cdc
#
838cdc
838cdc
%py_setup setup.py
838cdc
838cdc
%py_shbang_opts -s
838cdc
838cdc
%py_build() %{expand:\
838cdc
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?1}\
838cdc
}
838cdc
838cdc
%py2_shbang_opts -s
838cdc
838cdc
%py2_build() %{expand:\
838cdc
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?1}\
838cdc
}
838cdc
838cdc
%py2_install() %{expand:\
838cdc
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
838cdc
}
838cdc
838cdc
#
838cdc
# OpenStack macros
838cdc
#
838cdc
838cdc
# the directory where the test files will be installed
838cdc
%openstack_test_package_dir %{_localstatedir}/lib/%{name}-test
838cdc
838cdc
# Installing a test package is always done the same way.
838cdc
# the macro takes a single parameter - the component which is the
838cdc
# name that is installed into site-packages
838cdc
# e.g. for python-novaclient the name is novaclient
838cdc
%openstack_test_package_install() \
838cdc
install -d -m 755 %{buildroot}/%{openstack_test_package_dir} \
838cdc
# Some packages differ here, try to install as much as possible: \
838cdc
cp -av \\\
838cdc
       README.md README.rst PKG-INFO .testr.conf .stestr.conf .*tests bin \\\
838cdc
       etc examples run_tests.* setup.cfg setup.py \\\
838cdc
       smoketests static test tests tools tox.ini \\\
838cdc
   %{buildroot}/%{openstack_test_package_dir} || : \
838cdc
rm -rf %{buildroot}/%{openstack_test_package_dir}/%1 \
838cdc
ln -s %{python3_sitelib}/%1 %{buildroot}/%{openstack_test_package_dir}/%1 \
838cdc
%nil