Bug 510097

Summary: Review Request: python-urwid - console user interface for python
Product: [Fedora] Fedora Reporter: Konstantinos <ultimatekonstantinos>
Component: Package ReviewAssignee: Christoph Wickert <christoph.wickert>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: christoph.wickert, dcantrell, fedora-package-review, mail, notting, opensource, sherry151, ultimatekonstantinos
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-20 15:22:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 201449, 511204    

Description Konstantinos 2009-07-07 16:52:40 UTC
Hi,
This is my first package. 
It is called python-urwid and is a console user interface library for Python, very usefull for Developers. I updated the old package and I made a few fixes so that rpmlint does not complain. Here is the spec and the srpm.

SPEC URL:http://tartufo.dyndns.org/temp/python-urwid.spec
SRPM URL:http://tartufo.dyndns.org/temp/python-urwid-0.9.8.4-1.fc11.src.rpm

Comment 1 Dimitris Glezos 2009-07-07 16:53:49 UTC
*** Bug 427706 has been marked as a duplicate of this bug. ***

Comment 2 Niall Sheridan 2009-07-07 19:36:13 UTC
highly uninterested.

Comment 3 Fabian Affolter 2009-07-07 20:03:49 UTC
Just one quick comment:

- Replace '%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}' with '%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}'
  https://fedoraproject.org/wiki/Packaging:Guidelines#.25global_preferred_over_.25define

Comment 4 Konstantinos 2009-07-09 09:57:10 UTC
Fixed that. Thanx for the tip.

The new files:

SPEC URL: http://tartufo.dyndns.org/temp/pyur/python-urwid.spec
SRPM URL: http://tartufo.dyndns.org/temp/pyur/python-urwid-0.9.8.4-2.fc11.src.rpm

Comment 5 Fabian Affolter 2009-07-09 12:48:46 UTC
There are a bunch of rpmlint warning.

[fab@laptop09 i586]$ rpmlint python-urwid*
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/dialog.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/calc.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/graph.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/browse.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/edit.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/fib.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/docgen_reference.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/tour.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/test_urwid.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/bigtext.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/docgen_tutorial.py
python-urwid.i586: W: spurious-executable-perm /usr/share/doc/python-urwid-0.9.8.4/input_test.py
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/dialog.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/calc.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/graph.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/browse.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/edit.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/fib.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/docgen_reference.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/tour.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/test_urwid.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/bigtext.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/docgen_tutorial.py /usr/bin/python
python-urwid.i586: W: doc-file-dependency /usr/share/doc/python-urwid-0.9.8.4/input_test.py /usr/bin/python
2 packages and 0 specfiles checked; 0 errors, 24 warnings.

Is the Source0 entry correct?

[fab@laptop09 SOURCES]$ LC_ALL=C spectool -g ~/rpmbuild/SPECS/python-urwid.spec
--2009-07-09 14:48:14--  http://excess.org/urwid/urwid-0.9.8.4.tar.gz
Resolving excess.org... 64.15.148.243
Connecting to excess.org|64.15.148.243|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2009-07-09 14:48:14 ERROR 404: Not Found.

Comment 6 Konstantinos 2009-07-09 14:09:59 UTC
I had followed the tips from bug 427796. But now it seems that the examples included in the package (which I had marked as documentation) have some dependencies. There are also warnings about spurious executable permissions. Can anybody help?

Comment 7 Fabian Affolter 2009-07-13 13:35:40 UTC
An option is to remove the shebang in the doc-files.  You can fix the permissions during the RPM build process (see https://fedoraproject.org/wiki/Packaging_tricks#Exec_permission as an example)

Comment 8 Rangeen Basu Roy Chowdhury 2009-07-14 05:38:19 UTC
This package is needed for another package that I am making. It has a ncurses interface and uses python-uird module.

Comment 9 Rangeen Basu Roy Chowdhury 2009-07-15 10:04:49 UTC
The rpmlint errors can be solved in the following two ways:

1) Remove the shebang from the example files and change their permission to 0644. But in this case , the examples have to be run using python : python browse.py

2) Do not include the examples in %doc and copy them to a separate directory, examples, in the %install section and put them somewhere (Not sure where). I think /usr/share/uird/ is the best place to keep these examples or /usr/bin/ if these are intended to be executed directly.

The examples are standalone applications and I strongly believe that they should be put in a separate subpackage such as python-uird-exaples.rpm  provided these should at all be installed. At this time either the exapmles should be removed from the package or a separate sub package should be made and the examples installed in /usr/bin/

Comment 10 Rangeen Basu Roy Chowdhury 2009-07-15 10:22:10 UTC
Buildrequires: python-setuptool-devel

should be replaced with

Buildrequires: python-devel

koji scratch build succeeds with only python-devel as Buildrequires.

F-11: https://koji.fedoraproject.org/koji/taskinfo?taskID=1475161
F-12: https://koji.fedoraproject.org/koji/taskinfo?taskID=1475193

Comment 11 Fabian Affolter 2009-07-25 21:40:39 UTC
Konstantinos, this is your review request.  Can you please provide a new spec file and a new SRPM with the changes?  I guess that Rangeen is waiting for this package.

Comment 12 Christoph Wickert 2009-07-25 22:02:01 UTC
I will review this as well as sponsor Konstantinos

Comment 13 Konstantinos 2009-07-28 17:48:20 UTC
Sorry for being late! But I'm gonna fix it as soon as possible.

Comment 14 Konstantinos 2009-08-05 08:48:24 UTC
Here it comes...

SPEC: http://tartufo.dyndns.org/temp/pyur/0984-3/python-urwid.spec
SRPM: http://tartufo.dyndns.org/temp/pyur/0984-3/python-urwid-0.9.8.4-3.fc11.src.rpm

Thanks Christoph Wickert for his help!

Comment 15 Christoph Wickert 2009-08-05 22:42:09 UTC
REVIEW for b673626cecf9bc79d35953312cc9a304  python-urwid-0.9.8.4-3.fc11.src.rpm
28f918c66887d4e470ae0c3535579ad7

OK - MUST: rpmlint must be run on every package.
$ rpmlint /var/lib/mock/fedora-rawhide-x86_64/result/python-urwid-*
python-urwid.x86_64: E: non-standard-executable-perm /usr/lib64/python2.6/site-packages/urwid/str_util.so 0775
3 packages and 0 specfiles checked; 1 errors, 0 warnings.

