eduvpn / python-eduvpn-client

Linux client for eduVPN
https://eduvpn.org/
GNU General Public License v3.0
39 stars 38 forks source link

Add Support for openSUSE #565

Closed winkloid closed 8 months ago

winkloid commented 9 months ago

Currently, eduVPN is not supported for openSUSE, although openSUSE is a widely used Linux distribution, especially in Germany. I've already tried to install it using the Fedora RPM repository, but this required dependencies that didn't match the packages provided by the openSUSE repository. Since you indicate on your installation page that users of non-supported Linux distributions can open a feature request to see if a suitable package can be provided, I have opened this issue.

jwijenbergh commented 9 months ago

could you try: https://github.com/eduvpn/python-eduvpn-client/issues/564#issuecomment-1878428043

if that works, I will document this

winkloid commented 9 months ago

Unfortunately this did not work. The command python -m pip install "eduvpn-client[gui]" gives me this error:

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try
    zypper install python311-xyz, where xyz is the package
    you are trying to install.

    If you wish to install a non-rpm packaged Python package,
    create a virtual environment using python3.11 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.

    If you wish to install a non-rpm packaged Python application,
    it may be easiest to use `pipx install xyz`, which will manage a
    virtual environment for you. Install pipx via `zypper install python311-pipx` .

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

So I tried to setup a virtual environment and after this did not work either I tried to use pipx. I was able to install eduvpn in both, the venv and pipx, but when I try to run eduvpn-gui I get the following error in both cases:

Traceback (most recent call last):
  File "/home/winkloid/.local/bin/eduvpn-gui", line 5, in <module>
    from eduvpn.ui.__main__ import eduvpn
  File "/home/winkloid/.local/share/pipx/venvs/eduvpn-client/lib64/python3.11/site-packages/eduvpn/ui/__main__.py", line 13, in <module>
    from eduvpn.ui.app import EduVpnGtkApplication
  File "/home/winkloid/.local/share/pipx/venvs/eduvpn-client/lib64/python3.11/site-packages/eduvpn/ui/app.py", line 13, in <module>
    from eduvpn import i18n, notify
  File "/home/winkloid/.local/share/pipx/venvs/eduvpn-client/lib64/python3.11/site-packages/eduvpn/notify.py", line 3, in <module>
    gi.require_version("Notify", "0.7")  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/winkloid/.local/share/pipx/venvs/eduvpn-client/lib64/python3.11/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Notify not available

I was not able to resolve the Notify dependency yet.

jwijenbergh commented 9 months ago

Which opensuse version are you using?

winkloid commented 9 months ago

I am using openSUSE tumbleweed, currently with kernel version 6.6.11-1

jwijenbergh commented 9 months ago

Try to install typelib-1_0-Notify-0_7

holzingk commented 9 months ago

Somebody already put some effort into this, but it is outdated. I assume updating it is not that hard, and could potentially be accepted in Tumbleweed. https://build.opensuse.org/package/show/home:brassh/python-eduvpn-client

Edit: Official rpms seems to be built from a set of scripts by fkooman.

jwijenbergh commented 9 months ago

Hi fkooman is a colleague of mine, the updated packaging is here https://git.sr.ht/~jwijenbergh/python-eduvpn-client.rpm/tree/main/item/SPECS/python-eduvpn-client.spec

last time I checked opensuse needed some changes

winkloid commented 8 months ago

Try to install typelib-1_0-Notify-0_7

Sorry for my late reply, I have been quite busy during the last couple of weeks. I installed the package and managed to get eduvpn to open a window. But there is also an error window which is shown directly after eduvpn fetched the server list: Screenshot_20240224_151437

Besides, I get the following terminal output: keyring not available due to import not available

I already tried to inject keyring into the pipx instance which runs eduvpn-gui (pipx inject eduvpn-client keyring), tried to install it globally for all pipx environments (pipx install keyring) and tried to install it globally for my OS using sudo zypper in python311-keyring but I couldn't get rid of the error message.

winkloid commented 8 months ago

Hi fkooman is a colleague of mine, the updated packaging is here https://git.sr.ht/~jwijenbergh/python-eduvpn-client.rpm/tree/main/item/SPECS/python-eduvpn-client.spec

last time I checked opensuse needed some changes

Unfortunately, this doesn't really help me because I would like to have an easy way to update the packages without building it from scratch everytime when there is a new version. Nevertheless I gave it a try and tried to build the rpm package using the given specification, but since this specification is not written for openSuse Tumbleweed there are some packages that cannot be installed without using thirdparty repos which I would like to prevent as much as possible. grafik

