Mailinglist Archive: opensuse-commit (1903 mails)

< Previous Next >
commit openstack-macros for openSUSE:Factory
Hello community,

here is the log from the commit of package openstack-macros for
openSUSE:Factory checked in at 2019-04-12 09:13:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openstack-macros (Old)
and /work/SRC/openSUSE:Factory/.openstack-macros.new.27019 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openstack-macros"

Fri Apr 12 09:13:22 2019 rev:8 rq:692812 version:2019.1.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/openstack-macros/openstack-macros.changes
2018-02-15 19:31:51.793994874 +0100
+++
/work/SRC/openSUSE:Factory/.openstack-macros.new.27019/openstack-macros.changes
2019-04-12 09:13:24.765640778 +0200
@@ -1,0 +2,10 @@
+Mon Apr 8 21:02:32 UTC 2019 - Dirk Mueller <dmueller@xxxxxxxx>
+
+- update to 2019.1.1:
+ * macros: Ensure that py_req_cleanup is a multiline macro in impls
+ * Remove documentation-build error flag globally on prepare cleanup
+ * Add new %__openstack_set_env macro
+ * openstack-macros: Install .stestr.conf for -test packages
+ * Fix all Url fields for new spec-cleaner release
+
+-------------------------------------------------------------------

Old:
----
openstack-macros-2018.1.tar.bz2

New:
----
macros.openstack-common
macros.openstack-fedora
macros.openstack-rdo
macros.openstack-suse

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ openstack-macros.spec ++++++
--- /var/tmp/diff_new_pack.fiXoIB/_old 2019-04-12 09:13:25.629641286 +0200
+++ /var/tmp/diff_new_pack.fiXoIB/_new 2019-04-12 09:13:25.633641289 +0200
@@ -1,7 +1,7 @@
#
# spec file for package openstack-macros
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,50 +12,62 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


-%if 0%{?rhel} || 0%{?fedora}
+%if 0%{?rhel}
%global rdo 1
%endif
Name: openstack-macros
-Version: 2018.1
+Version: 2019.1.1
Release: 0
Summary: OpenStack Packaging - RPM Macros
License: Apache-2.0
Group: Development/Libraries/Python
-Url: https://wiki.openstack.org/wiki/Rpm-packaging
-Source0: openstack-macros-%{version}.tar.bz2
+URL: https://wiki.openstack.org/wiki/Rpm-packaging
+Source1: macros.openstack-common
+Source2: macros.openstack-suse
+Source3: macros.openstack-rdo
+Source4: macros.openstack-fedora
BuildArch: noarch
+%if 0%{?rdo}
+Obsoletes: rdo-rpm-macros <= 1-3
+# Fake NVR to avoid dealing with epochs
+# just bump release field
+Provides: rdo-rpm-macros = 1-4
+%endif

%description
This package provides OpenStack RPM macros. You need it to build OpenStack
packages.

%prep
-%setup -q

%build

%install
-install -D -m644 macros.openstack-common
%{buildroot}%{_sysconfdir}/rpm/macros.openstack-common
-install -D -m644 macros.openstack-singlespec
%{buildroot}%{_sysconfdir}/rpm/macros.openstack-singlespec
+install -D -m644 %{SOURCE1}
%{buildroot}%{_sysconfdir}/rpm/macros.openstack-common
%if 0%{?suse_version}
-install -D -m644 macros.openstack-suse
%{buildroot}%{_sysconfdir}/rpm/macros.openstack-suse
+install -D -m644 %{SOURCE2}
%{buildroot}%{_sysconfdir}/rpm/macros.openstack-suse
%endif
%if 0%{?rdo}
-install -D -m644 macros.openstack-rdo
%{buildroot}%{_sysconfdir}/rpm/macros.openstack-rdo
+install -D -m644 %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.openstack-rdo
+%endif
+%if 0%{?fedora} || 0%{?rhel} > 7
+install -D -m644 %{SOURCE4}
%{buildroot}%{_sysconfdir}/rpm/macros.openstack-fedora
%endif

