mirror of https://github.com/keeweb/keeweb
#141: buliding deb file
parent
737d4df8e6
commit
8a588e5d99
59
Gruntfile.js
59
Gruntfile.js
|
@ -116,6 +116,30 @@ module.exports = function(grunt) {
|
|||
src: 'tmp/desktop/KeeWeb.linux.ia32.zip',
|
||||
dest: 'dist/desktop/KeeWeb.linux.ia32.zip',
|
||||
nonull: true
|
||||
},
|
||||
'desktop_linux_deb_x64': {
|
||||
src: 'tmp/desktop/KeeWeb-linux-deb-x64.deb',
|
||||
dest: 'dist/desktop/KeeWeb.linux.x64.deb',
|
||||
nonull: true
|
||||
},
|
||||
'desktop_linux_deb_x64_src': {
|
||||
cwd: 'package/deb/',
|
||||
src: '**',
|
||||
dest: 'tmp/desktop/KeeWeb-linux-deb-x64',
|
||||
expand: true,
|
||||
nonull: true
|
||||
},
|
||||
'desktop_linux_deb_x64_src_files': {
|
||||
cwd: 'tmp/desktop/KeeWeb-linux-x64/',
|
||||
src: '**',
|
||||
dest: 'tmp/desktop/KeeWeb-linux-deb-x64/opt/keeweb-desktop',
|
||||
expand: true,
|
||||
nonull: true
|
||||
},
|
||||
'desktop_linux_deb_x64_src_icon': {
|
||||
src: 'electron/icon.png',
|
||||
dest: 'tmp/desktop/KeeWeb-linux-deb-x64/usr/share/icons/hicolor/128x128/apps/keeweb.png',
|
||||
nonull: true
|
||||
}
|
||||
},
|
||||
jshint: {
|
||||
|
@ -181,6 +205,15 @@ module.exports = function(grunt) {
|
|||
'desktop_html': {
|
||||
options: { replacements: [{ pattern: ' manifest="manifest.appcache"', replacement: '' }] },
|
||||
files: { 'tmp/desktop/app/index.html': 'dist/index.html' }
|
||||
},
|
||||
'desktop_linux_deb_x64': {
|
||||
options: {
|
||||
replacements: [
|
||||
{ pattern: '{ver}', replacement: pkg.version },
|
||||
{ pattern: '{size}', replacement: '<%= dir_size_linux_x64 %>' }
|
||||
]
|
||||
},
|
||||
files: { 'tmp/desktop/KeeWeb-linux-deb-x64/DEBIAN/control': 'package/deb/DEBIAN/control' }
|
||||
}
|
||||
},
|
||||
webpack: {
|
||||
|
@ -367,6 +400,25 @@ module.exports = function(grunt) {
|
|||
}
|
||||
}
|
||||
},
|
||||
'get-dir-size': {
|
||||
'desktop_linux_x64': {
|
||||
files: { 'dir_size_linux_x64': 'tmp/desktop/KeeWeb-linux-x64' }
|
||||
}
|
||||
},
|
||||
run: {
|
||||
'deb_x64': {
|
||||
options: {
|
||||
cwd: 'tmp/desktop/',
|
||||
failOnError: true
|
||||
},
|
||||
cmd: 'fakeroot',
|
||||
args: [
|
||||
'dpkg-deb',
|
||||
'--build',
|
||||
'KeeWeb-linux-deb-x64'
|
||||
]
|
||||
}
|
||||
},
|
||||
compress: {
|
||||
linux64: {
|
||||
options: { archive: 'tmp/desktop/KeeWeb.linux.x64.zip' },
|
||||
|
@ -432,12 +484,19 @@ module.exports = function(grunt) {
|
|||
'validate-desktop-update',
|
||||
'electron',
|
||||
'electron_builder',
|
||||
'get-dir-size:desktop_linux_x64',
|
||||
'copy:desktop_linux_deb_x64_src',
|
||||
'copy:desktop_linux_deb_x64_src_files',
|
||||
'copy:desktop_linux_deb_x64_src_icon',
|
||||
'string-replace:desktop_linux_deb_x64',
|
||||
'compress:linux64',
|
||||
'compress:linux32',
|
||||
'run:deb_x64',
|
||||
'copy:desktop_osx',
|
||||
'copy:desktop_win',
|
||||
'copy:desktop_linux_x64',
|
||||
'copy:desktop_linux_ia32',
|
||||
'copy:desktop_linux_deb_x64',
|
||||
'clean:desktop_tmp'
|
||||
]);
|
||||
};
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
var getFolderSize = require('get-folder-size');
|
||||
|
||||
module.exports = function (grunt) {
|
||||
grunt.registerMultiTask('get-dir-size', 'Signs archive with a private key', function () {
|
||||
var done = this.async();
|
||||
var allPromises = [];
|
||||
this.files.forEach(function(file) {
|
||||
var totalSize = 0;
|
||||
var promises = [];
|
||||
file.src.forEach(function(src) {
|
||||
promises.push(new Promise(function(resolve, reject) {
|
||||
getFolderSize(src, function(err, size) {
|
||||
if (err) {
|
||||
grunt.fail.fatal('Error getting folder size', src, err);
|
||||
reject(err);
|
||||
} else {
|
||||
totalSize += size;
|
||||
resolve(size);
|
||||
}
|
||||
});
|
||||
}));
|
||||
});
|
||||
allPromises.push(Promise.all(promises).then(function() {
|
||||
totalSize = Math.round(totalSize / 1024);
|
||||
grunt.config.set(file.dest, totalSize);
|
||||
grunt.log.writeln(file.dest + ': ' + totalSize + 'kB');
|
||||
}));
|
||||
});
|
||||
Promise.all(allPromises).then(function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
};
|
|
@ -10,6 +10,7 @@
|
|||
"cssnano": "^3.3.2",
|
||||
"electron-builder": "^2.1.1",
|
||||
"exports-loader": "^0.6.2",
|
||||
"get-folder-size": "^1.0.0",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-bower-install-simple": "^1.1.4",
|
||||
"grunt-contrib-clean": "^0.7.0",
|
||||
|
@ -23,6 +24,7 @@
|
|||
"grunt-gitinfo": "^0.1.7",
|
||||
"grunt-inline-alt": "^0.3.10",
|
||||
"grunt-postcss": "^0.7.1",
|
||||
"grunt-run": "^0.5.2",
|
||||
"grunt-sass": "^1.1.0",
|
||||
"grunt-string-replace": "^1.2.0",
|
||||
"grunt-webpack": "^1.0.11",
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
Package: keeweb-desktop
|
||||
Version: {ver}
|
||||
Section: base
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: antelle <antelle.net@gmail.com>
|
||||
Installed-Size: {size}
|
||||
Homepage: https://keeweb.info/
|
||||
Description: KeeWeb
|
||||
Free cross-platform password manager
|
||||
compatible with KeePass
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
/opt/keeweb-desktop/KeeWeb --disable-updater $1
|
|
@ -0,0 +1,16 @@
|
|||
[Desktop Entry]
|
||||
Name=KeeWeb
|
||||
GenericName=Password Manager
|
||||
GenericName[de]=Passwortverwaltung
|
||||
GenericName[es]=Gestor de contraseñas
|
||||
GenericName[fr]=Gestionnaire de mot de passe
|
||||
GenericName[ru]=Менеджер паролей
|
||||
Comment=Free cross-platform password manager compatible with KeePass
|
||||
Exec=KeeWeb %u
|
||||
Icon=keeweb
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Type=Application
|
||||
Categories=Utility;
|
||||
MimeType=application/x-keepass2;
|
||||
StartupWMClass=KeeWeb
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
<mime-type type="application/x-keepass2">
|
||||
<comment>KeePass 2 database</comment>
|
||||
<glob pattern="*.kdbx"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
|
@ -25,6 +25,7 @@ Storage providers, usability improvements
|
|||
`+` hide demo button once opened
|
||||
`+` show error details on open
|
||||
`+` select dropbox folder
|
||||
`+` building deb
|
||||
`-` fix capslock indicator
|
||||
`-` fix file settings input behavior
|
||||
`-` fix favicon download
|
||||
|
|
Loading…
Reference in New Issue