@@ -29,6 +29,8 @@ const APPS_DIR = './apps/';
2929const DEBUG_DIR = './debug/' ;
3030const RELEASE_DIR = './release/' ;
3131
32+ const LINUX_INSTALL_DIR = '/opt/betaflight' ;
33+
3234var nwBuilderOptions = {
3335 version : '0.35.3' ,
3436 files : './dist/**/*' ,
@@ -186,7 +188,7 @@ function getRunDebugAppCommand(arch) {
186188}
187189
188190function getReleaseFilename ( platform , ext ) {
189- return 'betaflight-configurator_' + pkg . version + '_' + platform + '.' + ext ;
191+ return ` ${ pkg . name } _ ${ pkg . version } _ ${ platform } . ${ ext } ` ;
190192}
191193
192194function clean_dist ( ) {
@@ -545,11 +547,12 @@ function release_deb(arch, done) {
545547 architecture : getLinuxPackageArch ( 'deb' , arch ) ,
546548 maintainer : pkg . author ,
547549 description : pkg . description ,
548- postinst : [ 'xdg-desktop-menu install /opt/betaflight/betaflight-configurator/betaflight-configurator.desktop' ] ,
549- prerm : [ 'xdg-desktop-menu uninstall betaflight-configurator.desktop' ] ,
550+ preinst : [ `rm -rf ${ LINUX_INSTALL_DIR } /${ pkg . name } ` ] ,
551+ postinst : [ `chown root:root ${ LINUX_INSTALL_DIR } ` , `chown -R root:root ${ LINUX_INSTALL_DIR } /${ pkg . name } ` , `xdg-desktop-menu install ${ LINUX_INSTALL_DIR } /${ pkg . name } /${ pkg . name } .desktop` ] ,
552+ prerm : [ `xdg-desktop-menu uninstall ${ pkg . name } .desktop` ] ,
550553 depends : 'libgconf-2-4' ,
551554 changelog : [ ] ,
552- _target : 'opt/betaflight/betaflight-configurator' ,
555+ _target : ` ${ LINUX_INSTALL_DIR } / ${ pkg . name } ` ,
553556 _out : RELEASE_DIR ,
554557 _copyright : 'assets/linux/copyright' ,
555558 _clean : true
@@ -579,9 +582,9 @@ function release_rpm(arch, done) {
579582 files :
580583 [ { cwd : path . join ( APPS_DIR , pkg . name , arch ) ,
581584 src : '*' ,
582- dest : '/opt/betaflight/betaflight-configurator' } ] ,
583- postInstallScript : [ ' xdg-desktop-menu install /opt/betaflight/betaflight-configurator/betaflight-configurator. desktop' ] ,
584- preUninstallScript : [ ' xdg-desktop-menu uninstall betaflight-configurator. desktop' ] ,
585+ dest : ` ${ LINUX_INSTALL_DIR } / ${ pkg . name } ` } ] ,
586+ postInstallScript : [ ` xdg-desktop-menu install ${ LINUX_INSTALL_DIR } / ${ pkg . name } / ${ pkg . name } . desktop` ] ,
587+ preUninstallScript : [ ` xdg-desktop-menu uninstall ${ pkg . name } . desktop` ] ,
585588 tempDir : path . join ( RELEASE_DIR , 'tmp-rpm-build-' + arch ) ,
586589 keepTemp : false ,
587590 verbose : false ,
0 commit comments