Rocket.chat.electron: Create RPM package

Created on 25 Aug 2015  ·  36Comments  ·  Source: RocketChat/Rocket.Chat.Electron

Some of us run fedora and other RHEL based distros :)

I'll take a look at this. Might be able to help implement.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

linux

Most helpful comment

I completely rewrote most of the previous SPEC file to be more inline with what the Ubuntu release was doing, Including the gulp release packaging into a single binary.

The main reason I did this was because I noticed spell-checking works on Ubuntu, but not Fedora. I'm a horrible speller, so I _really_ wanted spellchecker to work. I figured that if I could get gulp release to build, perhaps I could get it to bring in the necessary components in their proper places so I'd stop getting "Spellchecker unsupported" Sadly I could not get this to work even after attempting to step through module.js and path.js but IANAJSD (I am not a JS dev) so feel free to help me out here.

One unforeseen benefit of doing it this way though is that there aren't duplicate icons on the taskbar/panel anymore. Before there was the launcher icon to start the program, and then a generic "X" icon after it started. Now since being packaged into the binary, it stays attached to the same icon/task.

The build information:

  1. COPR Repo: https://copr.fedorainfracloud.org/coprs/xenithorb/rocketchat-dev/
  2. List of differences between @1dot75cm's: https://github.com/opsech-io/opsech-rocket.chat.electron-copr/commit/2b4847c8f80ad5b0d28cd3f49d3eca747c2ae998
  3. Raw SPEC file: https://raw.githubusercontent.com/opsech-io/opsech-rocket.chat.electron-copr/master/SPECS/rocketchat.spec

One possible drawback to doing it this way though is that the COPR build is self-referential, and it requires that I make sure electron is built before rocketchat manually. (Because the build environment installs electron in order to build the final release package)

Key notable points on the spec file are:

  1. https://github.com/opsech-io/opsech-rocket.chat.electron-copr/blob/master/SPECS/rocketchat.spec#L41 - I am essentially modifying the linux.js file to remove the final .deb build and cleanup function. This has the intended benefit of leaving behind the build artifacts so that we can use rpmbuild to package them up traditionally. This way we end up with rocketchat and rocketchat-libs packages. Electron is thus a build requirement but not a runtime requirement.
  2. https://github.com/opsech-io/opsech-rocket.chat.electron-copr/blob/master/SPECS/rocketchat.spec#L58#L60 - This was my last attempt (among many others) to get spellchecker to work properly. Before the build happens, I verified that spellchecker is inside app/node_modules/ alongside fs-jetpack. The package.json file also has spellchecker added as a dependency. No idea why it doesn't work. Someone from the team please mock build this yourself and try to find out.
  3. I don't write SPECs very often, so I'm probably doing some strange or unorthadox things, so feel free to correct that, thanks.
  4. Updated to 1.3.1 and electron 0.37.8 - regarding electrion, this was the latest version I could get to work, the ABI seems to have changed afterwards since they moved to the 1.x.x branch.

All 36 comments

What about .deb package? :-)

@rockneverdies55 looks like .deb is already in there ;-)

Ah yes, my bad. Sorry about that.

What we do need a RPM package too.

I think all you need to do is run release on a Redhat machine.

Nopes.. my mistake. Maybe something we can add and PR back to the szwacz/electron-boilerplate

I've just compiled it on Arch linux without problems. :)
Just grab the tar.gz and follow the instructions on the README

The only issue is the start method, the application launches with npm start within the source folder... a bit ugly

+1
would be great if an rpm was included with the official binary releases.

+1

Open Build Service can help to build RPM packages for popular distros:

http://build.opensuse.org

Thanks @ciroiriarte

@RocketChat/core maybe we could use this for the server side too?

rpm repository: https://copr.fedorainfracloud.org/coprs/mosquito/rocketchat/

$ sudo dnf install rocketchat
$ rocketchat

hi @1dot75cm, this looks awesome! Would you like to become a contributor and help us build the official distribution?

Yes, I'd like to. Build rpm need to modify tasks/release/linux.js.

@1dot75cm do you know what needs to be modified? If you need quick help hit me up on the demo server: https://demo.rocket.chat/direct/aaron.ogle we all hangout there.

I just fixed this issue. https://github.com/RocketChat/Rocket.Chat.Electron/pull/152
Please review @geekgonecrazy @engelgabriel

@1dot75cm Can you possibly take a look at getting spellcheck to work in the Fedora build?

It was reported by @geekgonecrazy that this is already working in the official ubuntu build.

Thanks :)

I completely rewrote most of the previous SPEC file to be more inline with what the Ubuntu release was doing, Including the gulp release packaging into a single binary.

The main reason I did this was because I noticed spell-checking works on Ubuntu, but not Fedora. I'm a horrible speller, so I _really_ wanted spellchecker to work. I figured that if I could get gulp release to build, perhaps I could get it to bring in the necessary components in their proper places so I'd stop getting "Spellchecker unsupported" Sadly I could not get this to work even after attempting to step through module.js and path.js but IANAJSD (I am not a JS dev) so feel free to help me out here.

One unforeseen benefit of doing it this way though is that there aren't duplicate icons on the taskbar/panel anymore. Before there was the launcher icon to start the program, and then a generic "X" icon after it started. Now since being packaged into the binary, it stays attached to the same icon/task.

The build information:

  1. COPR Repo: https://copr.fedorainfracloud.org/coprs/xenithorb/rocketchat-dev/
  2. List of differences between @1dot75cm's: https://github.com/opsech-io/opsech-rocket.chat.electron-copr/commit/2b4847c8f80ad5b0d28cd3f49d3eca747c2ae998
  3. Raw SPEC file: https://raw.githubusercontent.com/opsech-io/opsech-rocket.chat.electron-copr/master/SPECS/rocketchat.spec

One possible drawback to doing it this way though is that the COPR build is self-referential, and it requires that I make sure electron is built before rocketchat manually. (Because the build environment installs electron in order to build the final release package)

Key notable points on the spec file are:

  1. https://github.com/opsech-io/opsech-rocket.chat.electron-copr/blob/master/SPECS/rocketchat.spec#L41 - I am essentially modifying the linux.js file to remove the final .deb build and cleanup function. This has the intended benefit of leaving behind the build artifacts so that we can use rpmbuild to package them up traditionally. This way we end up with rocketchat and rocketchat-libs packages. Electron is thus a build requirement but not a runtime requirement.
  2. https://github.com/opsech-io/opsech-rocket.chat.electron-copr/blob/master/SPECS/rocketchat.spec#L58#L60 - This was my last attempt (among many others) to get spellchecker to work properly. Before the build happens, I verified that spellchecker is inside app/node_modules/ alongside fs-jetpack. The package.json file also has spellchecker added as a dependency. No idea why it doesn't work. Someone from the team please mock build this yourself and try to find out.
  3. I don't write SPECs very often, so I'm probably doing some strange or unorthadox things, so feel free to correct that, thanks.
  4. Updated to 1.3.1 and electron 0.37.8 - regarding electrion, this was the latest version I could get to work, the ABI seems to have changed afterwards since they moved to the 1.x.x branch.

Some bad news gents.

I asked @geekgonecrazy last week on Tuesday to add me to the OpenSUSE build system as a maintainer so that I could begin working on the RPM package. I didn't get to it until yesterday, and what I've learned does not bode well for Rocket.Chat.Electron on OBS, or any other electron-based client for that matter (to include atom itself) (and to include never being packaged officially for Fedora (or therefore RHEL) due to the below ticket and legal restrictions)

As it turns out, OBS, like Fedora Koji, does not permit network access during the build process. For the similar reasons stated here: https://bugzilla.redhat.com/show_bug.cgi?id=atom It will always probably be too daunting and prohibitive to have official distribution packages, and/or build packages in build-systems that disallow network access.

This is of course due to the gigantic mess that we know of as nodejs and npm. For each nodejs dependency, it would require its own nodejs-* package, which is a rabbit hole I'm not willing to travel down.

I scoured OBS looking for a better example, something, maybe of someone packaging electron-based apps, and I found nothing of use. Every one was disabled, failed, etc. This includes even Atom itself, which has an interesting inclusion, here: https://build.opensuse.org/package/show/home:dubkat/atom

Here you will find the tools to build atom yourself, as it cannot be built by obs.

