Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package for Debian/Ubuntu #62

Closed
jonasmalacofilho opened this issue Oct 31, 2019 · 33 comments
Closed

Package for Debian/Ubuntu #62

jonasmalacofilho opened this issue Oct 31, 2019 · 33 comments
Labels
external Problem that is external to liquidctl linux Linux users are particularly affected

Comments

@jonasmalacofilho
Copy link
Member

jonasmalacofilho commented Oct 31, 2019

Help get liquidctl in Debian, Ubuntu and distros derived from them.

I need some volunteers...

@jonasmalacofilho
Copy link
Member Author

The best route is probably to request and then work on a package for Debian, that is, a package that will eventually be part of Debian (and, as a result, Ubuntu and other Debian compatible or based distros).

You can start by:


An alternative would be for someone to setup and maintain a Ubuntu PPA for liquidctl.

@keton
Copy link
Contributor

keton commented Nov 10, 2019

@jonasmalacofilho is there a dependency list for liquidctl? It will be super helpful for checking if given python package/library is already packaged for given distribution or should we package it as well.

@jonasmalacofilho
Copy link
Member Author

jonasmalacofilho commented Nov 10, 2019

The Python dependencies are specified in setup.py

    install_requires=['docopt', 'pyusb', 'hidapi', 'appdirs'],

but Linux packages may also need pkg_resources.

This is a common Python packaging problem when script entries are used, and is caused by setup.py install generating the executable entry point with a dependency to the pkg_resources Python module:

$ cat `which liquidctl`
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'liquidctl==1.3.0rc1','console_scripts','liquidctl'
__requires__ = 'liquidctl==1.3.0rc1'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('liquidctl==1.3.0rc1', 'console_scripts', 'liquidctl')()
    )

Anyway, this is all standard Python packaging stuff, so if this extra dependency is needed on Debian should™ be documented somewhere. Alternatively you could check if pkg_resources is already part of the Debian python3 distribution.


The runtime dependencies are libusb and HIDAPI, though whether or not these need to be explicitly required can vary:

  • does the pyusb package already depend on libusb?
  • does the cython-hidapi package (the one for the Python wrapper of HIDAPI) already depend or include HIDAPI?

@jonasmalacofilho
Copy link
Member Author

jonasmalacofilho commented Nov 10, 2019

Update for Debian testing/Bullseye:

For the HIDAPI wrapper there is python3-hidapi, but it's a different and less known module (upstream: jbaiter/hidapi-cffi).

Assuming it works, liquidctl could be adapted to support it (or maybe even switched to it), but it would be good if we had the option of sticking with cython-hidapi.


Even though the Debian Python packaging docs don't mention it, pkg_resources does appear to be an additional dependency.1 You could also contribute this fix to the Debian Wiki.

@keton
Copy link
Contributor

keton commented Nov 10, 2019

For Ubuntu 19.10:

Hidapi is the correct package see Homepage entry.
It seems like a better target for the first attempts.

EDIT: for debian try: https://packages.debian.org/bullseye/python3-hid and look at source package .dsc file it seems to be a correct version too.

@jonasmalacofilho
Copy link
Member Author

You're right, it's the correct one. I just wish the packages had more consistent names...

For example:

  • the source package for python3-hid is... python-hidapi
  • the source package for python3-hidapi is... hidapi-cffi
  • python-hidapi is also the name of the binary package for hidapi-cffi × python2

@keton
Copy link
Contributor

keton commented Nov 14, 2019

I've got to the point where .deb builds on Ubuntu eoan. Same metadata should be good for any recent Ubuntu and Debian versions.

git clone -b add-debian-packaging git@github.com:keton/liquidctl.git
cd liquidctl
# install build dependencies
sudo apt install $(dpkg-checkbuilddeps 2>&1 | grep error | cut -d':' -f 4 )
# do build
dpkg-buildpackage -g --no-sign
#install resulting package
sudo apt install ../python3-liquidctl_1.3.0-1_all.deb

now sudo liquidctl initialize should work.

I've also set up test PPA here: https://launchpad.net/~keton22-gmail/+archive/ubuntu/liquidctl-test-ppa

sudo add-apt-repository ppa:keton22-gmail/liquidctl-test-ppa
sudo apt update
sudo apt install python3-liquidctl

Now I need to figure out how to setup similar repo for Debian.

@jonasmalacofilho
Copy link
Member Author

jonasmalacofilho commented Nov 14, 2019