%files
%{_sysconfdir}/rpm/macros.openstack-common
-%{_sysconfdir}/rpm/macros.openstack-singlespec
%if 0%{?suse_version}
%{_sysconfdir}/rpm/macros.openstack-suse
%endif
%if 0%{?rdo}
%{_sysconfdir}/rpm/macros.openstack-rdo
%endif
+%if 0%{?fedora} || 0%{?rhel} > 7
+%{_sysconfdir}/rpm/macros.openstack-fedora
+%endif

%changelog

++++++ _service ++++++
--- /var/tmp/diff_new_pack.fiXoIB/_old 2019-04-12 09:13:25.661641305 +0200
+++ /var/tmp/diff_new_pack.fiXoIB/_new 2019-04-12 09:13:25.661641305 +0200
@@ -7,7 +7,7 @@
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="filename">openstack-macros</param>
- <param name="revision">master</param>
+ <param name="revision">stable/queens</param>
<param name="version">2018.1</param>
<param name="changesgenerate">enable</param>
<param name="subdir">openstack/openstack-macros</param>

++++++ macros.openstack-common ++++++
# Macros for building OpenStack RPMs.
#

#
# Python macros
#

%py_setup setup.py

%py_shbang_opts -s

%py_build() %{expand:\
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build
--executable="%{__python2} %{py_shbang_opts}" %{?1}\
}

%py2_shbang_opts -s

%py2_build() %{expand:\
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build
--executable="%{__python2} %{py2_shbang_opts}" %{?1}\
}

%py2_install() %{expand:\
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1
--skip-build --root %{buildroot} %{?1}\
}

#
# OpenStack macros
#

# the directory where the test files will be installed
%openstack_test_package_dir %{_localstatedir}/lib/%{name}-test

# Installing a test package is always done the same way.
# the macro takes a single parameter - the component which is the
# name that is installed into site-packages
# e.g. for python-novaclient the name is novaclient
%openstack_test_package_install() \
install -d -m 755 %{buildroot}/%{openstack_test_package_dir} \
# Some packages differ here, try to install as much as possible: \
cp -av \\\
README.md README.rst PKG-INFO .testr.conf .stestr.conf .*tests bin \\\
etc examples run_tests.* setup.cfg setup.py \\\
smoketests static test tests tools tox.ini \\\
%{buildroot}/%{openstack_test_package_dir} || : \
rm -rf %{buildroot}/%{openstack_test_package_dir}/%1 \
ln -s %{python2_sitelib}/%1 %{buildroot}/%{openstack_test_package_dir}/%1 \
%nil
++++++ macros.openstack-fedora ++++++
# Fedora macros

# Create given user with given group (to be used as %pre scriptlet for
# openstack related daemons). Also migrates away from openstack- prefixed
# users/group if it exists
# Optional:
# -u userid to pick
# -g groupid to pick
# -s shell to pick
# Example: openstack_pre_user_group_create keystone keystone
%openstack_pre_user_group_create(u:g:s:) \
getent group %2 >/dev/null || { \
groupadd -r %2 $oldg \
} \
getent passwd %1 >/dev/null || { \
useradd -r -g %2 %{-u:-u %{-u*}} -d %{_sharedstatedir}/%1 %{-s:-s
%{-s*}}%{!-s: -s /sbin/nologin} -c "OpenStack %1 Daemon" %1 \
} \
%nil

#
# Macro for removing requirements.txt file
#
%py_req_cleanup rm -rf *requirements.txt

