Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

System packages #3

Open
2 of 4 tasks
woodruffw opened this issue Jul 25, 2017 · 8 comments
Open
2 of 4 tasks

System packages #3

woodruffw opened this issue Jul 25, 2017 · 8 comments

Comments

@woodruffw
Copy link
Member

woodruffw commented Jul 25, 2017

KBSecret currently "supports" packaging for Debian (.deb), Arch, and Red Hat (.rpm) via fpm, but these generated packages are of dubious quality and are almost certainly broken in some form or other.

It would be nice to get first-class packages for these targets (and any others). If you have any experience with packaging, please let me know!

Some notes/links:
For Debian/Ubuntu packaging:

@woodruffw
Copy link
Member Author

Added a Homebrew formula here: https://github.com/kbsecret/homebrew-kbsecret

@Celti
Copy link

Celti commented Feb 4, 2018

After poking at the pacman package generation, it seems that a key issue is that bundle overrides $GEM_HOME when building — which of course is what lets it find fpm — but fpm relies on $GEM_HOME (or at least gem env gemdir) to put the package contents in the appropriate location. This unfortunately can't be genuinely cross-platform without modification, because Arch and Debian at the least have different defaults for $GEM_HOME.

You should be able to fix this with liberal application of fpm's --prefix and --gem-bin-path flags. --gem-bin-path "/usr/bin" and --prefix "/usr/lib/ruby/gems/2.5.0" seem to generate perfectly usable pacman packages for current Arch Linux (there are a couple of issues with them containing files that would normally be stripped, and using numeric ownership instead of symbolic in the tar, but they install and run just fine).

@woodruffw
Copy link
Member Author

Thanks for the info!

I was actually planning on getting rid of the fpm packages pretty soon -- they're more or less completely broken on Debian, don't provide manpages, etc. Now that I know they (can) work well on Arch, I'll keep that target around with the changes you suggested.

@Celti
Copy link

Celti commented Feb 4, 2018

Ah — if you're just keeping fpm around for Arch, I'd instead suggest looking at how quarry handles packaging gems for Arch — or just submit a request for them to package kbsecret and not have to worry about it yourself. Their process is a bit cleaner than what fpm generates, and will be automatically available to Arch users every time a new gem is published.

@woodruffw
Copy link
Member Author

I didn't know about quarry; this looks great.

In that case, I'll be removing all of the fpm builds. Thanks again!

@woodruffw
Copy link
Member Author

Opened anatol/quarry#81

@woodruffw
Copy link
Member Author

@Celti Could you give ruby-kbsecret in quarry a try and let me know if there are any issues?

@woodruffw
Copy link
Member Author

For any future contributors, here's an initial stab at a Snapcraft config:

name: kbsecret
version: FIXME
summary: A secret manager backed by Keybase and KBFS
description: |
  KBSecret is a command line utility and Ruby library for managing secrets.
  Secrets can be structured (like login pairs and environment keys), or
  unstructured (like raw text or blobs of data). They can also be shared between
  multiple individuals or entire teams via the Keybase platform.
grade: devel
confinement: devmode

apps:
  kbsecret:
    environment:
      RUBYLIB: $SNAP/usr/lib/ruby/2.3.0:$SNAP/usr/lib/x86_64-linux-gnu/ruby/2.3.0
      GEM_HOME: $SNAP/gems
      GEM_PATH: $SNAP
    command: ruby $SNAP/bin/kbsecret

parts:
  kbsecret:
    plugin: nil
    source: git://github.com/kbsecret/kbsecret.git
    build: gem build kbsecret.gemspec
    install: gem install kbsecret-*.gem --config-file /dev/null -i $SNAPCRAFT_PART_INSTALL
    build-packages: [gcc, libc6-dev, make, ruby-dev]
    stage-packages: [ruby]

This would ideally not be tied to Ruby 2.3 and would be generated by a script, so that version could be filled in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants