Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Fixes deb installers
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandru Rosianu committed Apr 15, 2015
1 parent 6c85d2e commit dbca7dd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/src/vendor
/src/vendor/
/opt/
build/
dist/
cache/
Expand Down
4 changes: 2 additions & 2 deletions assets-linux/after-remove.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Link to the binary
rm /usr/local/bin/messengerfordesktop
rm -f /usr/local/bin/messengerfordesktop

# Unity Launcher icon
rm /usr/share/applications/messengerfordesktop.desktop
rm -f /usr/share/applications/messengerfordesktop.desktop
4 changes: 2 additions & 2 deletions assets-linux/messengerfordesktop.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Version=1.2.2
Version=1.0
Type=Application
Name={{name}}
Name=Messenger
Icon=/opt/MessengerForDesktop/icon_256.png
Exec=/opt/MessengerForDesktop/Messenger
Comment=Messenger for Desktop
Expand Down
42 changes: 20 additions & 22 deletions gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ runSequence = require 'run-sequence'
manifest = require './package.json'
$ = require('gulp-load-plugins')()

# Remove the ./build and ./dist directories
# Remove directories used by the tasks
gulp.task 'clean', ->
shelljs.rm '-rf', './opt'
shelljs.rm '-rf', './build'
shelljs.rm '-rf', './dist'

Expand Down Expand Up @@ -46,33 +47,30 @@ gulp.task 'pack:win32', ['build:win32'], ->

# Create packages for linux
[32, 64].forEach (arch) ->
gulp.task 'pack:linux' + arch, ['build:linux' + arch], ->
gulp.src [
'./assets-linux/icon_256.png'
'./assets-linux/messengerfordesktop.desktop'
]
.pipe gulp.dest './build/Messenger/linux' + arch
.on 'end', ->
['deb', 'rpm'].forEach (target) ->
['deb', 'rpm'].forEach (target) ->
gulp.task "pack:linux#{arch}:#{target}", ['build:linux' + arch], ->
shelljs.rm '-rf', './opt'

gulp.src [
'./assets-linux/icon_256.png'
'./assets-linux/messengerfordesktop.desktop'
'./assets-linux/after-install.sh'
'./assets-linux/after-remove.sh'
'./build/Messenger/linux' + arch + '/**'
]
.pipe gulp.dest './opt/MessengerForDesktop'
.on 'end', ->
port = if arch == 32 then 'i386' else 'amd64'
name = manifest.name.toLowerCase()
version = manifest.version
url = 'https://messengerfordesktop.com'
description = 'Beautiful desktop client for Facebook Messenger. Chat without being distracted by your feed or notifications.'
afterInstall = './assets-linux/after-install.sh'
afterRemove = './assets-linux/after-remove.sh'
maintainer = 'Alexandru Rosianu <me@aluxian.com>'
output = "./dist/Messenger_linux#{arch}.#{target}"

p1 = "-s dir -t #{target} -a #{port} -n #{name} --after-install #{afterInstall} --after-remove #{afterRemove}"
p2 = "--category Chat --url \"#{url}\" --description \"#{description}\" -m \"#{maintainer}\" -p #{output} -v #{version}"

shelljs.rm '-f', output # it fails if the package already exists
shelljs.exec "fpm #{p1} #{p2} ./build/Messenger/linux#{arch}/"
shelljs.mkdir '-p', './dist' # it fails if the dir doesn't exist
shelljs.rm '-f', output # it fails if the package already exists

shelljs.exec "fpm -s dir -t #{target} -a #{port} -n messengerfordesktop --after-install ./opt/MessengerForDesktop/after-install.sh --after-remove ./opt/MessengerForDesktop/after-remove.sh --license MIT --category Chat --url \"https://messengerfordesktop.com\" --description \"Beautiful desktop client for Facebook Messenger. Chat without being distracted by your feed or notifications.\" -m \"Alexandru Rosianu <me@aluxian.com>\" -p #{output} -v #{manifest.version} ./opt/MessengerForDesktop/"

# Make packages for all platforms
gulp.task 'pack:all', (callback) ->
runSequence 'pack:osx64', 'pack:win32', 'pack:linux32', 'pack:linux64', callback
runSequence 'pack:osx64', 'pack:win32', 'pack:linux32:deb', 'pack:linux32:rpm', 'pack:linux64:deb', 'pack:linux64:rpm', callback

# Build osx64 and run it
gulp.task 'run:osx64', ['build:osx64'], ->
Expand Down

0 comments on commit dbca7dd

Please sign in to comment.