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

Installer packages for linux #519

Closed
pythcoiner opened this issue May 13, 2023 · 15 comments · Fixed by #610
Closed

Installer packages for linux #519

pythcoiner opened this issue May 13, 2023 · 15 comments · Fixed by #610
Labels
Build system / Distribution Feature New feature or functionality.

Comments

@pythcoiner
Copy link
Collaborator

Should we build install packages for linux, for user can easily install liana (apt, dnf, yum, etc.... maybe snap?)
which one do you think is needed?

@darosior darosior added Feature New feature or functionality. Build system / Distribution labels May 13, 2023
@darosior
Copy link
Member

I think we could at least do a .deb and an arch package. Maybe an RPM as well?

@pythcoiner
Copy link
Collaborator Author

pythcoiner commented May 16, 2023

i made a try with .deb, i got something not bad...

which task do we need to execute prior to install the package? (only remove old versions liana binaries if present? have a check if bitcoind installed on some standard location? check if bitcoind running for some kind autosettings about the node?)

during install of package i do this:

  • copy binaries in /usr/bin/
  • copy liana logo in opt/liana/
  • build liana.desktop in /usr/share/applications/ (register to Finance and Network categories)
  • anything else to do?

do we need to do some cleanup when removing liana?

@darosior
Copy link
Member

I've never created a .deb but that looks correct. I think you need to make sure the system's got the necessary dependencies (list here) installed. Another thing is maybe installing it for the user instead of system-wide? Like in ~/.local/bin instead of /usr/local/bin and so on? Not sure. Is there any recommendation from the Debian doc?

@pythcoiner
Copy link
Collaborator Author

about the dependencies my though was they are needs at compile time, will check that.
about install the binaries into user's home folder i'll have a look on debian doc, but if i don't misunderstand, i read something that .deb installer cannot acces home folder (at least on uninstall process).

@pythcoiner
Copy link
Collaborator Author

Another thing is maybe installing it for the user instead of system-wide? Like in ~/.local/bin instead of /usr/local/bin and so on? Not sure. Is there any recommendation from the Debian doc?

I take little time looking at the debian doc about .deb packages, they don't mention locations, i think it's more about linux standards, i got a check about the app installed with apt on my ubuntu, they almost have the binaries (or symlink to the binaries) in /usr/bin.

In my mind, the home folder (~/) is reserved for user storage, i dont know if its the same thought for almost linux users?

@pythcoiner
Copy link
Collaborator Author

i'm thinking about to add a glibc version check prior to install package, i think it's a must?

@darosior
Copy link
Member

darosior commented May 20, 2023 via email

@pythcoiner
Copy link
Collaborator Author

You should be able to specify dependencies and their versions in the .deb, GLIBC is just one of them.

yes, found out that libc6 (>= 2.34) is the dependency we need

@pythcoiner
Copy link
Collaborator Author

pythcoiner commented May 21, 2023

the script i made for build .deb package is quite finnish, still some polishing to do.

what the script do:

  • check the release binaries are presents
  • ask for version trought stdin
  • fetch local architecture with dpkg-architecture
  • remove temporary folder and .deb if already present for the current arch/version
  • build a new folder tree
  • copy the binaries into the temp folder
  • copy Liana logo (used for launcher icon)
  • build the launcher file (.desktop)
  • get the size of the folder tree
  • build control file (using current version/arch/size data) (required dependencies are udev, libfontconfig1-dev, libudev-dev, libc6 (>= 2.34))
  • build the .deb file
  • cleanup

i ran (sucessfull) tests for this distros:

  • Ubuntu 22.04 ( udev might be manually installed prior .deb package)
  • Ubuntu 22.10
  • Ubuntu 23.04

i ran test on Debian 11.7 but failed because of GLIBC = 2.31, Debian 12 coming soon with upgraded GLIBC
should we find a solution for Debian < 12?

you can check the script here

@darosior
Copy link
Member

you can check the script here

Cool, i think it's a good time to open a PR. :) You can opt for a draft if it still needs some cleanups.

@pythcoiner pythcoiner mentioned this issue May 30, 2023
@pythcoiner
Copy link
Collaborator Author

pythcoiner commented Jun 7, 2023

I got an idea for Debian < 11.7:

  • craft a .deb that contains also the sources
  • require build dependencies and install the last rustup version with rustup script (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)
  • build on the user system
  • cleanup

can have one friction point: if the user already had cargo installed on his machine, the rustup install will fail

does it worth spending time on that?

@darosior
Copy link
Member

darosior commented Jun 8, 2023 via email

@a7med12h
Copy link

How did you install yum package. When ever I tried to install it it gave me unable to locate . It is mean yum not there . When type yum ... etc . It gave error which is mran yum packege not installed yet . Please help to install right if u know

@pythcoiner
Copy link
Collaborator Author

yum has not yet been implemented, only the .deb is under PR

darosior added a commit that referenced this issue Jul 13, 2023
7c3511e add script for build .deb packages (pythcoiner)

Pull request description:

  following #519

  should i locate the script in some specific location instead of at the repo root?

  is it a way in the CI workflow to automate the test for .deb installs on different versions?

ACKs for top commit:
  darosior:
    utACK 7c3511e -- can be refined and integrated into the release process in a follow-up.

Tree-SHA512: 67a5a7bd81e975a2a68a3eb195bef79a75b171270d0a3cd9ba0f8e041d320aada20749591258fe7da7c5ed03fa355143885cf22cb7cbe7a43e855c526e884840
@darosior
Copy link
Member

#610 introduces a Debian package for the next release. I think that's all we should be doing for the moment.

Of course, if people want to contribute packages for other distributions in a similar fashion that's welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build system / Distribution Feature New feature or functionality.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants