fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
128 stars 39 forks source link

"pyp2rpm -d ~/progs/Rpms/ --srpm -o mageia enum34" fails on mageia v7 x86-64 #130

Open shlomif opened 7 years ago

shlomif commented 7 years ago

I am getting this with latest pyp2rpm git master:

shlomif@telaviv1:~$ pyp2rpm -d /home/shlomif/progs/Rpms/ --srpm -o mageia enum34
INFO  Pyp2rpm initialized.
INFO  Using /home/shlomif/progs/Rpms/ as directory to save source.
INFO  Downloaded package from PyPI: /home/shlomif/progs/Rpms//enum34-1.1.6.tar.gz.
INFO  Getting metadata from setup.py using SetupPyMetadataExtractor.
Failed to synchronize cache for repo 'mageia-x86_64', disabling.
Failed to synchronize cache for repo 'updates-x86_64', disabling.
INFO  Running extract_dist command with: /usr/bin/python3
WARNING  Template: fedora.spec was not found in /home/shlomif/fedora.spec using default template dir.
INFO  Using default template: fedora.spec.
WARNING  Package rpmdevtools is missing, using default name: John Doe <john@doe.com>.
INFO  Using name: python-enum34.spec for specfile.
INFO  Specfile saved at: /home/shlomif/progs/Rpms//python-enum34.spec.
INFO  Starting rpmbuild to build: /home/shlomif/progs/Rpms//python-enum34.spec SRPM.
error: bad date in %changelog: - 1.1.6-1
INFO  b''
INFO  That's all folks!
shlomif@telaviv1:~$
mcyprian commented 7 years ago

I assume pyp2rpm was run on Mageia system. @glensc could you please take a look at this?

glensc commented 7 years ago

@mcyprian i'm no mageia, but pld linux user :)

however the problem seems to be that generted %changelog doesn't include date or author, only version which results bad changelog section parsing.

there's no need to generate %changelog at all imho.

@shlomif post your python-enum34.spec, it could help identifying clearly what was generated there.

shlomif commented 7 years ago

On Mon, 17 Jul 2017 23:48:55 -0700 Elan Ruusamäe notifications@github.com wrote:

@mcyprian i'm no mageia, but pld linux user :)

however the problem seems to be that generted %changelog doesn't include date or author, only version which results bad changelog section parsing.

there's no need to generate %changelog at all imho.

@shlomif post your python-enum34.spec, it could help identifying clearly what was generated there.

My python-enum34.spec is this:

# Created by pyp2rpm-3.2.2
%global pypi_name enum34

Name:           python-%{pypi_name}
Version:        1.1.6
Release:        1%{?dist}
Summary:        Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2

License:        BSD License
URL:            https://bitbucket.org/stoneleaf/enum34
Source0:
https://files.pythonhosted.org/packages/source/e/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch 
BuildRequires:  python2-devel
BuildRequires:  python-setuptools

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%description
enum support for enumerations An enumeration is a set of symbolic names
(members) bound to unique, constant values. Within an enumeration, the members
can be compared by identity, and the enumeration itself can be iterated over.
from enum import Enum class Fruit(Enum): apple 1 banana 2 orange 3 list(Fruit)
[<Fruit.apple: 1>, <Fruit.banana: 2>, <Fruit.orange: 3>] len(Fruit)
Fruit.banana ...

%package -n     python2-%{pypi_name}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
enum support for enumerations An enumeration is a set of symbolic names
(members) bound to unique, constant values. Within an enumeration, the members
can be compared by identity, and the enumeration itself can be iterated over.
from enum import Enum class Fruit(Enum): apple 1 banana 2 orange 3 list(Fruit)
[<Fruit.apple: 1>, <Fruit.banana: 2>, <Fruit.orange: 3>] len(Fruit)
Fruit.banana ...

%package -n     python3-%{pypi_name}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
enum support for enumerations An enumeration is a set of symbolic names
(members) bound to unique, constant values. Within an enumeration, the members
can be compared by identity, and the enumeration itself can be iterated over.
from enum import Enum class Fruit(Enum): apple 1 banana 2 orange 3 list(Fruit)
[<Fruit.apple: 1>, <Fruit.banana: 2>, <Fruit.orange: 3>] len(Fruit)
Fruit.banana ...

%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

%build
%py2_build
%py3_build

%install
# Must do the subpackages' install first because the scripts in /usr/bin are
# overwritten with every setup.py install.
%py3_install

%py2_install

%files -n python2-%{pypi_name}
%license enum/LICENSE
%doc 
%{python2_sitelib}/enum
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%files -n python3-%{pypi_name}
%license enum/LICENSE
%doc 
%{python3_sitelib}/enum
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%changelog
*  - 1.1.6-1
- Initial package.

and yes - I am running it on mageia v7 as the subject of the issue mentions.

Regards,

@shlomif

glensc commented 7 years ago

remove broken %changelog block:

%changelog
*  - 1.1.6-1
- Initial package.

ps: markdown does not work when replying via email in github.

shlomif commented 7 years ago

@glensc : do you want me to remove it manually, or should pyp2rpm avoid generating it in the first place?

mcyprian commented 7 years ago

@shlomif won't megeia template (-t mageia.spec) work for you? This template doesn't contain changelog but I am not sure if it is up-to-date. Maybe we could switch default template to mageia/pld when -o is specified, what do you think @glensc?

shlomif commented 7 years ago

On Wed, 19 Jul 2017 08:32:36 +0000 (UTC) Michal Cyprian notifications@github.com wrote:

@shlomif won't megeia template (-t mageia.spec) work for you?

I'll try - thanks.

This template doesn't contain changelog but I am not sure if it is up-to-date. Maybe we could switch default template to mageia/pld when -o is specified, what do you think @glensc?

shlomif commented 7 years ago

Hi all!

@mcyprian : thanks and sorry for the late reply! pyp2rpm -d /home/shlomif/progs/Rpms/ --srpm -t mageia.spec enum34 indeed produced an src.rpm but now rpmbuild --rebuild ing it fails:

Installing /home/shlomif/progs/Rpms/python-enum34-1.1.6-1.mga7.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7ZzLVV
+ umask 022
+ cd /home/shlomif/progs/Rpms/BUILD
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ cd /home/shlomif/progs/Rpms/BUILD
+ rm -rf enum34-1.1.6
+ /usr/bin/gzip -dc /home/shlomif/progs/Rpms/SOURCES/enum34-1.1.6.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd enum34-1.1.6
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ rm -rf enum34.egg-info
+ rm -rf /home/shlomif/progs/Rpms/BUILD/python3-python-enum34-1.1.6-1.mga7
+ cp -a . /home/shlomif/progs/Rpms/BUILD/python3-python-enum34-1.1.6-1.mga7
+ find /home/shlomif/progs/Rpms/BUILD/python3-python-enum34-1.1.6-1.mga7 -name '*.py'
+ xargs sed -i '1s|^#!python|#!/usr/bin/python3|'
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.A1eqHn
+ umask 022
+ cd /home/shlomif/progs/Rpms/BUILD
+ cd enum34-1.1.6
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ /usr/bin/python setup.py build
running build
running build_py
creating build
creating build/lib
creating build/lib/enum
copying enum/__init__.py -> build/lib/enum
copying enum/test.py -> build/lib/enum
copying enum/LICENSE -> build/lib/enum
copying enum/README -> build/lib/enum
creating build/lib/enum/doc
copying enum/doc/enum.rst -> build/lib/enum/doc
copying enum/doc/enum.pdf -> build/lib/enum/doc
+ pushd /home/shlomif/progs/Rpms/BUILD/python3-python-enum34-1.1.6-1.mga7
~/progs/Rpms/BUILD/python3-python-enum34-1.1.6-1.mga7 ~/progs/Rpms/BUILD/enum34-1.1.6
+ /usr/bin/python3 setup.py build
running build
running build_py
creating build
creating build/lib
creating build/lib/enum
copying enum/__init__.py -> build/lib/enum
copying enum/test.py -> build/lib/enum
copying enum/LICENSE -> build/lib/enum
copying enum/README -> build/lib/enum
creating build/lib/enum/doc
copying enum/doc/enum.rst -> build/lib/enum/doc
copying enum/doc/enum.pdf -> build/lib/enum/doc
+ popd
~/progs/Rpms/BUILD/enum34-1.1.6
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.YJa66Q
+ umask 022
+ cd /home/shlomif/progs/Rpms/BUILD
+ '[' 1 -eq 1 ']'
+ '[' /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64 '!=' / ']'
+ rm -rf /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64
++ dirname /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64
+ mkdir -p /home/shlomif/progs/Rpms/BUILDROOT
+ mkdir /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64
+ cd enum34-1.1.6
+ '[' 1 -eq 1 ']'
+ pushd /home/shlomif/progs/Rpms/BUILD/python3-python-enum34-1.1.6-1.mga7
~/progs/Rpms/BUILD/python3-python-enum34-1.1.6-1.mga7 ~/progs/Rpms/BUILD/enum34-1.1.6
+ /usr/bin/python3 setup.py install --skip-build --root /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64
running install
running install_lib
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum
copying build/lib/enum/LICENSE -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum/doc
copying build/lib/enum/doc/enum.rst -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum/doc
copying build/lib/enum/doc/enum.pdf -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum/doc
copying build/lib/enum/README -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum
copying build/lib/enum/__init__.py -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum
copying build/lib/enum/test.py -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum
byte-compiling /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum/__init__.py to __init__.cpython-35.pyc
byte-compiling /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum/test.py to test.cpython-35.pyc
running install_egg_info
running egg_info
creating enum34.egg-info
writing enum34.egg-info/PKG-INFO
writing top-level names to enum34.egg-info/top_level.txt
writing dependency_links to enum34.egg-info/dependency_links.txt
writing manifest file 'enum34.egg-info/SOURCES.txt'
reading manifest file 'enum34.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'enum34.egg-info/SOURCES.txt'
Copying enum34.egg-info to /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5/site-packages/enum34-1.1.6-py3.5.egg-info
running install_scripts
+ popd
~/progs/Rpms/BUILD/enum34-1.1.6
+ /usr/bin/python setup.py install --skip-build --root /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64
running install
running install_lib
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum
copying build/lib/enum/LICENSE -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum
creating /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum/doc
copying build/lib/enum/doc/enum.rst -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum/doc
copying build/lib/enum/doc/enum.pdf -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum/doc
copying build/lib/enum/README -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum
copying build/lib/enum/__init__.py -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum
copying build/lib/enum/test.py -> /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum
byte-compiling /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum/__init__.py to __init__.pyc
byte-compiling /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum/test.py to test.pyc
running install_egg_info
running egg_info
creating enum34.egg-info
writing enum34.egg-info/PKG-INFO
writing top-level names to enum34.egg-info/top_level.txt
writing dependency_links to enum34.egg-info/dependency_links.txt
writing manifest file 'enum34.egg-info/SOURCES.txt'
reading manifest file 'enum34.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'enum34.egg-info/SOURCES.txt'
Copying enum34.egg-info to /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum34-1.1.6-py2.7.egg-info
running install_scripts
+ /usr/lib/rpm/find-debuginfo.sh --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -m /home/shlomif/progs/Rpms/BUILD/enum34-1.1.6

+ '[' -n '' ']'
+ /usr/share/spec-helper/clean_files
+ '[' -n '' ']'
+ /usr/share/spec-helper/compress_files .xz
+ '[' -n '' ']'
+ /usr/share/spec-helper/relink_symlinks
+ '[' -n '' ']'
+ /usr/share/spec-helper/clean_perl
+ '[' -n '' ']'
+ /usr/share/spec-helper/lib_symlinks
+ '[' -n '' ']'
+ /usr/share/spec-helper/gprintify
+ '[' -n '' ']'
+ /usr/share/spec-helper/fix_mo
+ '[' -n '' ']'
+ /usr/share/spec-helper/translate_menu
+ '[' -n '' ']'
+ /usr/share/spec-helper/fix_pamd
+ '[' -n '' ']'
+ /usr/share/spec-helper/remove_info_dir
+ '[' -n '' ']'
+ /usr/share/spec-helper/fix_eol
+ '[' -n '' ']'
+ /usr/share/spec-helper/check_elf_files
+ /usr/lib/rpm/mageia/brp-java-repack-jars
+ '[' 1 -eq 1 ']'
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
Bytecompiling .py files below /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python3.5 using /usr/bin/python3.5
Bytecompiling .py files below /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7 using /usr/bin/python2.7
+ /usr/lib/rpm/brp-python-hardlink
Processing files: python-enum34-1.1.6-1.mga7.noarch
error: File not found: /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum34

RPM build errors:
    File not found: /home/shlomif/progs/Rpms/BUILDROOT/python-enum34-1.1.6-1.mga7.x86_64/usr/lib/python2.7/site-packages/enum34
glensc commented 7 years ago

@mcyprian dunno, mageia and pld-linux have nothing in common.

mcyprian commented 7 years ago

@glensc I mean pld template for pld, mageia template for mageia of course.