From 12e405b06b0b95f6b700b7c3f3dc910041fd6d1c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 19 Jul 2016 11:03:08 +0000 Subject: [PATCH 1/7] - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages --- python-productmd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-productmd.spec b/python-productmd.spec index d2d628e..b744352 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -15,7 +15,7 @@ Name: python-productmd Version: 1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools @@ -109,6 +109,9 @@ popd %endif %changelog +* Tue Jul 19 2016 Fedora Release Engineering - 1.2-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Thu Jun 02 2016 Lubomír Sedlář - 1.2-1 - New upstream release - Update source url to point to PyPI From 1818c0e68749a35c784f73aaeb667346cf1bb626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 23 Nov 2016 14:08:24 +0100 Subject: [PATCH 2/7] Update python-productmd to 1.3-1 --- .gitignore | 1 + ...-two-_validate_version-functions-to-.patch | 75 ----------- ...60766b8e3882f7a947ba00c82ae59f392d80.patch | 126 ------------------ python-productmd.spec | 61 ++++----- sources | 2 +- 5 files changed, 31 insertions(+), 234 deletions(-) delete mode 100644 0001-update-the-other-two-_validate_version-functions-to-.patch delete mode 100644 e0e360766b8e3882f7a947ba00c82ae59f392d80.patch diff --git a/.gitignore b/.gitignore index 03651a4..5ac1c8e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /productmd-1.0.tar.gz /productmd-1.1.tar.gz /productmd-1.2.tar.bz2 +/python-productmd-1.3.tar.gz diff --git a/0001-update-the-other-two-_validate_version-functions-to-.patch b/0001-update-the-other-two-_validate_version-functions-to-.patch deleted file mode 100644 index 87fd570..0000000 --- a/0001-update-the-other-two-_validate_version-functions-to-.patch +++ /dev/null @@ -1,75 +0,0 @@ -From c01b76db26893f8257c17dcff838005625adc529 Mon Sep 17 00:00:00 2001 -From: Dennis Gilmore -Date: Thu, 18 Feb 2016 19:50:52 -0600 -Subject: [PATCH] update the other two _validate_version functions to allow for - Rawhide to be valid - -Fix up the tests - -Signed-off-by: Dennis Gilmore ---- - productmd/common.py | 3 ++- - productmd/treeinfo.py | 3 ++- - tests/test_header.py | 10 +++++----- - 3 files changed, 9 insertions(+), 7 deletions(-) - -diff --git a/productmd/common.py b/productmd/common.py -index 3447c05..b23d71f 100644 ---- a/productmd/common.py -+++ b/productmd/common.py -@@ -195,7 +195,8 @@ class Header(MetadataBase): - - def _validate_version(self): - self._assert_type("version", six.string_types) -- self._assert_matches_re("version", [r"^\d+\.\d+$"]) -+ if re.match('^\d', self.version): -+ self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) - - @property - def version_tuple(self): -diff --git a/productmd/treeinfo.py b/productmd/treeinfo.py -index a14305e..67f5ed9 100644 ---- a/productmd/treeinfo.py -+++ b/productmd/treeinfo.py -@@ -166,7 +166,8 @@ class BaseProduct(productmd.common.MetadataBase): - - def _validate_version(self): - self._assert_type("version", list(six.string_types)) -- self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) -+ if re.match('^\d', self.version): -+ self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) - - def _validate_short(self): - self._assert_type("short", list(six.string_types)) -diff --git a/tests/test_header.py b/tests/test_header.py -index 206307a..5c18dcf 100755 ---- a/tests/test_header.py -+++ b/tests/test_header.py -@@ -40,19 +40,19 @@ class TestHeader(unittest.TestCase): - self.assertRaises(TypeError, hdr.validate) - - # invalid version -- hdr.version = "first" -- self.assertRaises(ValueError, hdr.validate) -- - hdr.version = "1.alpha2" - self.assertRaises(ValueError, hdr.validate) - -+ # valid version - hdr.version = "1" -- self.assertRaises(ValueError, hdr.validate) -+ hdr.validate() - -- # valid version - hdr.version = "1.22" - hdr.validate() - -+ hdr.version = "first" -+ hdr.validate() -+ - def test_deserialize(self): - hdr = Header(None) - data = { --- -2.5.0 - diff --git a/e0e360766b8e3882f7a947ba00c82ae59f392d80.patch b/e0e360766b8e3882f7a947ba00c82ae59f392d80.patch deleted file mode 100644 index 6ec4aeb..0000000 --- a/e0e360766b8e3882f7a947ba00c82ae59f392d80.patch +++ /dev/null @@ -1,126 +0,0 @@ -From e0e360766b8e3882f7a947ba00c82ae59f392d80 Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Sun, 28 Feb 2016 12:48:42 -0800 -Subject: [PATCH] add 'subvariant' property to images - -This is to solve a problem we have with the Fedora composes. -There are 'Spins' and 'Labs' variants which produce several -live images and ARM appliances with differing content. With the -current metadata, there is no good way to tell the KDE live -image from the Xfce or LXDE live images; the only property -which indicates this is the 'path', but that has lots of other -information in it and is not trivially parseable (as image -names don't really strictly follow the naming policy you -cannot strictly tell what element of the image file name is -the 'subvariant'). - -Thus we add a 'subvariant' property which Pungi will populate as -appropriate. For many images the 'subvariant' will be the variant, -but for Spins and Labs it will indicate the actual content of -each image. - -The image metadata version should probably change with this, -but I couldn't see the right way to do that (surely I don't -just universally bump it to 1, 1 in common.py?) Pungi will -also need a few corresponding changes, I will send a Pagure -PR for those. ---- - doc/images-1.0.rst | 1 + - productmd/images.py | 7 +++++++ - tests/test_images.py | 12 +++++++----- - 3 files changed, 15 insertions(+), 5 deletions(-) - -diff --git a/doc/images-1.0.rst b/doc/images-1.0.rst -index fa04ad3..6ac36b7 100644 ---- a/doc/images-1.0.rst -+++ b/doc/images-1.0.rst -@@ -40,6 +40,7 @@ in order to read and diff images.json files easily. - "implant_md5": , # md5 checksum implanted directly on media (see implantisomd5 and checkisomd5 commands) - "mtime": , # mtime of the image stored as a decimal unix timestamp - "path": , # relative path to the image -+ "subvariant": , # image content (e.g. 'Workstation' or 'KDE') - "size": , # file size of the image - "type": , # see productmd.images.SUPPORTED_IMAGE_TYPES - "volume_id": # volume ID; null if not available/applicable -diff --git a/productmd/images.py b/productmd/images.py -index ca8fbd4..df825bb 100644 ---- a/productmd/images.py -+++ b/productmd/images.py -@@ -119,6 +119,7 @@ def __init__(self, parent): - self.checksums = {} #: (*str*) -- Release name, for example: "Fedora", "Red Hat Enterprise Linux" - self.implant_md5 = None #: (*str* or *None*) -- value of implanted md5 - self.bootable = False #: (*bool=False*) -- -+ self.subvariant = None #: (*str*) -- image contents, may be same as variant or e.g. 'KDE', 'LXDE' - - def _validate_path(self): - self._assert_type("path", list(six.string_types)) -@@ -166,6 +167,10 @@ def _validate_implant_md5(self): - def _validate_bootable(self): - self._assert_type("bootable", [bool]) - -+ def _validate_subvariant(self): -+ self._assert_type("subvariant", list(six.string_types)) -+ self._assert_not_blank("subvariant") -+ - def serialize(self, parser): - data = parser - self.validate() -@@ -182,6 +187,7 @@ def serialize(self, parser): - "checksums": self.checksums, - "implant_md5": self.implant_md5, - "bootable": self.bootable, -+ "subvariant": self.subvariant, - } - data.append(result) - -@@ -198,6 +204,7 @@ def deserialize(self, data): - self.checksums = data["checksums"] - self.implant_md5 = data["implant_md5"] - self.bootable = bool(data["bootable"]) -+ self.subvariant = data["subvariant"] - self.validate() - - def add_checksum(self, root, checksum_type, checksum_value): -diff --git a/tests/test_images.py b/tests/test_images.py -index 614ab21..603297f 100755 ---- a/tests/test_images.py -+++ b/tests/test_images.py -@@ -72,7 +72,7 @@ def test_fedora_20(self): - im.compose.respin = 0 - - i = Image(im) -- i.path = "Fedora/x86_64/iso/Fedora-20-x86_64-DVD.iso" -+ i.path = "Fedora/x86_64/iso/Fedora-Server-dvd-x86_64-20.iso" - i.mtime = 1410855216 - i.size = 4603248640 - i.arch = "x86_64" -@@ -80,7 +80,8 @@ def test_fedora_20(self): - i.format = "iso" - i.disc_number = 1 - i.disc_count = 1 -- i.volume_id = "Fedora 20 x86_64" -+ i.volume_id = "Fedora-S-dvd-x86_64-20" -+ i.subvariant = "Server" - - # checksums - i.add_checksum(root=None, checksum_type="sha256", checksum_value="f2eeed5102b8890e9e6f4b9053717fe73031e699c4b76dc7028749ab66e7f917") -@@ -98,15 +99,16 @@ def test_fedora_20(self): - im.add("Fedora", "x86_64", i) - - i = Image(im) -- i.path = "Fedora/x86_64/iso/Fedora-20-x86_64-netinst.iso" -+ i.path = "Fedora/x86_64/iso/Fedora-Server-boot-x86_64-20.iso" - i.mtime = 1410855243 - i.size = 336592896 - i.arch = "x86_64" -- i.type = "netinst" -+ i.type = "boot" - i.format = "iso" - i.disc_number = 1 - i.disc_count = 1 -- i.volume_id = "Fedora 20 x86_64" -+ i.volume_id = "Fedora-S-boot-x86_64-20" -+ i.subvariant = "Server" - - # checksums - i.add_checksum(root=None, checksum_type="sha256", checksum_value="376be7d4855ad6281cb139430606a782fd6189dcb01d7b61448e915802cc350f") diff --git a/python-productmd.spec b/python-productmd.spec index b744352..486edbc 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -13,27 +13,38 @@ %global with_python3 0 %endif +# compatibility with older releases +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}} +%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}} + Name: python-productmd -Version: 1.2 -Release: 2%{?dist} +Version: 1.3 +Release: 1%{?dist} Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools License: LGPLv2+ URL: https://github.com/release-engineering/productmd -Source0: https://files.pythonhosted.org/packages/source/p/productmd/productmd-%{version}.tar.bz2 +Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz -Obsoletes: productmd <= %{version}-%{release} -Provides: productmd = %{version}-%{release} -Provides: python2-productmd = %{version}-%{release} -Requires: python-six +Obsoletes: productmd <= %{version}-%{release} +Provides: productmd = %{version}-%{release} +Provides: python2-productmd = %{version}-%{release} + +Requires: python-six + +BuildRequires: python2-devel +BuildRequires: python-setuptools +BuildRequires: python-six -BuildRequires: python2-devel python-setuptools %if 0%{?with_python3} -BuildRequires: python3-devel python3-setuptools +BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: python3-six %endif -BuildRequires: python-six BuildArch: noarch @@ -53,44 +64,27 @@ and installation media. %endif %prep -%setup -qc -n productmd-%{version} -mv productmd-%{version} python2 - -cp -a python2 python3 -cp python2/LICENSE . -cp python2/AUTHORS . +%setup -q %build -pushd python2 -CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build -popd +%py2_build %if 0%{?with_python3} -pushd python3 -CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build -popd +%py3_build %endif %install -pushd python2 -%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT -popd +%py2_install %if 0%{?with_python3} -pushd python3 -%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT -popd +%py3_install %endif %check -pushd python2 %{__python2} ./setup.py test -popd %if 0%{?with_python3} -pushd python3 %{__python3} ./setup.py test -popd %endif %files @@ -109,6 +103,9 @@ popd %endif %changelog +* Wed Nov 23 2016 Lubomír Sedlář 1.3-1 +- new package built with tito + * Tue Jul 19 2016 Fedora Release Engineering - 1.2-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages diff --git a/sources b/sources index f6b2131..3e953b4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0e3cbd5be3161d461025043ad9f5ff7b productmd-1.2.tar.bz2 +ffc2112169536f867f3253cc5b5ff3ff python-productmd-1.3.tar.gz From 3dc6f6048cbed216bdadb84f87fb7d2b484b4950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 23 Nov 2016 14:09:32 +0100 Subject: [PATCH 3/7] Update python-productmd to 1.3-1 --- .gitignore | 1 + ...-two-_validate_version-functions-to-.patch | 75 ----------- ...60766b8e3882f7a947ba00c82ae59f392d80.patch | 126 ------------------ python-productmd.spec | 62 ++++----- sources | 2 +- 5 files changed, 33 insertions(+), 233 deletions(-) delete mode 100644 0001-update-the-other-two-_validate_version-functions-to-.patch delete mode 100644 e0e360766b8e3882f7a947ba00c82ae59f392d80.patch diff --git a/.gitignore b/.gitignore index 03651a4..5ac1c8e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /productmd-1.0.tar.gz /productmd-1.1.tar.gz /productmd-1.2.tar.bz2 +/python-productmd-1.3.tar.gz diff --git a/0001-update-the-other-two-_validate_version-functions-to-.patch b/0001-update-the-other-two-_validate_version-functions-to-.patch deleted file mode 100644 index 87fd570..0000000 --- a/0001-update-the-other-two-_validate_version-functions-to-.patch +++ /dev/null @@ -1,75 +0,0 @@ -From c01b76db26893f8257c17dcff838005625adc529 Mon Sep 17 00:00:00 2001 -From: Dennis Gilmore -Date: Thu, 18 Feb 2016 19:50:52 -0600 -Subject: [PATCH] update the other two _validate_version functions to allow for - Rawhide to be valid - -Fix up the tests - -Signed-off-by: Dennis Gilmore ---- - productmd/common.py | 3 ++- - productmd/treeinfo.py | 3 ++- - tests/test_header.py | 10 +++++----- - 3 files changed, 9 insertions(+), 7 deletions(-) - -diff --git a/productmd/common.py b/productmd/common.py -index 3447c05..b23d71f 100644 ---- a/productmd/common.py -+++ b/productmd/common.py -@@ -195,7 +195,8 @@ class Header(MetadataBase): - - def _validate_version(self): - self._assert_type("version", six.string_types) -- self._assert_matches_re("version", [r"^\d+\.\d+$"]) -+ if re.match('^\d', self.version): -+ self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) - - @property - def version_tuple(self): -diff --git a/productmd/treeinfo.py b/productmd/treeinfo.py -index a14305e..67f5ed9 100644 ---- a/productmd/treeinfo.py -+++ b/productmd/treeinfo.py -@@ -166,7 +166,8 @@ class BaseProduct(productmd.common.MetadataBase): - - def _validate_version(self): - self._assert_type("version", list(six.string_types)) -- self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) -+ if re.match('^\d', self.version): -+ self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) - - def _validate_short(self): - self._assert_type("short", list(six.string_types)) -diff --git a/tests/test_header.py b/tests/test_header.py -index 206307a..5c18dcf 100755 ---- a/tests/test_header.py -+++ b/tests/test_header.py -@@ -40,19 +40,19 @@ class TestHeader(unittest.TestCase): - self.assertRaises(TypeError, hdr.validate) - - # invalid version -- hdr.version = "first" -- self.assertRaises(ValueError, hdr.validate) -- - hdr.version = "1.alpha2" - self.assertRaises(ValueError, hdr.validate) - -+ # valid version - hdr.version = "1" -- self.assertRaises(ValueError, hdr.validate) -+ hdr.validate() - -- # valid version - hdr.version = "1.22" - hdr.validate() - -+ hdr.version = "first" -+ hdr.validate() -+ - def test_deserialize(self): - hdr = Header(None) - data = { --- -2.5.0 - diff --git a/e0e360766b8e3882f7a947ba00c82ae59f392d80.patch b/e0e360766b8e3882f7a947ba00c82ae59f392d80.patch deleted file mode 100644 index 6ec4aeb..0000000 --- a/e0e360766b8e3882f7a947ba00c82ae59f392d80.patch +++ /dev/null @@ -1,126 +0,0 @@ -From e0e360766b8e3882f7a947ba00c82ae59f392d80 Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Sun, 28 Feb 2016 12:48:42 -0800 -Subject: [PATCH] add 'subvariant' property to images - -This is to solve a problem we have with the Fedora composes. -There are 'Spins' and 'Labs' variants which produce several -live images and ARM appliances with differing content. With the -current metadata, there is no good way to tell the KDE live -image from the Xfce or LXDE live images; the only property -which indicates this is the 'path', but that has lots of other -information in it and is not trivially parseable (as image -names don't really strictly follow the naming policy you -cannot strictly tell what element of the image file name is -the 'subvariant'). - -Thus we add a 'subvariant' property which Pungi will populate as -appropriate. For many images the 'subvariant' will be the variant, -but for Spins and Labs it will indicate the actual content of -each image. - -The image metadata version should probably change with this, -but I couldn't see the right way to do that (surely I don't -just universally bump it to 1, 1 in common.py?) Pungi will -also need a few corresponding changes, I will send a Pagure -PR for those. ---- - doc/images-1.0.rst | 1 + - productmd/images.py | 7 +++++++ - tests/test_images.py | 12 +++++++----- - 3 files changed, 15 insertions(+), 5 deletions(-) - -diff --git a/doc/images-1.0.rst b/doc/images-1.0.rst -index fa04ad3..6ac36b7 100644 ---- a/doc/images-1.0.rst -+++ b/doc/images-1.0.rst -@@ -40,6 +40,7 @@ in order to read and diff images.json files easily. - "implant_md5": , # md5 checksum implanted directly on media (see implantisomd5 and checkisomd5 commands) - "mtime": , # mtime of the image stored as a decimal unix timestamp - "path": , # relative path to the image -+ "subvariant": , # image content (e.g. 'Workstation' or 'KDE') - "size": , # file size of the image - "type": , # see productmd.images.SUPPORTED_IMAGE_TYPES - "volume_id": # volume ID; null if not available/applicable -diff --git a/productmd/images.py b/productmd/images.py -index ca8fbd4..df825bb 100644 ---- a/productmd/images.py -+++ b/productmd/images.py -@@ -119,6 +119,7 @@ def __init__(self, parent): - self.checksums = {} #: (*str*) -- Release name, for example: "Fedora", "Red Hat Enterprise Linux" - self.implant_md5 = None #: (*str* or *None*) -- value of implanted md5 - self.bootable = False #: (*bool=False*) -- -+ self.subvariant = None #: (*str*) -- image contents, may be same as variant or e.g. 'KDE', 'LXDE' - - def _validate_path(self): - self._assert_type("path", list(six.string_types)) -@@ -166,6 +167,10 @@ def _validate_implant_md5(self): - def _validate_bootable(self): - self._assert_type("bootable", [bool]) - -+ def _validate_subvariant(self): -+ self._assert_type("subvariant", list(six.string_types)) -+ self._assert_not_blank("subvariant") -+ - def serialize(self, parser): - data = parser - self.validate() -@@ -182,6 +187,7 @@ def serialize(self, parser): - "checksums": self.checksums, - "implant_md5": self.implant_md5, - "bootable": self.bootable, -+ "subvariant": self.subvariant, - } - data.append(result) - -@@ -198,6 +204,7 @@ def deserialize(self, data): - self.checksums = data["checksums"] - self.implant_md5 = data["implant_md5"] - self.bootable = bool(data["bootable"]) -+ self.subvariant = data["subvariant"] - self.validate() - - def add_checksum(self, root, checksum_type, checksum_value): -diff --git a/tests/test_images.py b/tests/test_images.py -index 614ab21..603297f 100755 ---- a/tests/test_images.py -+++ b/tests/test_images.py -@@ -72,7 +72,7 @@ def test_fedora_20(self): - im.compose.respin = 0 - - i = Image(im) -- i.path = "Fedora/x86_64/iso/Fedora-20-x86_64-DVD.iso" -+ i.path = "Fedora/x86_64/iso/Fedora-Server-dvd-x86_64-20.iso" - i.mtime = 1410855216 - i.size = 4603248640 - i.arch = "x86_64" -@@ -80,7 +80,8 @@ def test_fedora_20(self): - i.format = "iso" - i.disc_number = 1 - i.disc_count = 1 -- i.volume_id = "Fedora 20 x86_64" -+ i.volume_id = "Fedora-S-dvd-x86_64-20" -+ i.subvariant = "Server" - - # checksums - i.add_checksum(root=None, checksum_type="sha256", checksum_value="f2eeed5102b8890e9e6f4b9053717fe73031e699c4b76dc7028749ab66e7f917") -@@ -98,15 +99,16 @@ def test_fedora_20(self): - im.add("Fedora", "x86_64", i) - - i = Image(im) -- i.path = "Fedora/x86_64/iso/Fedora-20-x86_64-netinst.iso" -+ i.path = "Fedora/x86_64/iso/Fedora-Server-boot-x86_64-20.iso" - i.mtime = 1410855243 - i.size = 336592896 - i.arch = "x86_64" -- i.type = "netinst" -+ i.type = "boot" - i.format = "iso" - i.disc_number = 1 - i.disc_count = 1 -- i.volume_id = "Fedora 20 x86_64" -+ i.volume_id = "Fedora-S-boot-x86_64-20" -+ i.subvariant = "Server" - - # checksums - i.add_checksum(root=None, checksum_type="sha256", checksum_value="376be7d4855ad6281cb139430606a782fd6189dcb01d7b61448e915802cc350f") diff --git a/python-productmd.spec b/python-productmd.spec index d2d628e..486edbc 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -13,27 +13,38 @@ %global with_python3 0 %endif +# compatibility with older releases +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}} +%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}} + Name: python-productmd -Version: 1.2 +Version: 1.3 Release: 1%{?dist} Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools License: LGPLv2+ URL: https://github.com/release-engineering/productmd -Source0: https://files.pythonhosted.org/packages/source/p/productmd/productmd-%{version}.tar.bz2 +Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz -Obsoletes: productmd <= %{version}-%{release} -Provides: productmd = %{version}-%{release} -Provides: python2-productmd = %{version}-%{release} -Requires: python-six +Obsoletes: productmd <= %{version}-%{release} +Provides: productmd = %{version}-%{release} +Provides: python2-productmd = %{version}-%{release} + +Requires: python-six + +BuildRequires: python2-devel +BuildRequires: python-setuptools +BuildRequires: python-six -BuildRequires: python2-devel python-setuptools %if 0%{?with_python3} -BuildRequires: python3-devel python3-setuptools +BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: python3-six %endif -BuildRequires: python-six BuildArch: noarch @@ -53,44 +64,27 @@ and installation media. %endif %prep -%setup -qc -n productmd-%{version} -mv productmd-%{version} python2 - -cp -a python2 python3 -cp python2/LICENSE . -cp python2/AUTHORS . +%setup -q %build -pushd python2 -CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build -popd +%py2_build %if 0%{?with_python3} -pushd python3 -CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build -popd +%py3_build %endif %install -pushd python2 -%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT -popd +%py2_install %if 0%{?with_python3} -pushd python3 -%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT -popd +%py3_install %endif %check -pushd python2 %{__python2} ./setup.py test -popd %if 0%{?with_python3} -pushd python3 %{__python3} ./setup.py test -popd %endif %files @@ -109,6 +103,12 @@ popd %endif %changelog +* Wed Nov 23 2016 Lubomír Sedlář 1.3-1 +- new package built with tito + +* Tue Jul 19 2016 Fedora Release Engineering - 1.2-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Thu Jun 02 2016 Lubomír Sedlář - 1.2-1 - New upstream release - Update source url to point to PyPI diff --git a/sources b/sources index f6b2131..3e953b4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0e3cbd5be3161d461025043ad9f5ff7b productmd-1.2.tar.bz2 +ffc2112169536f867f3253cc5b5ff3ff python-productmd-1.3.tar.gz From 395b58967344ef2bc9714192861d9fc72cf086c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 19 Dec 2016 18:20:37 +0100 Subject: [PATCH 4/7] Rebuild for Python 3.6 --- python-productmd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-productmd.spec b/python-productmd.spec index 486edbc..6205909 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -22,7 +22,7 @@ Name: python-productmd Version: 1.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools @@ -103,6 +103,9 @@ and installation media. %endif %changelog +* Mon Dec 19 2016 Miro Hrončok - 1.3-2 +- Rebuild for Python 3.6 + * Wed Nov 23 2016 Lubomír Sedlář 1.3-1 - new package built with tito From fcec3caa3518e8cbe5b90e825300efbf8a14e745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 10 Jan 2017 09:34:08 +0100 Subject: [PATCH 5/7] Update python-productmd to 1.4-1 --- .gitignore | 1 + python-productmd.spec | 30 +++++++++++++++++++++++------- sources | 2 +- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 5ac1c8e..ed2f83b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /productmd-1.1.tar.gz /productmd-1.2.tar.bz2 /python-productmd-1.3.tar.gz +/python-productmd-1.4.tar.gz diff --git a/python-productmd.spec b/python-productmd.spec index 6205909..41ee5b6 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -1,8 +1,5 @@ %global with_python3 1 -# this must go after all 'License:' tags -%{!?_licensedir:%global license %doc} - %if 0%{?fedora} && 0%{?fedora} <= 12 %global with_python3 0 %endif @@ -21,8 +18,8 @@ %{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}} Name: python-productmd -Version: 1.3 -Release: 2%{?dist} +Version: 1.4 +Release: 1%{?dist} Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools @@ -87,6 +84,9 @@ and installation media. %{__python3} ./setup.py test %endif +# this must go after all 'License:' tags +%{!?_licensedir:%global license %doc} + %files %license LICENSE %doc AUTHORS @@ -103,8 +103,24 @@ and installation media. %endif %changelog -* Mon Dec 19 2016 Miro Hrončok - 1.3-2 -- Rebuild for Python 3.6 +* Tue Jan 10 2017 Lubomír Sedlář 1.4-1 +- Fix loading variants from legacy composeinfo. (dmach@redhat.com) +- Fix sorting composes (lsedlar@redhat.com) +- Compose: scan all subdirs under compose_path for metadata. + (dmach@redhat.com) +- Add Python 3.6 on Travis (lsedlar@redhat.com) +- tests: add tests for ComposeInfo.get_variants() (kdreyer@redhat.com) +- tests: composeinfo variant arches are sets (kdreyer@redhat.com) +- composeinfo: py3 support for sort in get_variants() (kdreyer@redhat.com) +- composeinfo: py3 support for iter in get_variants() (kdreyer@redhat.com) +- composeinfo: check variant arches as a set (kdreyer@redhat.com) +- composeinfo: fix arch kwarg handling in get_arches() (kdreyer@redhat.com) +- Configure bztar with setup.cfg (lsedlar@redhat.com) +- Remove requirements.txt (lsedlar@redhat.com) +- Include requirements.txt in tarball (lsedlar@redhat.com) +- Move %%license definition just before %%files (lsedlar@redhat.com) +- Remove builder.test from releasers.conf (lsedlar@redhat.com) +- Install deps with setup.py on Travis (lsedlar@redhat.com) * Wed Nov 23 2016 Lubomír Sedlář 1.3-1 - new package built with tito diff --git a/sources b/sources index 3e953b4..c50b383 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ffc2112169536f867f3253cc5b5ff3ff python-productmd-1.3.tar.gz +SHA512 (python-productmd-1.4.tar.gz) = c0a211ea33430952cb83338638da5ff515d5c176b18ecbe46b490873aa76b61f8702015fac5d511c90121c763723147156236ca4e70f58972698c5f12a03d629 From 41334f4ca3f4ed49c7c0d0ae9d8f68e52939301a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 10 Jan 2017 09:37:18 +0100 Subject: [PATCH 6/7] Update python-productmd to 1.4-1 --- .gitignore | 1 + python-productmd.spec | 27 +++++++++++++++++++++++---- sources | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 5ac1c8e..ed2f83b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /productmd-1.1.tar.gz /productmd-1.2.tar.bz2 /python-productmd-1.3.tar.gz +/python-productmd-1.4.tar.gz diff --git a/python-productmd.spec b/python-productmd.spec index 486edbc..41ee5b6 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -1,8 +1,5 @@ %global with_python3 1 -# this must go after all 'License:' tags -%{!?_licensedir:%global license %doc} - %if 0%{?fedora} && 0%{?fedora} <= 12 %global with_python3 0 %endif @@ -21,7 +18,7 @@ %{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}} Name: python-productmd -Version: 1.3 +Version: 1.4 Release: 1%{?dist} Summary: Library providing parsers for metadata related to OS installation @@ -87,6 +84,9 @@ and installation media. %{__python3} ./setup.py test %endif +# this must go after all 'License:' tags +%{!?_licensedir:%global license %doc} + %files %license LICENSE %doc AUTHORS @@ -103,6 +103,25 @@ and installation media. %endif %changelog +* Tue Jan 10 2017 Lubomír Sedlář 1.4-1 +- Fix loading variants from legacy composeinfo. (dmach@redhat.com) +- Fix sorting composes (lsedlar@redhat.com) +- Compose: scan all subdirs under compose_path for metadata. + (dmach@redhat.com) +- Add Python 3.6 on Travis (lsedlar@redhat.com) +- tests: add tests for ComposeInfo.get_variants() (kdreyer@redhat.com) +- tests: composeinfo variant arches are sets (kdreyer@redhat.com) +- composeinfo: py3 support for sort in get_variants() (kdreyer@redhat.com) +- composeinfo: py3 support for iter in get_variants() (kdreyer@redhat.com) +- composeinfo: check variant arches as a set (kdreyer@redhat.com) +- composeinfo: fix arch kwarg handling in get_arches() (kdreyer@redhat.com) +- Configure bztar with setup.cfg (lsedlar@redhat.com) +- Remove requirements.txt (lsedlar@redhat.com) +- Include requirements.txt in tarball (lsedlar@redhat.com) +- Move %%license definition just before %%files (lsedlar@redhat.com) +- Remove builder.test from releasers.conf (lsedlar@redhat.com) +- Install deps with setup.py on Travis (lsedlar@redhat.com) + * Wed Nov 23 2016 Lubomír Sedlář 1.3-1 - new package built with tito diff --git a/sources b/sources index 3e953b4..c50b383 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ffc2112169536f867f3253cc5b5ff3ff python-productmd-1.3.tar.gz +SHA512 (python-productmd-1.4.tar.gz) = c0a211ea33430952cb83338638da5ff515d5c176b18ecbe46b490873aa76b61f8702015fac5d511c90121c763723147156236ca4e70f58972698c5f12a03d629 From 492bd7e60e0565192f8b6d28459b7cb511ad53da Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 10 Feb 2017 18:35:00 -0800 Subject: [PATCH 7/7] Enable Python 3 build for EL 6+ --- python-productmd.spec | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/python-productmd.spec b/python-productmd.spec index 41ee5b6..991d07e 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -1,25 +1,15 @@ -%global with_python3 1 - -%if 0%{?fedora} && 0%{?fedora} <= 12 -%global with_python3 0 +# Enable Python 3 builds for Fedora + EPEL >5 +%if 0%{?fedora} || 0%{?rhel} > 5 +# If the definition isn't available for python3_pkgversion, define it +%{?!python3_pkgversion:%global python3_pkgversion 3} +%bcond_without python3 +%else +%bcond_with python3 %endif -%if 0%{?rhel} && 0%{?rhel} <= 7 -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%global with_python3 0 -%endif - -# compatibility with older releases -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}} -%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}} - Name: python-productmd Version: 1.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools @@ -38,9 +28,9 @@ BuildRequires: python-setuptools BuildRequires: python-six %if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-six +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-six %endif BuildArch: noarch @@ -50,12 +40,12 @@ Python library providing parsers for metadata related to composes and installation media. %if 0%{?with_python3} -%package -n python3-productmd +%package -n python%{python3_pkgversion}-productmd Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools -Requires: python3-six +Requires: python%{python3_pkgversion}-six -%description -n python3-productmd +%description -n python%{python3_pkgversion}-productmd Python library providing parsers for metadata related to composes and installation media. %endif @@ -95,7 +85,7 @@ and installation media. %if 0%{?with_python3} -%files -n python3-productmd +%files -n python%{python3_pkgversion}-productmd %license LICENSE %doc AUTHORS %{python3_sitelib}/productmd/ @@ -103,6 +93,9 @@ and installation media. %endif %changelog +* Fri Feb 10 2017 Adam Williamson - 1.4-2 +- Enable Python 3 build for EL 6+ + * Tue Jan 10 2017 Lubomír Sedlář 1.4-1 - Fix loading variants from legacy composeinfo. (dmach@redhat.com) - Fix sorting composes (lsedlar@redhat.com)