This warning is bogus. It only happens when the package is build in mock, but not when it was built locally or in koji. Not sure if it's a mock or rpmlint issue.
OK - MUST: The package is named according to the Package Naming Guidelines.
OK - MUST: The spec file name matches the base package %{name}, in the format %{name}.spec.
OK - MUST: The package meets the Packaging Guidelines.
OK - MUST: The package is licensed with a Fedora approved license and meets the Licensing Guidelines: LGPLv2+
OK - MUST: The License field in the package spec file matches the actual license.
N/A - MUST: The license file from the source package is included in %doc: no license included in source
OK - MUST: The spec file is in American English.
OK - MUST: The spec file for the package is legible.
OK - MUST: The sources used to build the package match the upstream source by MD5 28f918c66887d4e470ae0c3535579ad7
OK - MUST: The package successfully compiles and builds into binary rpms on x86_64
OK - MUST: No ExcludeArch.
OK - MUST: All build dependencies are listed in BuildRequires.
N/A - MUST: The spec file handles locales properly with the %find_lang macro: no locales
N/A - MUST: Every binary RPM package (or subpackage) which stores shared library files (not just symlinks) in any of the dynamic linker's default paths, must call ldconfig in %post and %postun.
N/A - MUST: If the package is designed to be relocatable, the packager must state this fact in the request for review, along with the rationalization for relocation of that specific package.
FAIL - MUST: The package owns all directories that it creates: %{python_sitearch}/urwid/ is not owned
OK - MUST: The package does not contain any duplicate files in the %files listing.
OK - MUST: Permissions on files are set properly. Every %files section includes a %defattr(...) line.
OK - MUST: The package has a %clean section, which contains rm -rf %{buildroot}.
OK - MUST: The package consistently uses macros, as described in the macros section of Packaging Guidelines.
OK - MUST: The package contains code, or permissable content.
N/A - MUST: Large documentation files should go in a -doc subpackage.
OK - MUST: Files included as %doc do not affect the runtime of the application.
N/A - MUST: Header files must be in a -devel package.
N/A - MUST: Static libraries must be in a -static package.
N/A - MUST: Packages containing pkgconfig(.pc) files must 'Requires: pkgconfig'.
N/A - MUST: If a package contains library files with a suffix (e.g. libfoo.so.1.1), then library files that end in .so (without suffix) must go in a -devel package.
N/A - MUST: In the vast majority of cases, devel packages must require the base package using a fully versioned dependency: Requires: %{name} = %{version}-%{release}
OK - MUST: The package does not contain any .la libtool archives.
N/A - MUST: Packages containing GUI applications must include a %{name}.desktop file, and that file must be properly installed with desktop-file-install in the %install section.
OK - MUST: The packages does not own files or directories already owned by other packages.
OK - MUST: At the beginning of %install, the package runs rm -rf %{buildroot}.
OK - MUST: All filenames in rpm packages are valid UTF-8.


SHOULD Items:
TBD - SHOULD: If the source package does not include license text(s) as a separate file from upstream, the packager SHOULD query upstream to include it.
N/A - SHOULD: The description and summary sections in the package spec file should contain translations for supported Non-English languages, if available.
OK - SHOULD: The the package builds in mock.
OK - SHOULD: The package should compile and build into binary rpms on all supported architectures.
OK - SHOULD: The package functions as described.
N/A - SHOULD: If scriptlets are used, those scriptlets must be sane.
N/A - SHOULD: Usually, subpackages other than devel should require the base package using a fully versioned dependency.
N/A - SHOULD: The placement of pkgconfig(.pc) files depends on their usecase, and this is usually for development purposes, so should be placed in a -devel pkg.
N/A - SHOULD: If the package has file dependencies outside of /etc, /bin, /sbin, /usr/bin, or /usr/sbin consider requiring the package which provides the file instead of the file itself.


Other items:
OK - SourceURL is valid
OK - RPM_OPT_FLAGS honored


