Results 1 to 2 of 2

Thread: Python package both module as well as application

  1. #1
    Join Date
    Apr 2017
    Location
    the Netherlands
    Posts
    25

    Default Python package both module as well as application

    I'm building python-srt (https://github.com/cdown/srt), which is a dependency of another package I am working on. The error I am getting is:
    Code:
    [   19s] found conflict of python36-srt-3.4.1-0.noarch with python38-srt-3.4.1-0.noarch: 
    [   19s]   - /usr/bin/srt 
    [   19s]   - /usr/bin/srt-fixed-timeshift 
    [   19s]   - /usr/bin/srt-linear-timeshift 
    [   19s]   - /usr/bin/srt-lines-matching 
    [   19s]   - /usr/bin/srt-mux 
    [   19s]   - /usr/bin/srt-normalise 
    [   19s]   - /usr/bin/srt-play 
    [   19s]   - /usr/bin/srt-process 
    [   19s] found conflict of python36-srt-3.4.1-0.noarch with python39-srt-3.4.1-0.noarch: 
    [   19s]   - /usr/bin/srt 
    [   19s]   - /usr/bin/srt-fixed-timeshift 
    [   19s]   - /usr/bin/srt-linear-timeshift 
    [   19s]   - /usr/bin/srt-lines-matching 
    [   19s]   - /usr/bin/srt-mux 
    [   19s]   - /usr/bin/srt-normalise 
    [   19s]   - /usr/bin/srt-play 
    [   19s]   - /usr/bin/srt-process 
    [   19s] found conflict of python38-srt-3.4.1-0.noarch with python39-srt-3.4.1-0.noarch: 
    [   19s]   - /usr/bin/srt 
    [   19s]   - /usr/bin/srt-fixed-timeshift 
    [   19s]   - /usr/bin/srt-linear-timeshift 
    [   19s]   - /usr/bin/srt-lines-matching 
    [   19s]   - /usr/bin/srt-mux 
    [   19s]   - /usr/bin/srt-normalise 
    [   19s]   - /usr/bin/srt-play 
    [   19s]   - /usr/bin/srt-process


    I totally understand what is causing the error and I know this wouldn't be an issue if I would package it as 'srt'. The files in /usr/bin are present in all three versions of the library, so the build throws this error. This package is both an application as well as a module, and following the documentation:

    There are some corner cases as to what is an application and what is a module - for example, many modules come with simple command-line tools that allow you to use a subset of their functionality directly. The rule of thumb is this: if this package is going to be a dependency of some other Python application, apply the naming policy, otherwise keep it just as the module name.

    Source: https://en.opensuse.org/openSUSE:Pac...#Naming_policy

    The python-srt package is a dependency of ffsubsync, which is a python application I am trying to build.

    So the problem is clear, but the solution eludes me.
    Feel free to visit my personal OBS repository: https://build.opensuse.org/project/show/home:tyrannishawk

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    31,277
    Blog Entries
    15

    Default Re: Python package both module as well as application

    Hi
    Use the update alternatives macro for each of the binaries....

    In %install;

    Code:
    ....
    %python_clone -a %{buildroot}%{_bindir}/srt*
    ....
    In %files

    Code:
    %files
    ....
    %python_alternative %{_bindir}/srt*
    ....
    If the wildcard doesn't work then you need a separate line for each binary.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •