Use a custom control file for the Debian package

So we can say we replace the riot-web package
This commit is contained in:
David Baker 2019-12-13 10:45:27 +00:00
parent 98fa34f56f
commit 6e6e7d82c8
4 changed files with 31 additions and 1 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@
/packages
/deploys
/node_modules
/pkg/control

View file

@ -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",

14
pkg/control.template Normal file
View file

@ -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

View file

@ -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);
}