That's great, thanks!

Can you use DIST_NAME and DIST_PACKAGE to customize the output from --version during the package creation? It might help me when dealing with bug reports...

  • DIST_NAME can be something like <Ubuntu|Debian> <version> (/etc/os/release might help)
  • DIST_PACKAGE can be the complete distro package name, including version, release, etc. (e.g. python3-liquidctl_1.3.0-1_all)
  • you can use the PKGBUILD for ArchLinux/git as a reference

You also probably need to include a man page; you find it in liquidctl-1.3.0rc1.tar.gz/liquidctl.8. I've made some improvements to it since, but if you still find any errors please let me know (and/or open a pull request).

Thanks again!

@jonasmalacofilho
Copy link
Member Author

jonasmalacofilho commented Nov 14, 2019

Oh, and I think you might need to split the package into two:

  • python3-liquidctl: Python library
  • liquidctl: /usr/bin/liquidctl, man page

I didn't see this requirement in the Debian docs, but take a look at flake8. I also know that Fedora has this requirement (it's a common approach).

@jonasmalacofilho
Copy link
Member Author

I just released 1.3.0; note that appdirs is no longer a dependency.

@jonasmalacofilho
Copy link
Member Author

Besides the changes/fixes listed above (which will probably be required for the package to be accepted), you can look into opening a RFP (and possibly also a ITP, since you'd be working on it).

@jonasmalacofilho
Copy link
Member Author

I'm available/ready to assist you.

But besides the few changes above that I know (or at least think) are necessary, I'm not sure what else has to be done. This is why I think it's time to open the RFP (and the ITP), and get some proper feedback.

I haven't taken charge on either because I'm not a Debian user on the desktop.¹ I would either ask them to create a package I wouldn't use, or endlessly bother them with stupid questions because I'm not familiar with the distro.


¹ I've been running Arch on the desktop for several years. I run Ubuntu on servers and on containers, but mostly either using official packages or stuff we build/deploy with external tools.

@jonasmalacofilho
Copy link
Member Author

Great, thanks!

@jonasmalacofilho
Copy link
Member Author

Hi @David-Frick, did you make any progress?

@jonasmalacofilho
Copy link
Member Author

Hi!

The Debian docs are not the best! I am actually reading over the arch linux docs regarding how they do it to get a better idea and come back to debian. I am sorry I have not kept in touch, it has been pouring rain (in winter of all times) and I got super sick :(

Yeah, I have to admit I still have a few questions myself about how Debian's WNNP bugs work.

I am going to jot up notes and do it first thing tomorrow. One question: I upgraded to Debian unstable (sid). Would this affect how the package is maintained? I would assume so! I can always go back to good, regular Debian if need be.

Actually, I think that new packages have to go to unstable anyway, at least until the next Debian stable release. But I could be totally wrong about this. It's just that I'm no used to seeing recent software packages on Debian stable.

@jonasmalacofilho
Copy link
Member Author

@David-Frick I still can't seem to find the ITP. Did you get the email?

@jonasmalacofilho
Copy link
Member Author

Also, feel free to C/C when necessary.

@jonasmalacofilho
Copy link
Member Author

I am having some issues with Debian overall as sddm of kde decided to not want to work with my monitor anymore even on stable (buster).

You might have more luck with debian unstable (and more up-to-date software), assuming you're running new-ish hardware.

Can KDE Neon or even Ubuntu make Debian packages to be released on Debian because I mihht need to switch.

I would assume so, though some care might be necessary when testing or debugging, since they might be running different versions of dependencies and have slightly different default configurations.

@jonasmalacofilho
Copy link
Member Author

jonasmalacofilho commented Dec 31, 2019

Thanks for the update... I'll also see who I know that's already involved in Debian and can help.


I'm glad that you managed to fix your issues with sid.

@jonasmalacofilho
Copy link
Member Author

No news on my end.

@Frick-David, filling the ITP requires you to send an email right? Maybe it has to be plain-text only?

@jonasmalacofilho
Copy link
Member Author

Thanks!

@jonasmalacofilho
Copy link
Member Author

I'm not sure, but I'll take a look. Thanks.

@jonasmalacofilho jonasmalacofilho self-assigned this Jan 31, 2020
@jonasmalacofilho
Copy link
Member Author

That would be great!

@jonasmalacofilho jonasmalacofilho removed their assignment Feb 7, 2020
@ghost
Copy link

ghost commented Feb 27, 2020

I cleaned up my comments for a potential future user who has more success to see the base issue and not my clutter. To summarize all my comments, to submit an intent to package, simply using the reportbug program and follow through with the prompts and options. The documentation for that is found here: https://www.debian.org/devel/wnpp/
Unfortunately, I do not seem to get any error messages or any emails back despite using multiple emails and different attempts with different names, etc etc, despite the form being filled out pretty thoroughly. Similarly, I filled out one directly by email with no response. I have even @ed a Debian team member without hearing back.
I am unsure of why this is, and it is a bit of a let down, because I have had nothing but positive things to say about Debian up until now. I have no reason to believe it is an issue on my end, but it is possible. I hope someone can give this a shot in the near future, keep me posted, and hopefully they have more luck!

The process is as follows:
Run sudo apt-get install reportbug
Run reportbug --email username@domain.tld wnpp
And walk through the prompts. We want an ITP (intent to package).
Do not remember the exact order of the prompts, but you will fill out
type of package (we want an ITP (intent to package)), a form that has the information of the package: It will ask for the same type data here:
https://aur.archlinux.org/packages/liquidctl/ (version number ,package name, etc)
and some other pretty straight forward questions.
It will probably ask if the package is similar to a bunch of others and give you a super long list. One the keys skips that part (none of them are).

Overall, it is pretty straightforward and should not take longer than 10, 15 minutes, if that. After that a Debian team member (fingers crossed) should contact you about maintaining the package. It seems like a good topic to learn as it involves building the package, and keeping it up to date with the git repo for Debian Users. If you are looking to learn how Linux, Debian, and I would assume Systemd works, this is a great opportunity to learn some cool, neat stuff. You can even help out with other projects that you really like and want to help others with (Yay! Very nice!)

@jonasmalacofilho might I suggest deleting comments to get this more to the top for other people to see.

@jonasmalacofilho
Copy link
Member Author

Hi, @Frick-David

Sorry for not replying to you sooner. I was going to try reportbug myself to see if anything came to mind, but a few other things popped up and I haven't found the time for it yet. I'll keep you updated on any progress I make.


Instead of deleting previous comments, I'll just link to that last one from the top post.

@ghost
Copy link

ghost commented Feb 28, 2020 via email

@jonasmalacofilho
Copy link
Member Author

I would like to have liquidctl 1.5 in Debian 11 (Bullseye) and Ubuntu 21.04.

The schedule is a bit tight though, since both will start their feature freezes in early February. So we should probably get 1.4.2 packaged before that, only requiring a quick update after 1.5.

@MarshallAsch, do you by any chance have any experience with this?

@jonasmalacofilho jonasmalacofilho added this to the v1.5.0 milestone Nov 26, 2020
@MarshallAsch
Copy link
Member

Unfortunately I do not, I have never created a distro package before.

@jonasmalacofilho
Copy link
Member Author

jonasmalacofilho commented Dec 25, 2020

@jonasmalacofilho jonasmalacofilho modified the milestone: v1.5.0 Jan 6, 2021
@jonasmalacofilho
Copy link
Member Author

RFP converted into an ITP (someone is working on it). In fact, it should soon be in Debian:

Packaged and going to upload it soon.
László Böszörményi (GCS) gcs@debian.org

@jonasmalacofilho jonasmalacofilho added the external Problem that is external to liquidctl label Jan 21, 2021
@mattiasghodsian
Copy link

Update for ubuntu ?

@jonasmalacofilho
Copy link
Member Author

Ubuntu automatically takes packages from Debian unstable prior to the Debian Import Freeze date. For Ubuntu 21.04 Hirsute hippo, that date is 25 February. So as long as liquidctl reaches Debian unstable by then, it should arrive in Ubuntu 21.04 automatically.

That said, you could try reaching out to some of Ubuntu's devs to see if there's another (more direct) way to get liquidctl into Ubuntu.

And you could also contact the developers working on the Debian package and see if you can help in some way. I'm also available to assist (you and any Debian or Ubuntu developers).

@jonasmalacofilho
Copy link
Member Author

Hurray, now available as:

  • liquidctl on the Debian sid/unstable repository
  • liquidctl on the Ubuntu Hirsute Hippo (future 21.04) repository

Other useful links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Problem that is external to liquidctl linux Linux users are particularly affected
Projects
None yet
Development

No branches or pull requests

4 participants