Problems using debuild to upload a python/GTK program to Launchpad

277 views Asked by At

[update, I found the solution, see answer below]

I made a GUI wrapper for protonvpn, a cmd program for Linux. dpkg -b gets me ProtonVPNgui.deb, which works fine. However, I have problems using debuild -S -sa to upload it to Launchpad.

  1. As is, it won't build once uploaded with dput, cf. the error msg

  2. I tried using debuild -i -us -uc -b to build a .deb file for local testing, but it returns:

    dpkg-genchanges: error: binary build with no binary artifacts found; cannot distribute

Any ideas? This whole process is driving me nuts. (I use this tar.gz)

Text

1

There are 1 answers

0
Marek Möhling On

I figured it out myself. Create a .deb package locally for testing and upload the project to Launchchpad:

  1. Create a launchpad user account.

  2. Install dh-python with the package manager

  3. Create the package source dir

    mkdir myscript-0.1

  4. Copy your python3 script(s) (or the sample script below) to the source dir (don't use !/usr/bin/python, use !/usr/bin/python3 or !/usr/bin/python2 and edit accordingly below)

    cp ~/myscript myscript-0.1

    cd myscript-0.1

    Sample script:

    #!/usr/bin/python3
    
    if __name__ == '__main__':
        print("Hello world")
    
  5. Create the packaging skeleton (debian/*)

    dh_make -s --createorig

  6. Remove the example files

    rm debian/*.ex debian/*.EX debian/README.*

  7. Add eventual binary files to include, e.g. gettext .mo files

    mkdir myscript-0.1/source

    echo debian/locales/es/LC_MESSAGES/base.mo > myscript-0.1/source/include-binaries

  8. Edit debian/control

    Replace its content with the following text:

    Source: myscript
    Section: utils
    Priority: optional
    Maintainer: Name, 
    Build-Depends: debhelper (>= 9), python3, dh-python
    Standards-Version: 4.1.4
    X-Python3-Version: >= 3.2
    
    Package: myscript
    Architecture: all
    Depends: ${misc:Depends}, ${python3:Depends}
    Description: insert up to 60 chars description
     insert long description, indented with spaces
    
  9. debian/install must contain the script(or several, python, perl, etc., also eventual .desktop files for start menu shortcuts) to install as well as the target directories, each on a line

    echo myscript usr/bin > debian/install

  10. Edit debian/rules

    Replace its content with the following text:

    #!/usr/bin/make -f
    
    %:
        dh $@ --with=python3
    

    Note: it's a TAB before dh $@, not four spaces!

  11. Build the .deb package

    debuild -us -uc

    You will get a few Lintian warnings/errors but your package is ready to be used:

    ../myscript_0.1-1_all.deb

  12. Prepare upload to Launchpad, insert your gdp fingerprint after -k

    debuild -S -sa -k12345ABC

  13. Upload to Launchpad

    dput ppa:[your ppa name]/ppa myscript_0.1-1_source.changes

This is an update to askubuntu.com/399552. It may take some error messages and googling till you're ready... C.f. the ...orig.tar.gz file at launchpad for the complete project.