Issues: 
The package doesn't own %{python_sitearch}/urwid/ and therefor this dir will be left behind if the package is uninstalled. So change
  %{python_sitearch}/urwid/*
to 
  %{python_sitearch}/urwid/

Timestamps don't match. Please download the source tarball again and keep the timestamp, see https://fedoraproject.org/wiki/Packaging/Guidelines#Timestamps


To get rid of the bogus rpmlint warning we need to force permissions of str_util.so in the spec with %attr. This can be done with
  %attr(644,root,root) %{python_sitearch}/urwid/*.so

str_util.so is already covered by %{python_sitearch}/urwid/ and we must not list the file twice. So we need to change the files section a little:
  dir %{python_sitearch}/urwid/    <-- this only owns the dir but no files
  %{python_sitearch}/urwid/*.py*
  %attrib 0644 %{python_sitearch}/urwid/py*

One last tip: Please use
%{python_sitearch}/*.egg-info/
instead of
%{python_sitearch}/*.egg-info
With the dash at the end a person who looks at the spec can see that urwid-0.9.8.4-py2.6.egg-info is a directory and not a file.

Konstantinos, please apply the fixes and then I will approve the package.


Rangeen, would you like to co-maintain this package with Konstantinos? Konstantinos can help you with wicd in turn. This is useful is one of you is on holidays or has not enough time to look after the package.

Comment 16 Till Maas 2009-08-05 22:55:46 UTC
(In reply to comment #15)
> REVIEW for b673626cecf9bc79d35953312cc9a304 
> python-urwid-0.9.8.4-3.fc11.src.rpm
> 28f918c66887d4e470ae0c3535579ad7
> 
> OK - MUST: rpmlint must be run on every package.
> $ rpmlint /var/lib/mock/fedora-rawhide-x86_64/result/python-urwid-*
> python-urwid.x86_64: E: non-standard-executable-perm
> /usr/lib64/python2.6/site-packages/urwid/str_util.so 0775
> 3 packages and 0 specfiles checked; 1 errors, 0 warnings.
> 
> This warning is bogus. It only happens when the package is build in mock, but
> not when it was built locally or in koji. Not sure if it's a mock or rpmlint
> issue.

It is probably a umask or less likely a filesystem issue. What's the output of umask within a mock shell:

$ /usr/bin/mock -r <config>  shell
[...]
mock-chroot> umask

Comment 17 Christoph Wickert 2009-08-05 23:17:25 UTC
mock-chroot> umask
0022
mock-chroot> 

The strange thing is: The permissions of the *.so are always 0775, but rpmlint only complains on the package built in mock. Most of the other *so's in %{python_sitearch} are 0775 too, so this package is not the only one affected.

Comment 18 Till Maas 2009-08-05 23:51:14 UTC
The command was wrong, because it shows the umask for the root user, not the mock build user. Then the command is:

su - mockbuild -c umask

NEvertheless, fixing it in the spec is probably not that bad, but it should probably be done for all python packages...

Comment 19 Christoph Wickert 2009-08-06 00:00:46 UTC
(In reply to comment #18)
> su - mockbuild -c umask

There is no user 'mockbuild' but only a 'mock' group.

> NEvertheless, fixing it in the spec is probably not that bad, but it should
> probably be done for all python packages...  

It's a lot of packages that need to be fixed.

Comment 20 Till Maas 2009-08-06 00:12:30 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > su - mockbuild -c umask
> 
> There is no user 'mockbuild' but only a 'mock' group.

The command also needs to be run within the mock shell.

> > NEvertheless, fixing it in the spec is probably not that bad, but it should
> > probably be done for all python packages...  
> 
> It's a lot of packages that need to be fixed.  

Yes. I guess ideally rpm would support another parameter for %defattr for files that have the executable flag set, then this could be done with a simple sed script. :-)

Comment 21 Christoph Wickert 2009-08-06 00:27:35 UTC
(In reply to comment #20)
> The command also needs to be run within the mock shell.

mock-chroot> su mockbuild
mock-chroot> umask
0002

Comment 22 Mamoru TASAKA 2009-08-06 06:55:23 UTC
(In reply to comment #15)
> OK - MUST: rpmlint must be run on every package.
> $ rpmlint /var/lib/mock/fedora-rawhide-x86_64/result/python-urwid-*
> python-urwid.x86_64: E: non-standard-executable-perm
> /usr/lib64/python2.6/site-packages/urwid/str_util.so 0775
> 3 packages and 0 specfiles checked; 1 errors, 0 warnings.
> 
> To get rid of the bogus rpmlint warning we need to force permissions of
> str_util.so in the spec with %attr. This can be done with
>   %attr(644,root,root) %{python_sitearch}/urwid/*.so

No, without executable permission debuginfo rpm will not be
created correctly. Permission must be "0755" (not 0775)

Comment 23 Christoph Wickert 2009-08-06 09:30:22 UTC
Sorry for the typo and for forgetting the debug info. But why do libs need to be executable?

Comment 24 Mamoru TASAKA 2009-08-06 10:24:32 UTC
(In reply to comment #23)
> Sorry for the typo and 
- Well, not typo. 
  The reason you got "non-standard-executable-perm" on str_util.so was 
  because with your mock str_util.so was created with "0775" permission, 
  not "0755", which does not occur when I try local rpmbuild or mockbuild 
  for dist-f12 i686, and try koji scratch build (i.e. when I try mockbuild,
  str_util.so was created with 0755 permission)
  I don't think this is because of umask issue, because at least rawhide
  rpm always sets umask to 022 when executing %prep, %build, %install:
--------------------------------------------------------------
DEBUG: Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.MTc5VE
DEBUG: + exit 0
DEBUG: + umask 022
DEBUG: + cd /builddir/build/BUILD
DEBUG: + '[' /builddir/build/BUILDROOT/python-urwid-0.9.8.4-3.fc12.i386 '!=' / ']'
-------------------------------------------------------------

> for forgetting the debug info. But why do libs need to
> be executable?  
- Because find-debuginfo.sh tries to extract debug information
  from binaries with executable permission only.

Comment 25 Christoph Wickert 2009-08-06 10:40:58 UTC
(In reply to comment #24)
> (In reply to comment #23)
> > Sorry for the typo and 

Ok, now I got it. Seems it was a little late last night.

> > for forgetting the debug info. But why do libs need to
> > be executable?  
> - Because find-debuginfo.sh tries to extract debug information
>   from binaries with executable permission only.  

Yeah, I know, I guess I should have asked more clearly: Why does the installed .so need to be executable? Or why is find-debuginfo.sh not smarter?

Comment 26 Mamoru TASAKA 2009-08-06 10:49:00 UTC
(In reply to comment #25)
Yeah, I know, I guess I should have asked more clearly: Why does the installed
> .so need to be executable? Or why is find-debuginfo.sh not smarter?  

Please ask rpm maintainer.

Comment 27 Rangeen Basu Roy Chowdhury 2009-08-09 05:55:39 UTC
> 
> Rangeen, would you like to co-maintain this package with Konstantinos?
> Konstantinos can help you with wicd in turn. This is useful is one of you is on
> holidays or has not enough time to look after the package.  

I am a little busy with my job + I do not have a proper net connection yet since I recently relocated. But hopefully I will be able to obtain a net connection soon and also I will have sufficient time from next week onwards. So if Konstantinos wants he can put me as a co-maintainer and I will definitely try to help.

Comment 28 kushaldas@gmail.com 2009-08-30 20:12:49 UTC
Eh, I missed this entry totally , I am already having working rpm and spec ready. Should I submit it here ?

Comment 29 Konstantinos 2009-08-31 16:51:42 UTC
I was working something and is almost ready but I've been busy because of my exams. So you are welcome!

Comment 30 Till Maas 2010-01-04 03:08:22 UTC
What's the status here? Will you be able to submit a working spec file, soon, Konstantinos?

Where is your spec file Kushal?

Comment 31 Chen Lei 2010-05-20 09:25:30 UTC
*** Bug 593839 has been marked as a duplicate of this bug. ***

Comment 32 David Cantrell 2010-05-20 13:56:36 UTC
I packaged this module yesterday.  Feel free to take anything from my spec file:

http://dcantrel.fedorapeople.org/urwid/urwid.spec
http://dcantrel.fedorapeople.org/urwid/urwid-0.9.9.1-1.fc13.src.rpm

Comment 33 David Cantrell 2010-05-20 14:00:23 UTC
Christoph,

Chen Lei suggested I move my review request to here.  I've posted the links in comment 32.  If you want to go with my urwid package for the review, let me know.

Comment 34 Christoph Wickert 2010-05-20 14:59:08 UTC
Please open a review request because the reporter of the bug can not be changed. Then mark this bug a duplicate of yours, so we all get cc'ed to the new bug. Do the same for wicd.

Comment 35 David Cantrell 2010-05-20 15:21:43 UTC
*** Bug 593839 has been marked as a duplicate of this bug. ***

Comment 36 David Cantrell 2010-05-20 15:22:37 UTC

*** This bug has been marked as a duplicate of bug 593839 ***

Comment 37 Christoph Wickert 2010-05-20 15:34:43 UTC
Unblock NEEDSPONSOR, block FE-DEADREVIEW