jwijenbergh commented 8 months ago

Try to install typelib-1_0-Notify-0_7

Sorry for my late reply, I have been quite busy during the last couple of weeks. I installed the package and managed to get eduvpn to open a window. But there is also an error window which is shown directly after eduvpn fetched the server list: Screenshot_20240224_151437

Besides, I get the following terminal output: keyring not available due to import not available

I already tried to inject keyring into the pipx instance which runs eduvpn-gui (pipx inject eduvpn-client keyring), tried to install it globally for all pipx environments (pipx install keyring) and tried to install it globally for my OS using sudo zypper in python311-keyring but I couldn't get rid of the error message.

you need to install libsecret or libsecret-1-0, and need to install a keyring such as gnome-keyring

Hi fkooman is a colleague of mine, the updated packaging is here https://git.sr.ht/~jwijenbergh/python-eduvpn-client.rpm/tree/main/item/SPECS/python-eduvpn-client.spec last time I checked opensuse needed some changes

Unfortunately, this doesn't really help me because I would like to have an easy way to update the packages without building it from scratch everytime when there is a new version. Nevertheless I gave it a try and tried to build the rpm package using the given specification, but since this specification is not written for openSuse Tumbleweed there are some packages that cannot be installed without using thirdparty repos which I would like to prevent as much as possible. grafik

Yes, this is exactly we are not simply packaging for this distro. The eduvpn-common package can be built from here: https://git.sr.ht/~jwijenbergh/python3-eduvpn-common.rpm. Minisign is needed for the verification of signatures, you may switch to gpg and verify with key https://app.eduvpn.org/linux/v4/deb/app+linux@eduvpn.org.asc. pytest-runner might be skipped as you can skip the tests if you want

winkloid commented 8 months ago

you need to install libsecret or libsecret-1-0, and need to install a keyring such as gnome-keyring

Unfortunately, I still didn't have success with this. libsecret-1-0 ist already installed and I am using kwallet which is already working seamlessly with other applications. So maybe there is another problem related importing from gi.repository which you use inside of your keyring.py, but I wan't able to find out the reason yet. I also checked again, which of the dependencies listed for Fedora can be resolved on my system. The only dependency which cannot be resolved yet is cairo-gobject-devel. Could this be a reason for this problem?

jwijenbergh commented 8 months ago

you need to install libsecret or libsecret-1-0, and need to install a keyring such as gnome-keyring

Unfortunately, I still didn't have success with this. libsecret-1-0 ist already installed and I am using kwallet which is already working seamlessly with other applications. So maybe there is another problem related importing from gi.repository which you use inside of your keyring.py, but I wan't able to find out the reason yet. I also checked again, which of the dependencies listed for Fedora can be resolved on my system. The only dependency which cannot be resolved yet is cairo-gobject-devel. Could this be a reason for this problem?

what does the log say about this? ~/.config/eduvpn/log

The only dependency which cannot be resolved yet is cairo-gobject-devel. Could this be a reason for this problem?

no, I don't think so

winkloid commented 8 months ago

what does the log say about this? ~/.config/eduvpn/log

The log file is completely empty, only the state.json contains the fetched server list after eduvpn has been executed.

jwijenbergh commented 8 months ago

in a python3 shell, please execute:

>>> import gi
>>> gi.require_version("Secret", "1")
>>> from gi.repository import Secret

And give me the output

winkloid commented 8 months ago
Python 3.11.8 (main, Feb 08 2024, 08:03:16) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version("Secret", "1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.11/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Secret not available
>>> from gi.repository import Secret
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.11/site-packages/gi/importer.py", line 133, in create_module
    raise ImportError('cannot import name %s, '
ImportError: cannot import name Secret, introspection typelib not found
>>>
jwijenbergh commented 8 months ago

maybe you need Typelib-1_0-secret-1

winkloid commented 8 months ago

Thank you so much! This worked and EduVPN is starting without any errors now. The actual name of the package was typelib-1_0-Secret-1 on my distro.

holzingk commented 8 months ago

Can you share your current spec file? Would be really great to have it on OBS.

jwijenbergh commented 8 months ago

Thank you so much! This worked and EduVPN is starting without any errors now. The actual name of the package was typelib-1_0-Secret-1 on my distro.

Great that it works! Would you have a complete package list that you needed to install so I can document it?

Can you share your current spec file? Would be really great to have it on OBS.

See https://git.sr.ht/~jwijenbergh/python-eduvpn-client.rpm/

And

https://git.sr.ht/~jwijenbergh/python3-eduvpn-common.rpm/

Let me know if there are any questions.

winkloid commented 8 months ago

Great that it works! Would you have a complete package list that you needed to install so I can document it?

Of course! I installed eduVPN on another device running on openSuse just now to create an overview of all commands needed to get eduVPN working on openSuse tumbleweed:

Install general dependencies - these are not the exact package names, but openSuse is able to resolve the right packages from these names:

sudo zypper install \
    libnotify \
    libsecret \
    gtk3 \
    python3-gobject \
    python3-pytest \
    python3-cairo-devel \
    gobject-introspection-devel

Install typelib dependencies:

sudo zypper install \
    typelib-1_0-Notify-0_7 \
    typelib-1_0-Secret-1 \
    typelib-1_0-Gtk-3_0

Install pipx and install eduvpn-gui using pipx:

sudo zypper in python3-pipx
pipx install "eduvpn-client[gui]"

P.S.: Since I think it might not be trivial to everyone, I also suggest to add instructions on how to add a desktop file for the python version of eduVPN so that it can be started directly from the taskbar.

winkloid commented 8 months ago

Can you share your current spec file? Would be really great to have it on OBS.

In the end, I didn't build an RPM by myself because of the problems mentioned before:

Nevertheless I gave it a try and tried to build the rpm package using the given specification, but since this specification is not written for openSuse Tumbleweed there are some packages that cannot be installed without using thirdparty repos which I would like to prevent as much as possible. grafik

So, unfortunately, I am not able to share a working spec file with you.

jwijenbergh commented 8 months ago

Great that it works! Would you have a complete package list that you needed to install so I can document it?

Of course! I installed eduVPN on another device running on openSuse just now to create an overview of all commands needed to get eduVPN working on openSuse tumbleweed:

Install general dependencies - these are not the exact package names, but openSuse is able to resolve the right packages from these names:

sudo zypper install \
    libnotify \
    libsecret \
    gtk3 \
    python3-gobject \
    python3-pytest \
    python3-cairo-devel \
    gobject-introspection-devel

Install typelib dependencies:

sudo zypper install \
   typelib-1_0-Notify-0_7 \
   typelib-1_0-Secret-1 \
   typelib-1_0-Gtk-3_0

Install pipx and install eduvpn-gui using pipx:

sudo zypper in python3-pipx
pipx install "eduvpn-client[gui]"

P.S.: Since I think it might not be trivial to everyone, I also suggest to add instructions on how to add a desktop file for the python version of eduVPN so that it can be started directly from the taskbar.

I have documented this: 34a40bf4133ef177faa82d2a466acb428b3ad10d

Thanks a lot!

winkloid commented 8 months ago

Thank you for documenting the installation steps. I closed the issue because it has been solved. Thanks again!

Deeds87 commented 6 months ago

Is there something wrong with this package ( https://build.opensuse.org/project/show/home:reneum ) as a one-click solution?

reneum commented 5 months ago

Hi everyone, yes feel free to use these packages. It's my home repository and an early attempt to contribute to openSUSE. I'm currently familiarizing myself with rpm and the openSUSE packaging guidelines, but the packages are an exact copy of my own institutional non-public openbuildserver (internal deployment esp. non-free software). I work as a sysop at LMU Munich and about 100 of my computers are currently using this package. That means, the personal need will not be gone in the near future... Please do not hesitate to contact me if there is anything wrong with this package.

holzingk commented 5 months ago

@reneum As someone working at another excellent university in Munich, I am interested having this in Tumbleweed repos. Do you know the necessary missing steps to achieve this?

reneum commented 5 months ago

You mean howto add? If you follow the link above, you will get an overview against which openSUSE flavors are addressed (build results on the right side). Tumbleweed is also included.

In case you trust the repo:

# Add repo with less prio. than default openSUSE repo and incl. 'autorefresh=1'
zypper addrepo -f --priority=100 https://download.opensuse.org/repositories/home:reneum/openSUSE_Tumbleweed/home:reneum.repo
zypper refresh
zypper install eduvpn-client

For further or different detail openSUSE questions I would recommend to meet in the official community forum. https://forums.opensuse.org/ (to keep this issue clear)

holzingk commented 5 months ago

My question referred to the process of including the package in official Tumbleweed and Leap repositories.

reneum commented 5 months ago

Sorry, my mistake. That's indeed what I plan next (after I sorted all important things out). https://en.opensuse.org/openSUSE:How_to_contribute_to_Factory#How_to_add_a_new_package_to_Factory https://www.suse.com/suse-defines/definition/opensuse-factory/

Deeds87 commented 5 months ago

Hey guys, what do you think about a flatpak version instead? Greets from FH Osnabrück