packages: authconfig/authconfig.spec - fix python packaging, now things exe...

Elan Ruusamäe glen at delfi.ee
Fri Apr 20 17:40:53 CEST 2012


On 20.04.2012 17:40, Jakub Bogusz wrote:
> On Fri, Apr 20, 2012 at 08:46:09AM +0200, glen wrote:
>> -%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/authconfig-tui.py
>> -ln -s authconfig.py $RPM_BUILD_ROOT%{_datadir}/%{name}/authconfig-tui.py
>> +%py_comp $RPM_BUILD_ROOT%{_datadir}/%{name}
>> +# libraries, no sources needed
>> +%{__rm} -v $RPM_BUILD_ROOT%{_datadir}/%{name}/{authinfo,dnsclient,msgarea,shvfile}.py
>> +# invoked directly, not as library
>> +%{__rm} -v $RPM_BUILD_ROOT%{_datadir}/%{name}/authconfig*.py[co]
> When Python script is named as *.py, python interpreter byte-compiles it
> and tries to save the result (as .pyc or .pyo, depending on -O flag).
> So when such script is packaged in %{_libdir}/*, %{_datadir}/* or so,
> *.py[co] should be packaged too (or they will be created at runtime,
> when the script is run by root).

it doesn't behave here so:

here it creates .pyc only for imported modules, if invoked via 
#!/shebang, no .pyc is created for the script itself:

18:39:43 glen[load: 0.00]@haarber share/authconfig$ l
total 344K
-rw-r--r-- 1 root root 139K 20. apr   09:44 authconfig.glade
-rwxr-xr-x 1 root root  26K 20. apr   09:44 authconfig-gtk.py*
-rwxr-xr-x 1 root root  42K 20. apr   09:44 authconfig.py*
lrwxrwxrwx 1 root root   13 20. apr   09:45 authconfig-tui.py -> 
authconfig.py*
-rw-r--r-- 1 root root  98K 20. apr   09:44 authinfo.pyc
-rw-r--r-- 1 root root  12K 20. apr   09:44 dnsclient.pyc
-rw-r--r-- 1 root root 9.8K 20. apr   09:44 msgarea.pyc
-rw-r--r-- 1 root root 4.3K 20. apr   09:44 shvfile.pyc

and i invoked authconfig as root and as regular user

as there's nobody specifycing -0, should .pyc still be added? (in case 
of private moduledir)

> In case if %{_bindir} or %{_sbindir} - no script should be named *.py
> there (actually there are some, but they should be fixed).
>
any explanation why (not that i have against)

-- 
glen



More information about the pld-devel-en mailing list