Bug 225119

Summary: Review Request: PythonCAD - Python scriptable CAD package
Product: [Fedora] Fedora Reporter: Nicolas Chauvet (kwizart) <kwizart>
Component: Package ReviewAssignee: Mamoru TASAKA <mtasaka>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Package Reviews List <fedora-package-review>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mtasaka
Target Milestone: ---Flags: mtasaka: fedora-review+
petersen: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-05 02:59:40 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: 163779    
Attachments:
Description Flags
Mock build log of PythonCAD-0.1.35-2.fc7
none
PythonCad - Requires from import section none

Description Nicolas Chauvet (kwizart) 2007-01-29 03:39:41 UTC
Spec URL:
http://kwizart.free.fr/fedora/SPECS/pythoncad.spec
SRPM URL:
http://kwizart.free.fr/fedora/6/SRPMS/PythonCAD-0.1.35-1.kwizart.fc6.src.rpm
Description: PythonCAD scriptable CAD package

rpmlint on binary (source silent)
W: PythonCAD non-executable-in-bin /usr/bin/gtkpycad.pyo 0644
W: PythonCAD non-executable-in-bin /usr/bin/gtkpycad.pyc 0644
E: PythonCAD non-executable-script /usr/lib/python2.4/site-packages/PythonCAD/Generic/bindump.py 0644

Should I changes these perm to 755 ?

Comment 1 Nicolas Chauvet (kwizart) 2007-01-29 03:42:18 UTC
I Also need to be sponsored...

Comment 2 Yuichi Nakamura 2007-01-30 05:41:09 UTC
I am not sponsor, so it is pre-review.
I am also seeking for sponsor, at Bug 222594 .
I have looked at your spec file, and have some comments.

1) Block FE-NEEDSPONSOR
Please input "FE-NEEDSPONSOR" at Bug 225119 blocks ...
By this, possible sponsor might find you :-)

2) cp pythoncad.desktop $RPM_BUILD_ROOT%{_datadir}/applications/

You have to use desktop-file-install command.
http://fedoraproject.org/wiki/Packaging/Guidelines#head-254ddf07aae20a23ced8cecc219d8f73926e9755

3) File copy
You are using cp and chmod command to install files,
but you can do it by "install -m <permission>".
And, please do not forget to use "-p" option:
http://fedoraproject.org/wiki/Packaging/Guidelines#head-0239576e441f9ef53d175c4aec8c12868dffb5ab

4) BuildRequires
You are using "setup.py", but it requires "python-tools" package.

And you can omit "python":
http://fedoraproject.org/wiki/Extras/FullExceptionList

5) [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
It is not commonly used.
rm -rf "$RPM_BUILD_ROOT" will work.

6) Spec file name
%{name} in your package is "PythonCAD", however, spec name is "pythoncad.spec".
I think you have to use either "PythonCAD" or "pythoncad".
please look at below:
http://fedoraproject.org/wiki/Packaging/NamingGuidelines#head-625ebbc8678382beca8d0b02504d30e7b6f23791

7) *.pyo *.pyc in /usr/bin/
From rpmlint:
W: PythonCAD non-executable-in-bin /usr/bin/gtkpycad.pyo 0644
W: PythonCAD non-executable-in-bin /usr/bin/gtkpycad.pyc 0644
If you change executable name from "gtkpycad.py" to "gtkpycad", it will not
appear, and I think it is better.

8)
http://kwizart.free.fr/fedora/SPECS/pythoncad.spec
and spec file included in SRPM is different one.

9) python setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT
You can use %{__python} .

10) Should I changes these perm to 755 ?
I think so..

Comment 3 Nicolas Chauvet (kwizart) 2007-01-30 16:34:13 UTC
Thx for your help Yuichi!

SRPM:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD-0.1.35-2.kwizart.fc6.noarch.rpm
SPEC:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD.spec
Description: PythonCAD scriptable CAD package

I'm using mock for a few time...So it now build fine in mock!
(rpmlint is now silent...)



Comment 4 Mamoru TASAKA 2007-02-05 17:50:13 UTC
Created attachment 147379 [details]
Mock build log of PythonCAD-0.1.35-2.fc7

Mock build log of PythonCAD-0.1.35-2 on FC-devel i386.
Dependency changed during python 2.4 -> 2.5 and
this package needs "BuildRequires: python-devel".