# Create a fake tempest plugin entry point which will
# resides under %{python2_sitelib}/%{service}_tests.egg-info.
# The prefix is %py2_entrypoint %{modulename} %{service}
# where service is the name of the openstack-service or the modulename
# It should used under %install section
# the generated %{python2_sitelib}/%{service}_tests.egg-info
# will go under %files section of tempest plugin subpackage
# Example: %py2_entrypoint %{modulename} %{service}
# In most of the cases %{service} is same as %{modulename}
# but in case of neutron plugins it is different
# like servicename is neutron-lbaas and modulename is neutron_lbass
%py2_entrypoint() \
egg_path=%{buildroot}%{python2_sitelib}/%{1}-*.egg-info \
tempest_egg_path=%{buildroot}%{python2_sitelib}/%{1}_tests.egg-info \
mkdir $tempest_egg_path \
echo %{1} >$tempest_egg_path/top_level.txt \
grep "tempest\\|Tempest" %{1}.egg-info/entry_points.txt
$tempest_egg_path/entry_points.txt \
sed -i "/tempest\\|Tempest/d" $egg_path/entry_points.txt \
cp -r $egg_path/PKG-INFO $tempest_egg_path \
sed -i "s/%{2}/%{1}_tests/g" $tempest_egg_path/PKG-INFO \
%nil

# Macro for creating a fake tempest plugin entrypoint
# Usage: %py3_entrypoint %{modulename} %{service}
%py3_entrypoint() \
egg_path=%{buildroot}%{python3_sitelib}/%{1}-*.egg-info \
tempest_egg_path=%{buildroot}%{python3_sitelib}/%{1}_tests.egg-info \
mkdir $tempest_egg_path \
echo %{1} >$tempest_egg_path/top_level.txt \
grep "tempest\\|Tempest" %{1}.egg-info/entry_points.txt
$tempest_egg_path/entry_points.txt \
sed -i "/tempest\\|Tempest/d" $egg_path/entry_points.txt \
cp -r $egg_path/PKG-INFO $tempest_egg_path \
sed -i "s/%{2}/%{1}_tests/g" $tempest_egg_path/PKG-INFO \
%nil

#
# Apache related macros
#
%apache_name httpd
%apache_site_dir %{_sysconfdir}/%{apache_name}/conf.d/
%apache_conf_dir %{_sysconfdir}/%{apache_name}/conf.d/
%apache_user apache
%apache_group apache


#
# ext_man is used by the singlespec macro but is not defined on Fedora
#
%ext_info .gz
%ext_man .gz
++++++ macros.openstack-rdo ++++++
# RDO macros

# Create given user with given group (to be used as %pre scriptlet for
# openstack related daemons). Also migrates away from openstack- prefixed
# users/group if it exists
# Optional:
# -u userid to pick
# -g groupid to pick
# -s shell to pick
# Example: openstack_pre_user_group_create keystone keystone
%openstack_pre_user_group_create(u:g:s:) \
getent group %2 >/dev/null || { \
groupadd -r %2 $oldg \
} \
getent passwd %1 >/dev/null || { \
useradd -r -g %2 %{-u:-u %{-u*}} -d %{_sharedstatedir}/%1 %{-s:-s
%{-s*}}%{!-s: -s /sbin/nologin} -c "OpenStack %1 Daemon" %1 \
} \
%nil


%py_req_cleanup() \
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg \
rm -rf *requirements.txt \
%nil

# Create a fake tempest plugin entry point which will
# resides under %{python2_sitelib}/%{service}_tests.egg-info.
# The prefix is %py2_entrypoint %{modulename} %{service}
# where service is the name of the openstack-service or the modulename
# It should used under %install section
# the generated %{python2_sitelib}/%{service}_tests.egg-info
# will go under %files section of tempest plugin subpackage
# Example: %py2_entrypoint %{modulename} %{service}
# In most of the cases %{service} is same as %{modulename}
# but in case of neutron plugins it is different
# like servicename is neutron-lbaas and modulename is neutron_lbass
%py2_entrypoint() \
egg_path=%{buildroot}%{python2_sitelib}/%{1}-*.egg-info \
tempest_egg_path=%{buildroot}%{python2_sitelib}/%{1}_tests.egg-info \
mkdir $tempest_egg_path \
echo %{1} >$tempest_egg_path/top_level.txt \
grep "tempest\\|Tempest" %{1}.egg-info/entry_points.txt
$tempest_egg_path/entry_points.txt \
sed -i "/tempest\\|Tempest/d" $egg_path/entry_points.txt \
cp -r $egg_path/PKG-INFO $tempest_egg_path \
sed -i "s/%{2}/%{1}_tests/g" $tempest_egg_path/PKG-INFO \
%nil


