Merge pull request #44 from vector-im/dbkr/move_deb_control

Move deb control logic to builder
This commit is contained in:
David Baker 2020-03-09 12:43:20 +00:00 committed by GitHub
commit 3f77d0c70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 33 deletions

View file

@ -85,11 +85,6 @@
"StartupWMClass": "riot"
}
},
"deb": {
"fpm": [
"--deb-custom-control=pkg/control"
]
},
"mac": {
"category": "public.app-category.social-networking",
"darkModeSupport": true

View file

@ -0,0 +1,11 @@
Package: riot-nightly
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, libsqlcipher0
Section: net
Priority: extra
Homepage: https://riot.im/
Description:
A feature-rich client for Matrix.org (nightly unstable build).

View file

@ -40,41 +40,16 @@ async function setPackageVersion(ver) {
});
}
async function setDebVersion(ver) {
// 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);
}
async function main(args) {
let setDeb = false;
let setPkg = false;
let version;
for (const arg of args) {
if (arg === '--deb') {
setDeb = true;
} else if (arg === '--pkg') {
setPkg = true;
} else {
version = arg;
}
}
let version = args[0];
if (version === undefined) version = await versionFromAsar();
if (setPkg) await setPackageVersion(version);
if (setDeb) await setDebVersion(version);
await setPackageVersion(version);
}
if (require.main === module) {
main(process.argv.slice(2)).then((ret) => process.exit(ret));
}
module.exports = {versionFromAsar, setPackageVersion, setDebVersion};
module.exports = {versionFromAsar, setPackageVersion};