diff --git a/.gitignore b/.gitignore index 2ba9d22..776ab13 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /packages /deploys /node_modules +/pkg/control diff --git a/package.json b/package.json index 4131463..89f2000 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,10 @@ } }, "deb": { - "afterInstall": "build/linux/after-install.tpl" + "afterInstall": "build/linux/after-install.tpl", + "fpm": [ + "--deb-custom-control=pkg/control" + ] }, "mac": { "category": "public.app-category.social-networking", diff --git a/pkg/control.template b/pkg/control.template new file mode 100644 index 0000000..8835e61 --- /dev/null +++ b/pkg/control.template @@ -0,0 +1,14 @@ +Package: riot-desktop +License: Apache-2.0 +Vendor: support@riot.im +Architecture: amd64 +Maintainer: support@riot.im +Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator3-1, libsecret-1-0 +Provides: riot-web +Conflicts: riot-web +Replaces: riot-web +Section: default +Priority: extra +Homepage: https://riot.im/ +Description: + A feature-rich client for Matrix.org diff --git a/scripts/set-version.js b/scripts/set-version.js index 5786d3c..5374914 100755 --- a/scripts/set-version.js +++ b/scripts/set-version.js @@ -18,6 +18,9 @@ async function main() { } const ver = asar.extractFile('webapp.asar', 'version').toString().trim(); + + // set version in package.json: electron-builder will use this to populate + // all the various version fields await new Promise((resolve, reject) => { child_process.execFile('yarn', [ 'version', @@ -33,6 +36,15 @@ async function main() { } }); }); + + // Also create a debian package control file with the version. + // We use a custom control file so we need to do this ourselves + const outFile = await fs.open('pkg/control', 'w'); + const template = await fs.readFile('pkg/control.template'); + await outFile.write(template); + await outFile.write('Version: ' + ver + "\n"); + await outFile.close(); + console.log("Version set to " + ver); }