Changing the Package Your BlueJeans Came in

Recently my company decided to move from WebEx to BlueJeans for conferencing. While they do provide linux support, such support is limited to RPM-based systems.

I can sympathize with this because although RPM spec is an antique format with plenty of arcane customs and traditions, if you start the day with a goal to create an RPM and your app is not too complex, you will have an RPM at the end of the day if not sooner. Replace RPM with deb and you will likely find yourself lost in a world you never knew existed. At the end of the day if you have a deb it means you're already a debian monk or are ready to become such.

The BlueJeans app itself 'seems' to be just another electron app or similar. Thus, adapting it to a deb-based system turned out to be trivial with a little alien magic. Here's the salt state I used:

{%- set bj_full_ver = '1.37.22' %}
{%- set bj_part_ver = bj_full_ver.rsplit('.', 1)[0] %}
{%- set bj_rpm = 'bluejeans-{}.x86_64.rpm'.format(bj_full_ver) %}

bluejeans-deps:
  pkg.installed:
    - name: BlueJeans deps
    - pkgs:
      - libgconf-2-4
      - libudev-dev
  file.symlink:
    - name: /lib/x86_64-linux-gnu/libudev.so.0
    - target: /lib/x86_64-linux-gnu/libudev.so
    - require:
      - pkg: bluejeans-deps

bluejeans-get:
  cmd.run:
    - name: wget https://swdl.bluejeans.com/desktop/linux/{{ bj_part_ver }}/{{ bj_full_ver }}/{{ bj_rpm }} --output-document /tmp/{{ bj_rpm }}
    - unless:
      - dpkg -l bluejeans
bluejeans-convert:
  cmd.run:
    - name: alien --keep-version --scripts /tmp/{{ bj_rpm }}
    - cwd: /tmp
    - onchanges:
      - cmd: bluejeans-get
bluejeans-install:
  cmd.run:
    - name: dpkg --install /tmp/bluejeans_{{ bj_full_ver }}-1_amd64.deb
    - onchanges:
      - cmd: bluejeans-get
    - require:
      - cmd: bluejeans-convert
bluejeans-clean:
  cmd.run:
    - name: rm --force /tmp/bluejeans-*
    - onchanges:
      - cmd: bluejeans-get
    - require:
      - cmd: bluejeans-install

While this gets the job done, it's not very elegant, and in these modern times one expects packages to either bundle into the base package repo that comes with the distro or come out of a gpg-signed app repo. A bare package URL is kind of amateur especially considering how easy it is to setup a repo (createrepo ftw). Also a debian repo is not too hard to setup once you invest the time to learn. But I'm willing to admit to being a DevOps engineer with smug opinions about how the world should function.

Posted: | Source