Skip to content

Commit

Permalink
Fixed ownership of installed files on debian.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeller committed Mar 23, 2019
1 parent acab16b commit 0db99ce
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 29 deletions.
Empty file modified css/header_dialog.css
100755 → 100644
Empty file.
Empty file modified css/keys_dialog.css
100755 → 100644
Empty file.
29 changes: 16 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const APPS_DIR = './apps/';
const DEBUG_DIR = './debug/';
const RELEASE_DIR = './release/';

const LINUX_INSTALL_DIR = '/opt/betaflight';

var nwBuilderOptions = {
version: '0.32.4',
files: './dist/**/*',
Expand Down Expand Up @@ -173,7 +175,7 @@ function getRunDebugAppCommand(arch) {
}

function getReleaseFilename(platform, ext) {
return 'betaflight-blackbox-explorer_' + pkg.version + '_' + platform + '.' + ext;
return `${pkg.name}_${pkg.version}_${platform}.${ext}`;
}

function clean_dist() {
Expand Down Expand Up @@ -506,15 +508,16 @@ function release_deb(arch, done) {
architecture: debArch,
maintainer: pkg.author,
description: pkg.description,
postinst: ['cp /opt/betaflight/betaflight-blackbox-explorer/mime/betaflight-blackbox-explorer.xml /usr/share/mime/packages/;update-mime-database /usr/share/mime',
'cp /opt/betaflight/betaflight-blackbox-explorer/icon/bf_icon_128.png /usr/share/icons/hicolor/128x128/mimetypes/application-x-blackboxlog.png;gtk-update-icon-cache /usr/share/icons/hicolor -f',
'xdg-desktop-menu install /opt/betaflight/betaflight-blackbox-explorer/betaflight-blackbox-explorer.desktop'],
prerm: ['rm /usr/share/mime/packages/betaflight-blackbox-explorer.xml;update-mime-database /usr/share/mime',
'rm /usr/share/icons/hicolor/128x128/mimetypes/application-x-blackboxlog.png;gtk-update-icon-cache /usr/share/icons/hicolor -f',
'xdg-desktop-menu uninstall betaflight-blackbox-explorer.desktop'],
preinst: [`rm -rf ${LINUX_INSTALL_DIR}/${pkg.name}`],
postinst: [`chown root:root ${LINUX_INSTALL_DIR}`, `chown -R root:root ${LINUX_INSTALL_DIR}/${pkg.name}`, `cp ${LINUX_INSTALL_DIR}/${pkg.name}/mime/${pkg.name}.xml /usr/share/mime/packages/`, 'update-mime-database /usr/share/mime',
`cp ${LINUX_INSTALL_DIR}/${pkg.name}/icon/bf_icon_128.png /usr/share/icons/hicolor/128x128/mimetypes/application-x-blackboxlog.png`, 'gtk-update-icon-cache /usr/share/icons/hicolor -f',
`xdg-desktop-menu install ${LINUX_INSTALL_DIR}/${pkg.name}/${pkg.name}.desktop`],
prerm: [`rm /usr/share/mime/packages/${pkg.name}.xml`, 'update-mime-database /usr/share/mime',
'rm /usr/share/icons/hicolor/128x128/mimetypes/application-x-blackboxlog.png', 'gtk-update-icon-cache /usr/share/icons/hicolor -f',
`xdg-desktop-menu uninstall ${pkg.name}.desktop`],
depends: 'libgconf-2-4',
changelog: [],
_target: 'opt/betaflight/betaflight-blackbox-explorer',
_target: `${LINUX_INSTALL_DIR}/${pkg.name}`,
_out: RELEASE_DIR,
_copyright: 'assets/linux/copyright',
_clean: true
Expand Down Expand Up @@ -545,11 +548,11 @@ function release_rpm(arch, done) {
[ { cwd: path.join(APPS_DIR, pkg.name, arch),
src: '*',
dest: '/opt/betaflight/blackbox-log-viewer' } ],
postInstallScript: ['cp /opt/betaflight/betaflight-blackbox-explorer/mime/betaflight-blackbox-explorer.xml /usr/share/mime/packages/;update-mime-database /usr/share/mime',
'cp /opt/betaflight/betaflight-blackbox-explorer/icon/bf_icon_128.png /usr/share/icons/hicolor/128x128/mimetypes/application-x-blackboxlog.png;gtk-update-icon-cache /usr/share/icons/hicolor -f',
'xdg-desktop-menu install /opt/betaflight/blackbox-log-viewer/blackbox-log-viewer.desktop'],
preUninstallScript: ['rm /usr/share/mime/packages/betaflight-blackbox-explorer.xml;update-mime-database /usr/share/mime',
'rm /usr/share/icons/hicolor/128x128/mimetypes/application-x-blackboxlog.png;gtk-update-icon-cache /usr/share/icons/hicolor -f',
postInstallScript: [`cp ${LINUX_INSTALL_DIR}/${pkg.name}/mime/${pkg.name}.xml /usr/share/mime/packages/`, 'update-mime-database /usr/share/mime',
`cp ${LINUX_INSTALL_DIR}/${pkg.name}/icon/bf_icon_128.png /usr/share/icons/hicolor/128x128/mimetypes/application-x-blackboxlog.png`, 'gtk-update-icon-cache /usr/share/icons/hicolor -f',
`xdg-desktop-menu install ${LINUX_INSTALL_DIR}/${pkg.name}/blackbox-log-viewer.desktop`],
preUninstallScript: [`rm /usr/share/mime/packages/${pkg.name}.xml`, 'update-mime-database /usr/share/mime',
'rm /usr/share/icons/hicolor/128x128/mimetypes/application-x-blackboxlog.png', 'gtk-update-icon-cache /usr/share/icons/hicolor -f',
'xdg-desktop-menu uninstall blackbox-log-viewer.desktop'],
tempDir: path.join(RELEASE_DIR,'tmp-rpm-build-' + arch),
keepTemp: false,
Expand Down
Empty file modified images/cf_logo_white.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified index.html
100755 → 100644
Empty file.
Empty file modified js/configuration.js
100755 → 100644
Empty file.
Empty file modified js/grapher.js
100755 → 100644
Empty file.
Empty file modified js/header_dialog.js
100755 → 100644
Empty file.
Empty file modified js/keys_dialog.js
100755 → 100644
Empty file.
Empty file modified js/vendor/webm-writer-0.1.1.js
100755 → 100644
Empty file.
Empty file modified library/linux32/libffmpeg.so
100755 → 100644
Empty file.
Empty file modified library/linux64/libffmpeg.so
100755 → 100644
Empty file.
Empty file modified library/osx64/libffmpeg.dylib
100755 → 100644
Empty file.
48 changes: 32 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0db99ce

Please sign in to comment.