Then...
* Directory structure
-------------------------------------------
%config(noreplace) %{_sysconfdir}/pythoncad/prefs.py*
-------------------------------------------
  - Well, the files under /etc are configuration files
  and generally no binaries are permitted (for this package
  .pyc or .pyo file)

  prefs.py should be moved to normally %{_datadir}/%{name}.
  This movement also requires some other modification on
  files included in PythonCAD.

* File entry
----------------------------------
%{_bindir}/gtkpycad*
----------------------------------
  - This asterisk is no longer needed.

* Desktop file
-----------------------------------
[Desktop Entry]
Name=PyCAD
Comment=PythonCAD
Icon=/usr/share/pixmaps/gtkpycad.png
Exec=/usr/bin/gtkpycad.py
Terminal=false
Type=Application
Encoding=UTF-8
X-Desktop-File-Install-Version=0.12
Categories=Office;Graphics;Application;Utility;X-Red-Hat-Base;
----------------------------------------
  - Exec entry is wrong..
  - For icon entry, "Icon=gtkpycad.png" is preferred.
  - Both categories "Application" "X-Red-Hat-Base" are deprecated
    and should be removed.

* Requires
  - Please check python related dependency.
    For example, Interface/Gtk/gtktext.py includes the line:
----------------------------------------
import pango
----------------------------------------
    This means this package needs "pygtk2" for Requires.

Comment 5 Mamoru TASAKA 2007-02-05 17:53:25 UTC
One another comment:
-----------------------------------------------
chmod 0755 $RPM_BUILD_ROOT%{python_sitelib}/PythonCAD/Generic/bindump.py
------------------------------------------------
- Well, if this python script is not aimed for being called by
  user, only called by other python scripts, the permission should
  be 0644 and shebang on this script should be removed.

Comment 6 Nicolas Chauvet (kwizart) 2007-02-06 00:03:27 UTC
Created attachment 147421 [details]
PythonCad - Requires from import section

Comment 7 Nicolas Chauvet (kwizart) 2007-02-06 00:16:47 UTC
Oups - Attachement has cancel the message i was writting...

Ok to all but:
- %config(noreplace) %{_sysconfdir}/pythoncad/prefs.py*
I've only excluded from package prefs.py? which are commonly unneeded!
prefs.py is a config file and is also refered in %site_lib/preferences.py

I will ask upstream about #5 (and correct it if needed!)




Comment 8 Nicolas Chauvet (kwizart) 2007-02-06 00:25:11 UTC
SRPM:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD-0.1.35-3.kwizart.fc6.src.rpm
SPEC:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD.spec
Description: PythonCAD scriptable CAD package

Comment 9 Mamoru TASAKA 2007-02-06 17:18:34 UTC
Well, I have not checked -3, however,(In reply to comment #7)

> - %config(noreplace) %{_sysconfdir}/pythoncad/prefs.py*
> I've only excluded from package prefs.py? which are commonly unneeded!
> prefs.py is a config file and is also refered in %site_lib/preferences.py

Umm.. this is not.
Generic/preferences.py says:
-------------------------------------------------
  1223      try:
  1224          _f, _p, _d = imp.find_module('prefs', ['/etc/pythoncad'])
  1225          if _f is not None:
  1226              try:
-------------------------------------------------
This means that Generic/preferences.py tries to import
/etc/pythoncad/prefs.py as a module. When this is done,
what occurs is...
-------------------
[root@localhost pythoncad]# rm -f *pyc *pyo
[root@localhost pythoncad]# ls -al
total 52
drwxr-xr-x   2 root root  4096 Feb  7 02:13 .
drwxr-xr-x 146 root root 16384 Feb  7 00:23 ..
-rw-r--r--   1 root root 18527 Sep 19 04:36 prefs.py
[root@localhost pythoncad]# gtkpycad 
[root@localhost pythoncad]# ls -al
total 60
drwxr-xr-x   2 root root  4096 Feb  7 02:14 .
drwxr-xr-x 146 root root 16384 Feb  7 00:23 ..
-rw-r--r--   1 root root 18527 Sep 19 04:36 prefs.py
-rw-r--r--   1 root root  1466 Feb  7 02:14 prefs.pyc
------------------------------
... you can see that prefs.pyc is created.
Python tries to optimize (i.e. compile) python script when
it is loaded as a module if it is possible automatically, 
and this should not be done under /etc.

Comment 10 Mamoru TASAKA 2007-02-06 17:59:39 UTC
Sorry, please revert the issue of python config files
under /etc.

i.e. please leave config files under /etc/ as it is, with
     .py? files _undeleted_.
Would you upload a new spec/srpm again? Then I will
review this.

Comment 11 Nicolas Chauvet (kwizart) 2007-02-06 23:50:54 UTC
Ok! These files seem compiled but the package is considered as arch independant
so in wonder if compiled python scripts are really compiled or maybe
"pre-interpretted"...?
[kwizart@kwizatz pythoncad]# file prefs.py
prefs.py: ASCII English text
[kwizart@kwizatz pythoncad]# file prefs.pyc
prefs.pyc: python 2.4 byte-compiled
[kwizart@kwizatz pythoncad]# file prefs.pyo 
prefs.pyo: python 2.4 byte-compiled

SRPM:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD-0.1.35-4.kwizart.fc6.src.rpm
SPEC:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD.spec
Description: PythonCAD scriptable CAD package

Comment #5 is still waiting for an answear...



Comment 12 Mamoru TASAKA 2007-02-07 14:50:37 UTC
Well,

* gettext translation file
  - One gettext po file is found.
    po/PythonCAD.es.po
    This seems to be ES (Spanish) translation and this should
    be installed. This file has to be compiled by msgfmt in
    gettext rpm. And %find_lang should be used for this file.

* BuildRequires:
  - By the way, does this srpm need "python-tools" for
    BuildRequires?
    * Normally setup.py (i.e. distutils module) requires
      python-devel (from FC-devel), not python-tools
    * My system does not have python-tools installed, however
      I can rebuild this package.

* Timestamps
  - Please keeps timestamp on the original source (i.e.
    download the source by "wget -N" for example). 

Comment 13 Mamoru TASAKA 2007-02-21 17:35:03 UTC
ping?

Comment 14 Nicolas Chauvet (kwizart) 2007-02-28 23:38:05 UTC
Sorry for the later answear... I finaly got something with locale

SRPM:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD-0.1.35-5.kwizart.fc6.src.rpm
SPEC:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD.spec
Description: PythonCAD scriptable CAD package

rpmlint is still silent...

Since you seems to be interested in some package reviews i have submitted
(cinepaint pyopengl, some help for aqsis) Will you accept to sponsor me?

I plan to review brlcad also and i'm working on elektra for the moment...(with
the hope to finish before devel freeze so this will be the first on the TODO list).
I also have libdiract and other wifi relatives packages for Fedora extras
currently in review...



Comment 15 Mamoru TASAKA 2007-03-01 06:04:15 UTC
System update ended. I will re-review this later.

> Since you seems to be interested in some package reviews i have submitted
> (cinepaint pyopengl, some help for aqsis) Will you accept to sponsor me?

Okay. 

Comment 16 Mamoru TASAKA 2007-03-01 16:26:15 UTC
Well, for 0.1.35-5:

* Directory ownership
  - The following directories are not owned by any packages.
----------------------------------------------------
/etc/pythoncad/
----------------------------------------------------

    Well, the following is the only issue to block this
    bug. So please fix the above.

Comment 17 Nicolas Chauvet (kwizart) 2007-03-01 18:01:01 UTC
SRPM:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD-0.1.35-6.kwizart.fc6.src.rpm
SPEC:
http://kwizart.free.fr/fedora/6/testing/PythonCAD/PythonCAD.spec
Description: PythonCAD scriptable CAD package

Fixed i've used %dir %{_sysconfdir}/pythoncad
That should own the directory without double list files...

Comment 18 Mamoru TASAKA 2007-03-01 18:13:02 UTC
Okay.

----------------------------------------------------
 This package (pythoncad) is APPROVED by me.
----------------------------------------------------

Please follow
http://fedoraproject.org/wiki/Extras/Contributors

Comment 19 Nicolas Chauvet (kwizart) 2007-03-04 21:41:38 UTC
Package Name: PythonCAD
Short Description: PythonCAD scriptable CAD package
Owners: kwizart 
Branches: FC-5 FC-6 devel
InitialCC: 

Comment 20 Jens Petersen 2007-03-05 02:02:34 UTC
I think the Summary should be simply "Python scriptable CAD package".

Comment 21 Mamoru TASAKA 2007-03-05 03:11:30 UTC
(Just changed Summary according to owners.list)

Comment 22 Mamoru TASAKA 2008-01-30 19:25:02 UTC
(Just changed Summary so that this is surely detected by
  PackageStatus)