commit python-rpm-macros for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package python-rpm-macros for openSUSE:Factory checked in at 2017-05-20 10:07:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-rpm-macros (Old) and /work/SRC/openSUSE:Factory/.python-rpm-macros.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-rpm-macros" Sat May 20 10:07:38 2017 rev:6 rq:494698 version:2017.05.09.fc237de Changes: -------- --- /work/SRC/openSUSE:Factory/python-rpm-macros/python-rpm-macros.changes 2017-04-19 18:10:20.585938349 +0200 +++ /work/SRC/openSUSE:Factory/.python-rpm-macros.new/python-rpm-macros.changes 2017-05-20 10:08:08.438702390 +0200 @@ -1,0 +2,20 @@ +Tue May 9 15:38:41 UTC 2017 - jmatejek@suse.com + +- version bump to 2017.05.09.fc237de +- fix badly generated %posttrans snippets in cases where + old %python_install_alternative syntax is used for secondary files +- rework %if-macros +- introduce %python_flavor, which configures behavior of generic %python_* + macros, and can be overriden by the user +- add --force to %python_install, to make install order fully deterministic + +------------------------------------------------------------------- +Thu Apr 27 15:43:20 UTC 2017 - jmatejek@suse.com + +- version bump to 2017.04.27.d2ca08c +- switch versioning scheme to date-based +- switch from using service to a custom script update.sh +- auto-generate Provides: python2-modname in old distributions + (only for main package though) + +------------------------------------------------------------------- Old: ---- _service python-rpm-macros-1.0.git.1490791775.6e5b01c.tar.bz2 New: ---- README.packaging python-rpm-macros-2017.05.09.fc237de.tar.bz2 update.sh ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-rpm-macros.spec ++++++ --- /var/tmp/diff_new_pack.0GjXkH/_old 2017-05-20 10:08:10.190454869 +0200 +++ /var/tmp/diff_new_pack.0GjXkH/_new 2017-05-20 10:08:10.190454869 +0200 @@ -17,19 +17,21 @@ Name: python-rpm-macros -Version: 1.0.git.1490791775.6e5b01c +Version: 2017.05.09.fc237de Release: 0 Summary: RPM macros for building of Python modules License: WTFPL Group: Development/Tools/Other Url: https://github.com/opensuse/multipython-macros Source: python-rpm-macros-%{version}.tar.bz2 +Source100: README.packaging +Source101: update.sh # Fedora compatibility Provides: python2-rpm-macros Provides: python3-rpm-macros +BuildRoot: %{_tmppath}/%{name}-%{version}-build #!BuildIgnore: python-rpm-macros BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description This package contains SUSE RPM macros for Python build automation. ++++++ README.packaging ++++++ This file contains information for OpenBuildService packagers. To update this package from git, run the file update.sh It pulls the latest version from github, assigns a date-based version number, removes previous tarball and creates a new one, inputs the version number in the spec file, and notes the version bump in changelog. In the future, changelog should also be maintained in git and auto-dumped into the changes file. ++++++ python-rpm-macros-1.0.git.1490791775.6e5b01c.tar.bz2 -> python-rpm-macros-2017.05.09.fc237de.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/.gitignore new/python-rpm-macros-2017.05.09.fc237de/.gitignore --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/python-rpm-macros-2017.05.09.fc237de/.gitignore 2017-05-09 16:09:03.000000000 +0200 @@ -0,0 +1,5 @@ +/macros.python_all +/macros/020-flavor-* +/macros/035-default-pythons +/macros/040-automagic +*.swp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/flavor.in new/python-rpm-macros-2017.05.09.fc237de/flavor.in --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/flavor.in 2017-03-29 14:49:35.000000000 +0200 +++ new/python-rpm-macros-2017.05.09.fc237de/flavor.in 2017-05-09 16:09:03.000000000 +0200 @@ -4,11 +4,20 @@ %#FLAVOR#_shbang_opts %py_shbang_opts -%#FLAVOR#_sitelib %(%__#FLAVOR# -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -%#FLAVOR#_sitearch %(%__#FLAVOR# -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") -%#FLAVOR#_version %(%__#FLAVOR# -c "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") -%#FLAVOR#_version_nodots %(%__#FLAVOR# -c "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") %#FLAVOR#_prefix #FLAVOR# +%#FLAVOR#_sitelib %{_python_sysconfig_path #FLAVOR# purelib} +%#FLAVOR#_sitearch %{_python_sysconfig_path #FLAVOR# platlib} +%#FLAVOR#_version %{_python_sysconfig_var #FLAVOR# py_version_short} +%#FLAVOR#_version_nodots %{_python_sysconfig_var #FLAVOR# py_version_nodot} + +%#FLAVOR#_sysconfig_path() %{_rec_macro_helper}%{lua:call_sysconfig("path", "#FLAVOR#")} +%#FLAVOR#_sysconfig_var() %{_rec_macro_helper}%{lua:call_sysconfig("var", "#FLAVOR#")} + +%if#FLAVOR# %if "%{python_flavor}" == "#FLAVOR#" + +%#FLAVOR#_only() %if "%{python_flavor}" == "#FLAVOR#" \ +%** \ +%endif %#FLAVOR#_build \ %{_python_use_flavor #FLAVOR#} \ @@ -18,7 +27,7 @@ %#FLAVOR#_install \ %{_python_use_flavor #FLAVOR#} \ %__#FLAVOR# %{py_setup} %{?py_setup_args} install \\\ - -O1 --skip-build --root %{buildroot} --prefix %{_prefix} + -O1 --skip-build --force --root %{buildroot} --prefix %{_prefix} %#FLAVOR#_alternative() %{_python_macro_init} \ %{lua:local link, name, path = python_alternative_names(rpm.expand("%1"), rpm.expand("%#FLAVOR#_bin_suffix")) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/macros/010-common-defs new/python-rpm-macros-2017.05.09.fc237de/macros/010-common-defs --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/macros/010-common-defs 2017-03-29 14:49:35.000000000 +0200 +++ new/python-rpm-macros-2017.05.09.fc237de/macros/010-common-defs 2017-05-09 16:09:03.000000000 +0200 @@ -1,5 +1,23 @@ %system_python python2 +##### common functionality ##### + +%_python_sysconfig_path() %(%1 -c "import sysconfig as s; print(s.get_paths().get('%2'))") +%_python_sysconfig_var() %(%1 -c "import sysconfig as s; print(s.get_config_var('%2'))") + +%_rec_macro_helper %{lua: + rpm.define("_rec_macro_helper %{nil}") + function expand_macro(name, args) + local interp = rpm.expand("%python_flavor") + local args = args and rpm.expand(args) or "" + print(rpm.expand("%{" .. interp .. "_" .. name .. " " .. args .."}")) + end + function call_sysconfig(which, interp) + local arg = rpm.expand("%1") + print(rpm.expand("%{_python_sysconfig_" .. which .. " " .. interp .. " " .. arg .. "}")) + end +} + ##### fedora compatibility ##### %py_setup setup.py @@ -11,29 +29,21 @@ %python3_bin_suffix %python3_version %pypy3_bin_suffix pp%{pypy3_version} -##### fallback preferred configuration ##### +##### preferred configuration ##### -# This can't be in a conditional section because there are no conditional -# sections. Instead, `python2` is hardcoded here, to be reconfigured through -# future package updates (supposedly). - -%python_sitelib %python2_sitelib -%python_sitearch %python2_sitearch -%python_version %python2_version -%python_version_nodots %python2_version_nodots -%python_prefix %python2_prefix - -%python_bin_suffix %python2_bin_suffix - -%_rec_macro_helper %{lua: - rpm.define("_rec_macro_helper %{nil}") - function recurse_macro(name) - local aa = rpm.expand("%**") - print(rpm.expand("%{" .. name .. " " .. aa .."}")) - end} - -%python_alternative() %{_rec_macro_helper}%{lua:recurse_macro("python2_alternative")} -%python_install_alternative() %{_rec_macro_helper}%{lua:recurse_macro("python2_install_alternative")} -%python_uninstall_alternative() %{_rec_macro_helper}%{lua:recurse_macro("python2_uninstall_alternative")} +%python_sitelib %{_python_sysconfig_path %python_flavor purelib} +%python_sitearch %{_python_sysconfig_path %python_flavor platlib} +%python_version %{_python_sysconfig_var %python_flavor py_version_short} +%python_version_nodots %{_python_sysconfig_var %python_flavor py_version_nodot} + +%python_prefix %{_rec_macro_helper}%{lua:expand_macro("prefix")} +%python_bin_suffix %{_rec_macro_helper}%{lua:expand_macro("bin_suffix")} + +%python_sysconfig_path() %{_rec_macro_helper}%{lua:call_sysconfig("path", "%python_flavor")} +%python_sysconfig_var() %{_rec_macro_helper}%{lua:call_sysconfig("var", "%python_flavor")} + +%python_alternative() %{_rec_macro_helper}%{lua:expand_macro("alternative", "%**")} +%python_install_alternative() %{_rec_macro_helper}%{lua:expand_macro("install_alternative", "%**")} +%python_uninstall_alternative() %{_rec_macro_helper}%{lua:expand_macro("uninstall_alternative", "%**")} %py_ver %python_version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/macros.in new/python-rpm-macros-2017.05.09.fc237de/macros.in --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/macros.in 2017-03-29 14:49:35.000000000 +0200 +++ new/python-rpm-macros-2017.05.09.fc237de/macros.in 2017-05-09 16:09:03.000000000 +0200 @@ -3,25 +3,12 @@ %python_module() %{expand: %{?have_python2:%{python2_prefix}-%{**}} %{?have_python3:python3-%{**}} %{?have_pypy3:pypy3-%{**}}} -%if_python_kind() %if %{_python_macro_init} %{lua: if current_flavor == rpm.expand("%1") then print("1") else print("0") end} -%if_not_python_kind() %if %{_python_macro_init} %{lua: if current_flavor == rpm.expand("%1") then print("0") else print("1") end} +%python_flavor %{_python_macro_init}%{lua: print(flavor)} -%ifpython3 %{if_python_kind python3} -%ifpython2 %{if_python_kind python2} -%ifpypy3 %{if_python_kind pypy3} -%ifpycache %{if_not_python_kind python2} +%if_python_kind() %if "%{python_flavor}" == "%1" +%if_not_python_kind() %if "%{python_flavor}" != "%1" -%python3_only() %ifpython3 \ -%** \ -%endif - -%python2_only() %ifpython2 \ -%** \ -%endif - -%pypy3_only() %ifpypy3 \ -%** \ -%endif +%ifpycache %if "%{python_flavor}" != "python2" %pycache_only() %ifpycache \ %** \ @@ -46,4 +33,4 @@ ### LUA-MACROS ### -%_python_macro_init %{_python_definitions} %{_python_scan_spec} %{lua: rpm.define("_python_macro_init %{nil}")} +%_python_macro_init %{_python_definitions}%{_python_scan_spec}%{lua: rpm.define("_python_macro_init %{nil}")} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/macros.lua new/python-rpm-macros-2017.05.09.fc237de/macros.lua --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/macros.lua 2017-03-29 14:49:35.000000000 +0200 +++ new/python-rpm-macros-2017.05.09.fc237de/macros.lua 2017-05-09 16:09:03.000000000 +0200 @@ -27,29 +27,24 @@ old_python2 = rpm.expand("%python2_prefix") == "python" is_called_python = spec_name_prefix == "python" - -- `current_flavor` is set to "what should we set to evaluate macros" - -- `flavor` should always be "what is actually intended for build" + -- detect `flavor`, used for evaluating %ifmacros if is_called_python then if old_python2 then -- in old python2, %ifpython2 should be true in "python-" - current_flavor = "python2" - flavor = "python2" + flavor = "python2" else - -- otherwise, every %if$flavor should be false in "python-", - -- the real flavor is system_python or whatever is present - current_flavor = "python" - + -- otherwise, it is either system_python (if found in %pythons) + -- or the last entry of %pythons for _,py in ipairs(pythons) do flavor = py - -- if system_python is found in %pythons, stop the loop and use it if flavor == system_python then break end end - -- otherwise, flavor is set to the last entry of %pythons end else - -- specname is something other than "python-", we use it literally - flavor = spec_name_prefix - current_flavor = spec_name_prefix + -- specname is something other than "python-", and it is a valid + -- python flavor (otherwise spec_name_prefix defaults to "python" + -- so `is_called_python` is true), so we use it literally + flavor = spec_name_prefix end -- find the spec file @@ -62,25 +57,15 @@ break end end - - python_files_flavor = "" - - -- assuming `%files %python_files` is present: - if is_called_python and not old_python2 then - -- subpackage should be called "python2-foo" - -- files sections for "python-foo" should not exist - -- %files %python_files is set to "%files -n python2-foo" - python_files_flavor = flavor - end - -- else: not old_python2 and not is_called_python, so - -- package is called python3-foo and we generate subpackages - -- that don't involve "python-foo" at all. end function python_subpackages() rpm.expand("%_python_macro_init") _python_subpackages_emitted = true + local current_flavor = flavor + local original_flavor = rpm.expand("%python_flavor") + -- line processing functions local function print_altered(line) -- set %name macro to proper flavor-name @@ -165,13 +150,22 @@ local auto_posttrans = {} local auto_posttrans_current = {} + local auto_posttrans_backslash = false local function expect_alternatives(line) - if line:startswith("%python_install_alternative") - or line:startswith("%{python_install_alternative") -- "}" - or line:startswith("%" .. flavor .. "_install_alternative") - or line:startswith("%{" .. flavor .. "_install_alternative") then -- "}" - table.insert(auto_posttrans_current, line) + if auto_posttrans_backslash then + local apc = auto_posttrans_current + apc[#apc] = apc[#apc] .. "\n" .. line + auto_posttrans_backslash = line:endswith("\\") + elseif line:startswith("%python_install_alternative") + or line:startswith("%{python_install_alternative") -- "}" + or line:startswith("%" .. flavor .. "_install_alternative") + or line:startswith("%{" .. flavor .. "_install_alternative") -- "}" + then + table.insert(auto_posttrans_current, line) + auto_posttrans_backslash = line:endswith("\\") + else + auto_posttrans_backslash = false end return print_altered(line) end @@ -221,8 +215,10 @@ for label, value in pairs(auto_posttrans) do if value ~= false then print(section_headline("posttrans", current_flavor, label)) - for _, line in ipairs(value) do - firstarg = line:match("install_alternative%s+(%S+)") + for _,line in ipairs(value) do + -- RPM needs {} characters in Lua macros to match, so + -- this is an opening "{" for this one: ----------v + firstarg = line:match("install_alternative%s+([^%s}]+)") if firstarg then local _,_,path = python_alternative_names(firstarg, python2_binsuffix) print(string.format('if [ -e "%s" ]; then\n', path)) @@ -267,7 +263,10 @@ local COPIED_SECTIONS = lookup_table {"description", "files", "pre", "post", "preun", "postun", "pretrans", "posttrans"} - local current_flavor_toplevel = current_flavor + -- before we start, print Provides: python2-modname + if is_called_python and old_python2 then + print(rpm.expand("Provides: python2-" .. modname .. " = %{version}-%{release}\n")) + end for _,python in ipairs(pythons) do local is_current_flavor = python == flavor @@ -289,6 +288,8 @@ local spec, err = io.open(specpath, "r") if err then print ("bad spec " .. specpath) return end + rpm.define("python_flavor " .. python) + local section_function = process_package_line print(section_headline("package", current_flavor, nil)) print_obsoletes(modname) @@ -320,7 +321,7 @@ print(section_headline("package", current_flavor, param)) print_obsoletes(modname .. "-" .. param) section_function = process_package_line - elseif newsection == "files" and current_flavor == python_files_flavor then + elseif newsection == "files" and current_flavor == flavor then section_function = ignore_line elseif COPIED_SECTIONS[newsection] then print(section_headline(newsection, current_flavor, param)) @@ -363,16 +364,16 @@ end end - -- restore current_flavor for further processing - current_flavor = current_flavor_toplevel + -- restore %python_flavor for further processing + rpm.define("python_flavor " .. original_flavor) end -function python_exec(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-) +function python_exec(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=) local args = rpm.expand("%**") print(rpm.expand("%{python_expand %__$python " .. args .. "}")) end -function python_expand(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-) +function python_expand(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=) -- force spec scan rpm.expand("%_python_macro_init") local args = rpm.expand("%**") @@ -384,14 +385,14 @@ end end -function python_build(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-) +function python_build(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=) rpm.expand("%_python_macro_init") for _, python in ipairs(pythons) do print(rpm.expand("%" .. python .. "_build %**")) end end -function python_install(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-) +function python_install(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=) rpm.expand("%_python_macro_init") for _, python in ipairs(pythons) do print(rpm.expand("%" .. python .. "_install %**")) @@ -399,19 +400,17 @@ end function python_files() + rpm.expand("%_python_macro_init") local nparams = rpm.expand("%#") local param = "" if tonumber(nparams) > 0 then param = rpm.expand("%1") end - -- for "re" command, all these things are nil because scan_spec doesn't seem to run? - -- checking for validity of python_files_flavor seems to fix this. - if _python_subpackages_emitted - and python_files_flavor and python_files_flavor ~= "" then - print("-n " .. package_name(python_files_flavor, modname, param)) - current_flavor = python_files_flavor + if _python_subpackages_emitted and is_called_python and not old_python2 then + print("-n " .. package_name(flavor, modname, param)) else print(param) end + if not _python_subpackages_emitted then print("\n/%python_subpackages_macro_not_present\n") io.stderr:write("%python_subpackages macro not present\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/packaging/README.packaging new/python-rpm-macros-2017.05.09.fc237de/packaging/README.packaging --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/packaging/README.packaging 1970-01-01 01:00:00.000000000 +0100 +++ new/python-rpm-macros-2017.05.09.fc237de/packaging/README.packaging 2017-05-09 16:09:03.000000000 +0200 @@ -0,0 +1,10 @@ +This file contains information for OpenBuildService packagers. + +To update this package from git, run the file update.sh + +It pulls the latest version from github, assigns a date-based version +number, removes previous tarball and creates a new one, inputs the +version number in the spec file, and notes the version bump in changelog. + +In the future, changelog should also be maintained in git and auto-dumped +into the changes file. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/packaging/python-rpm-macros.spec new/python-rpm-macros-2017.05.09.fc237de/packaging/python-rpm-macros.spec --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/packaging/python-rpm-macros.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/python-rpm-macros-2017.05.09.fc237de/packaging/python-rpm-macros.spec 2017-05-09 16:09:03.000000000 +0200 @@ -0,0 +1,58 @@ +# +# spec file for package python-rpm-macros +# +# Copyright (c) 2017 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# 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/ +# + + +Name: python-rpm-macros +Version: 1.0 +Release: 0 +Summary: RPM macros for building of Python modules +License: WTFPL +Group: Development/Tools/Other +Url: https://github.com/opensuse/multipython-macros +Source: python-rpm-macros-%{version}.tar.bz2 +Source100: README.packaging +Source101: update.sh +# Fedora compatibility +Provides: python2-rpm-macros +Provides: python3-rpm-macros +#!BuildIgnore: python-rpm-macros +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +This package contains SUSE RPM macros for Python build automation. +You should BuildRequire this package unless you are sure that you +are only building for distros newer than Leap 42.2 + +%prep +%setup -q +%if 0%{?suse_version} < 1330 +mv macros-default-pythons macros/035-default-pythons +%endif + +%build +./compile-macros.sh + +%install +mkdir -p %{buildroot}%{_sysconfdir}/rpm +install -m 644 macros.python_all %{buildroot}%{_sysconfdir}/rpm + +%files +%defattr(-,root,root) +%{_sysconfdir}/rpm/macros.python_all + +%changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/packaging/update.sh new/python-rpm-macros-2017.05.09.fc237de/packaging/update.sh --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/packaging/update.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/python-rpm-macros-2017.05.09.fc237de/packaging/update.sh 2017-05-09 16:09:03.000000000 +0200 @@ -0,0 +1,23 @@ +#!/bin/bash + +GIT_URL=https://github.com/openSUSE/python-rpm-macros.git +SPEC_FILE_NAME=python-rpm-macros.spec + +PREV_VERSION=$(sed -rn 's/^Version:\s+(.*)$/\1/p' $SPEC_FILE_NAME) +rm python-rpm-macros-$PREV_VERSION.tar.bz2 + +tmpdir=tmp.$RANDOM + +git clone --depth=1 $GIT_URL $tmpdir +cd $tmpdir +cp packaging/* .. + +VERSION=$(git log -n 1 --date=format:%Y.%m.%d --format=format:%cd.%h) +git archive --format=tar --prefix=python-rpm-macros-$VERSION/ HEAD \ + | bzip2 -c > ../python-rpm-macros-$VERSION.tar.bz2 + +cd .. +rm -rf $tmpdir +sed -i -r 's/^(Version:\s+)(.*)$/\1'$VERSION'/' $SPEC_FILE_NAME + +osc vc -m "version bump to $VERSION" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-1.0.git.1490791775.6e5b01c/python-rpm-macros.spec new/python-rpm-macros-2017.05.09.fc237de/python-rpm-macros.spec --- old/python-rpm-macros-1.0.git.1490791775.6e5b01c/python-rpm-macros.spec 2017-03-29 14:49:35.000000000 +0200 +++ new/python-rpm-macros-2017.05.09.fc237de/python-rpm-macros.spec 1970-01-01 01:00:00.000000000 +0100 @@ -1,56 +0,0 @@ -# -# spec file for package python-rpm-macros -# -# Copyright (c) 2017 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 -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# 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/ -# - - -Name: python-rpm-macros -Version: 1.0 -Release: 0 -Summary: RPM macros for building of Python modules -License: WTFPL -Group: Development/Tools/Other -Url: https://github.com/opensuse/multipython-macros -Source: python-rpm-macros-%{version}.tar.bz2 -# Fedora compatibility -Provides: python2-rpm-macros -Provides: python3-rpm-macros -#!BuildIgnore: python-rpm-macros -BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -%description -This package contains SUSE RPM macros for Python build automation. -You should BuildRequire this package unless you are sure that you -are only building for distros newer than Leap 42.2 - -%prep -%setup -q -%if 0%{?suse_version} < 1330 -mv macros-default-pythons macros/035-default-pythons -%endif - -%build -./compile-macros.sh - -%install -mkdir -p %{buildroot}%{_sysconfdir}/rpm -install -m 644 macros.python_all %{buildroot}%{_sysconfdir}/rpm - -%files -%defattr(-,root,root) -%{_sysconfdir}/rpm/macros.python_all - -%changelog ++++++ update.sh ++++++ #!/bin/bash GIT_URL=https://github.com/openSUSE/python-rpm-macros.git SPEC_FILE_NAME=python-rpm-macros.spec PREV_VERSION=$(sed -rn 's/^Version:\s+(.*)$/\1/p' $SPEC_FILE_NAME) rm python-rpm-macros-$PREV_VERSION.tar.bz2 tmpdir=tmp.$RANDOM git clone --depth=1 $GIT_URL $tmpdir cd $tmpdir cp packaging/* .. VERSION=$(git log -n 1 --date=format:%Y.%m.%d --format=format:%cd.%h) git archive --format=tar --prefix=python-rpm-macros-$VERSION/ HEAD \ | bzip2 -c > ../python-rpm-macros-$VERSION.tar.bz2 cd .. rm -rf $tmpdir sed -i -r 's/^(Version:\s+)(.*)$/\1'$VERSION'/' $SPEC_FILE_NAME osc vc -m "version bump to $VERSION"
participants (1)
-
root@hilbert.suse.de