Fyodor wrote:
>
> Does anyone know a good way to handle this in RPMs? We would be
> interested in seeing RPMs for Python scripts which handle both
> versions without requiring separate rpms?
>
Totally untested, but it's supposed to work
----------
%install
(copy python-files to /usr/share/nmap-%version/python/<python-paths>)
find /usr/share/nmap-%version/python/ -type f | \
sed 's#/usr/share/nmap-%version/python/#%ghost /usr/lib/python*/#' >filelist
%post zenmap
for pylib in /usr/lib/python*; do
cp -a /usr/share/nmap-%version/python/* $pylib
done
%files zenmap
%_bindir/zenmap
---------
The %ghost thing tells rpm that the files may not exist until after
%post has run its course. You can do without the %ghost lines entirely
to get the correct functionality, but then you'll need to manually
remove those files in the %preun script, or they'll be left behind.
The %ghost lines also make rpm -qf attribute the files to the right
package (I think).
It's been a while since I dabbled with RPM voodoo so I might be
completely off here.
Note that you have to list every single file under /usr/lib/python
as %ghost. Wildcard expansions won't work. The filelist thing should
take care of it automagically.
It's a starting point anyways.
--
Andreas Ericsson andreas.ericsson_at_op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Nov 11 2007