# compat macros with Fedora
%python_provide() %{lua:\
function string.starts(String,Start)\
return string.sub(String,1,string.len(Start))==Start\
end\
str = rpm.expand("%{?1:%{1}}");\
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
if (string.starts(str, "python2-")) then\
print("Provides: python-");\
print(string.sub(str,9,string.len(str)));\
print(" = ");\
print(vr);\
--Obsoleting the previous default python package\
print("\\nObsoletes: python-");\
print(string.sub(str,9,string.len(str)));\
print(" < ");\
print(vr);\
elseif (string.starts(str, "python3-")) then\
--No unversioned provides as python3 is not default\
elseif (string.starts(str, "pypy-")) then\
--No unversioned provides as pypy is not default\
elseif (string.starts(str, "pypy3-")) then\
--No unversioned provides as pypy is not default\
elseif (string.starts(str, "python-")) then\
--Providing the current default python\
print("Provides: python2-");\
print(string.sub(str,8,string.len(str)));\
print(" = ");\
print(vr);\
else\
print("ERROR: ");\
print(str);\
print("not recognized.");\
end\
}

#
# Missing systemd macros in EL7 (taken from systemd under GPL 2.1+)
#
%sysctl_apply() \
/usr/lib/systemd/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
%{nil}

%binfmt_apply() \
/usr/lib/systemd/systemd-binfmt %{?*} >/dev/null 2>&1 || : \
%{nil}

#
# Apache related macros
#
%apache_name httpd
%apache_site_dir %{_sysconfdir}/%{apache_name}/conf.d/
%apache_conf_dir %{_sysconfdir}/%{apache_name}/conf.d/
%apache_user apache
%apache_group apache

#
# ext_man is used by the singlespec macro but is not defined on Fedora
#
%ext_info .gz
%ext_man .gz


# This macro defines environment variables available during the build
# Currently sets:
# - RHEL_ALLOW_PYTHON2_FOR_BUILD=1
# (enable python2 in RHEL between 7 and 9 buildroot)
%__openstack_set_env %{lua:
rhel_version=tonumber(rpm.expand("0%{?rhel}"))
if rhel_version > 7 then posix.setenv("RHEL_ALLOW_PYTHON2_FOR_BUILD",1) end
}

# Compatibility with fedora in CentOS7

# Macro to replace overly complicated references to PyPI source files.
# Expands to the pythonhosted URL for a package
# Accepts zero to three arguments:
# 1: The PyPI project name, defaulting to %srcname if it is defined, then
# %pypi_name if it is defined, then just %name.
# 2: The PYPI version, defaulting to %version.
# 3: The file extension, defaulting to "tar.gz". (A period will be added
# automatically.)
# Requires %__pypi_url and %__pypi_default_extension to be defined.
%__pypi_url https://files.pythonhosted.org/packages/source/
%__pypi_default_extension tar.gz

%pypi_source() %{lua:
local src = rpm.expand('%1')
local ver = rpm.expand('%2')
local ext = rpm.expand('%3')
local url = rpm.expand('%__pypi_url')
\
-- If no first argument, try %srcname, then %pypi_name, then %name
-- Note that rpm leaves macros unchanged if they are not defined.
if src == '%1' then
src = rpm.expand('%srcname')
end
if src == '%srcname' then
src = rpm.expand('%pypi_name')
end
if src == '%pypi_name' then
src = rpm.expand('%name')
end
\
-- If no second argument, use %version
if ver == '%2' then
ver = rpm.expand('%version')
end
\
-- If no third argument, use the preset default extension
if ext == '%3' then
ext = rpm.expand('%__pypi_default_extension')
end
\
local first = string.sub(src, 1, 1)
\
print(url .. first .. '/' .. src .. '/' .. src .. '-' .. ver .. '.' .. ext)
}
++++++ macros.openstack-suse ++++++
# Macros for building OpenStack RPMs.
#
# Copyright: (c) 2015 SUSE Linux GmbH

# python specific macros to be compatible with other distros to share OpenStack
# upstream packaging
%__python2 /usr/bin/python2
%python2_sitelib %(%{__python2} -c "from distutils.sysconfig import
get_python_lib; print(get_python_lib())")
%python2_sitearch %(%{__python2} -c "from distutils.sysconfig import
get_python_lib; print(get_python_lib(1))")
# Make %license work like %doc for now - discussion started with openSUSE
%_defaultlicensedir %_defaultdocdir

%py_req_cleanup() \
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg \
%nil

# Create given user with given group (to be used as %pre scriptlet for
# openstack related daemons). Also migrates away from openstack- prefixed
# users/group if it exists
# Optional:
# -u userid to pick
# -g groupid to pick
# -s shell to pick
# Example: openstack_pre_user_group_create keystone keystone
%openstack_pre_user_group_create(u:g:s:) \
# Migrate away from old openstack- prefix \
oldu=$(getent passwd openstack-%1 |cut -d: -f3) || : \
[ -n "$oldu" ] && { \
oldu="-o -u $oldu" \
userdel openstack-%1 \
} \
getent group %2 >/dev/null || { \
# Migrate away from old openstack- prefix \
oldg=$(getent group openstack-%2 |cut -d: -f3) || : \
[ -n "$oldg" ] && oldg="-o -g $oldg" \
[ -n "$oldg" ] && groupdel openstack-%2 || : \
[ -z "$oldg" ] && oldg="%{-g:-g %{-g*}}" \
groupadd -r %2 $oldg \
} \
[ -z "$oldu" ] && oldu="%{-u:-u %{-u*}}" \
getent passwd %1 >/dev/null || { \
useradd -r -g %2 $oldu -d %{_localstatedir}/lib/%1 %{-s:-s
%{-s*}}%{!-s: -s /sbin/nologin} -c "OpenStack %1 Daemon" %1 \
} \
%nil

# Create a fake tempest plugin entry point which will
# resides under %{python2_sitelib}/%{service}_tests.egg-info.
# The prefix is %py2_entrypoint %{modulename} %{service}
# where service is the name of the openstack-service or the modulename
# It should used under %install section
# the generated %{python2_sitelib}/%{service}_tests.egg-info
# will go under %files section of tempest plugin subpackage
# Example: %py2_entrypoint %{modulename} %{service}
# In most of the cases %{service} is same as %{modulename}
# but in case of neutron plugins it is different
# like servicename is neutron-lbaas and modulename is neutron_lbass
%py2_entrypoint() \
egg_path=%{buildroot}%{python2_sitelib}/%{1}-*.egg-info \
tempest_egg_path=%{buildroot}%{python2_sitelib}/%{1}_tests.egg-info \
mkdir $tempest_egg_path \
echo %{1} >$tempest_egg_path/top_level.txt \
grep "tempest\\|Tempest" %{1}.egg-info/entry_points.txt
$tempest_egg_path/entry_points.txt \
sed -i "/tempest\\|Tempest/d" $egg_path/entry_points.txt \
cp -r $egg_path/PKG-INFO $tempest_egg_path \
sed -i "s/%{2}/%{1}_tests/g" $tempest_egg_path/PKG-INFO \
%nil

#
# Apache related macros
#
%apache_name apache2
%apache_site_dir %{_sysconfdir}/%{apache_name}/vhosts.d/
%apache_conf_dir %{_sysconfdir}/%{apache_name}/conf.d/
%apache_user wwwrun
%apache_group www

# Compatibility macro
# currently does nothing on Suse platforms
%__openstack_set_env %{nil}

< Previous Next >
This Thread
  • No further messages