I believe at this point the only way forward is to use the gulp release scripts and distribute the .rpms alongside the .deb [ I'd also like to insert a quip here about having a "linux" button on your homepage and it only pointing to .deb packages. Ubuntu != All Linuxes, have an "Ubuntu" button if you want to do that or also serve RPMs ] This has been outlined and improved in #152

@xenithorb thanks for the detailed update. I see some companies hosting their own packages repo, like MongoDB. Can we do something like that?

https://docs.mongodb.com/master/tutorial/install-mongodb-on-ubuntu/?_ga=1.108716610.1587347083.1465824520

Has anyone been able to run rocketchat on fedora 24?

Yes I'm doing it right now. Sorry for the coincidence/inconvenience, but my xenithorb/rocketchat-dev COPR build is failing specifically just for F24 due to: https://bugzilla.redhat.com/show_bug.cgi?id=1339284

If you go grab the f23 build artifact RPM it will likely work. Also you can use my fork from: https://github.com/xenithorb/Rocket.Chat.Electron/tree/rpm-updated and use the "npm run release" to build the rpm package straight from source

Hi!, going with the nodejs-* packages is the way to go when building RPM
packages. There are many of them built already, you can either import the
repositories that provide them or just clone the package within your own
repository.

The dependency management is part of the RPM packaging model. My
understanding is that you should not manage dependencies at different
levels or different stages.

Regards,
CI.-

2016-06-13 9:21 GMT-04:00 Mike Goodwin [email protected]:

Some bad news gents.

I asked @geekgonecrazy https://github.com/geekgonecrazy last week on
Tuesday to add me to the OpenSUSE build system as a maintainer so that I
could begin working on the RPM package. I didn't get to it until yesterday,
and what I've learned does not bode well for Rocket.Chat.Electron on OBS,
or any other electron-based client for that matter (to include atom itself)
(and to include never being packaged officially for Fedora (or therefore
RHEL) due to the below ticket and legal restrictions)

As it turns out, OBS, like Fedora Koji, does not permit network access
during the build process. For the similar reasons stated here:
https://bugzilla.redhat.com/show_bug.cgi?id=atom It will always probably
be too daunting and prohibitive to have official distribution packages,
and/or build packages in build-systems that disallow network access.

This is of course due to the gigantic mess that we know of as nodejs and
npm. For each nodejs dependency, it would require its own nodejs-*
package, which is a rabbit hole I'm not willing to travel down.

I scoured OBS looking for a better example, something, maybe of someone
packaging electron-based apps, and I found nothing of use. Every one was
disabled, failed, etc. This includes even Atom itself, which has an
interesting inclusion, here:
https://build.opensuse.org/package/show/home:dubkat/atom

Here you will find the tools to build atom yourself, as it cannot be built
by obs.

I believe at this point the only way forward is to use the gulp release
scripts and distribute the .rpms alongside the .deb [ I'd also like to
insert a quip here about having a "linux" button on your homepage and it
only pointing to .deb packages. Ubuntu != All Linuxes ] This has been
outlined and improved in #152
https://github.com/RocketChat/Rocket.Chat.Electron/pull/152


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/RocketChat/Rocket.Chat.Electron/issues/24#issuecomment-225578565,
or mute the thread
https://github.com/notifications/unsubscribe/ABq09L7BvS0BFwS5Euo7rDERhH8gAn0Tks5qLVlfgaJpZM4Fx_eb
.

Hello all,

I do have some progress. Check out my home directory on OBS:

https://build.opensuse.org/project/show/home:emendonca

There you can find some packages I had to create (using the existing packages at the https://build.opensuse.org/project/show/devel:languages:nodejs repository as a model):

· nodejs-code

· nodejs-errno

· nodejs-hoek

· nodejs-prr

· nodejs-spellchecker

· electron

· electron-build

· rocketchat

· rocketchat-build

The packages ending in “-build” are just metapackages that contain some directives in the _aggregate file to “merge” a couple of repositories when looking for dependencies.

Right now I’m working on the electron package. I shall be off-line until Aug 20th, feel free to create an account on OBS and clone/branch the packages and keep working on them.

If you need anything, I’ll be reachable every few days by email.

Awesome @doccaz !

For reference, check out any of the nodejs-* packages in my home directory. These are the smallest/most efficient SPEC template I could come up with for nodejs- packages. I just put up the contents of the official .tgz file in the none_modules directory and run a forced "npm install --save" to register the package at the %post script. The dependencies, however, must be declared manually in the header. And boy there are quite a bunch of them... 😂

Hello all,
I haven't forgot you, just been quite busy. After porting over quite a few NodeJS modules by hand, I made a little tool to automate it:
https://github.com/doccaz/nodejs2rpm

I'm using it to port the dozens of required modules and module dependencies using OBS.
For now there is quite a lot build jobs scheduled on the generated SPECs. It's not definitive yet, so if you have any suggestions or comments, please say so.

I still have to test all the packages to make sure my little tool worked as intended, then I can proceed to make proper packaging for RocketChat and other NodeJS-based stuff :)

This is pretty smart, and exactly where I fell short. I knew the road ahead was paved with node- packages for every dependency but I simply didn't have the time to do it manually. Nice work/progress!

I've done a lot of fiddling around since my last comments but have made exactly zero progress myself. I still can't get spellcheck to work on Fedora either, and I seem to have exhausted all the leads I had on possible reasons why it won't work. (Desperately need a node/JS dev to take a look at it failing on Fedora)

Anyway, if I can help in some other way please let me know, I'd be most interested in framing this in a way that ultimately gets us packaged into Fedora officially, as the rules seem to have laxed a bit, now with Chromium being packaged and in updates-testing officially.

+1 for RHEL/CentOS/Fedora client

+1 for RHEL/CentOS/Fedora client

It looks like the RPM files are not compatible with CentOS 7. Do you have any suggestions?

@rmmcnulty9 can you open a new issue requesting a centOS package? Thanks!

@rmmcnulty9 Can you highlight what's broken and not working for you? I just did a test on CentOS 7.3 and 7.4 with the package: rocketchat-2.9.0-538.x86_64 and it works as normal. Granted, I'm using KDE and not the default GNOME desktop.

I'm running CentOS 7.4 (and 7.3 before), with gnome desktop, all works fine except the application icon (wich is a gnome default icon, not rocket.chat one)

Very strange, when I opened the RPM in the Application Installer gui program it said, "File not supported". But if I do it through the CLI with sudo rpm -Uvh ~/Downloads/rocketchat-2.9.0.x86_64.rpm it installed. Thanks for the help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vkat14 picture Vkat14  ·  4Comments

AlynxZhou picture AlynxZhou  ·  4Comments

paulz1 picture paulz1  ·  3Comments

samcarter8 picture samcarter8  ·  3Comments

geekgonecrazy picture geekgonecrazy  ·  4Comments