Mailinglist Archive: opensuse-packaging (116 mails)

< Previous Next >
Re: [opensuse-packaging] Proper way to set shebangs in singlespecs
On 12/22/2017 12:01 AM, Luciano Santos wrote:
Now, supposing that in this case we hadn't doc/example files in
python-gobject, but script files, what kind of conditionals would we
need to use to make each package use the proper python?
It would be easier if you'd say which files we are talking about. For
executables that python's setuptools installs, there is nothing to do.
if python2; then
#!/usr/bin/python2
else
#!/usr/bin/python3
endif
You can use %ifpython2/%ifpython3, which is true if the package is build
for python2/3.
https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec#Requirements_specific_for_one_python_flavor
Since the example files go both under python2-gobject's doc folder and
python3-gobject's doc folder as well, I have being thinking using something
like this (theoretically speaking):

sed -i 'python2 shebang on you'
/usr/share/doc/packages/python2-gobject/examples/*.py
sed -i 'python3 shebang on you'
/usr/share/doc/packages/python3-gobject/examples/*.py
You can do that (using %{buildroot} for the paths).

--
python programming - mail server - photo - video - https://sebix.at
cryptographic key at https://sebix.at/DC9B463B.asc and on public keyservers


< Previous Next >
Follow Ups