From 19691c16c9d1a3ab606d6dc0a8126d1b14f74e17 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 17 Nov 2020 15:18:06 +0100 Subject: [PATCH 1/6] Register with bee after `make install` Register files installed from mxtools with bee so that tools like `bee query` oder bee's conflict check work. We fake a installed package mxtools-0.0-0. --- install.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/install.sh b/install.sh index 5bc650b..dbf07b7 100755 --- a/install.sh +++ b/install.sh @@ -40,6 +40,13 @@ fi : ${INSTALL_DATA:=$INSTALL -m 644} : ${INSTALL_CRON:=$INSTALL -m 600} +INSTALLED_FILES=() + +function register_installed_file() +{ + INSTALLED_FILES+=("$1") +} + function need_update() { local src="$1" @@ -60,6 +67,7 @@ function install_if() if need_update "$src" "$dst"; then "$@" "$src" "$dst" fi + register_installed_file "$dst" return 0 } @@ -68,6 +76,7 @@ function install_desktop_file() test -d ${desktopdir} || mkdir -p ${desktopdir} install_if "$1" "$2" $INSTALL_DATA update-desktop-database ${desktopdir} + register_installed_file "$desktopdir/mimeinfo.cache" } function install_exec() @@ -90,6 +99,17 @@ function install_symlink() if [ "$(readlink "$2")" != "$1" ]; then ln -sfv "$1" "$2" fi + register_installed_file "$2" +} + +function postinstall() +{ + pkg="mxtools-0.0-0"; + mkdir -p "$DESTDIR$usr_prefix/share/bee/$pkg" + for f in "${INSTALLED_FILES[@]}"; do + echo "$f" + done | sort -u | /usr/libexec/bee/filelist2content > "$DESTDIR$usr_prefix/share/bee/$pkg/CONTENT" + bee cache update $pkg } umask 022; @@ -191,4 +211,6 @@ install_desktop_file desktop-files/ugene.desktop "$DESTDIR$desktopdir/u install_desktop_file desktop-files/org.octave.Octave.desktop \ "$DESTDIR$desktopdir/org.octave.Octave.desktop" install_desktop_file desktop-files/igv.desktop "$DESTDIR$desktopdir/igv.desktop" + +postinstall exit From b679c3ea500e27b61ccb681e5e1b0927e512c097 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 17 Nov 2020 15:42:00 +0100 Subject: [PATCH 2/6] install_symlink: Fix whitespace --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index dbf07b7..69c5d99 100755 --- a/install.sh +++ b/install.sh @@ -96,10 +96,10 @@ function install_cron() function install_symlink() { - if [ "$(readlink "$2")" != "$1" ]; then - ln -sfv "$1" "$2" - fi - register_installed_file "$2" + if [ "$(readlink "$2")" != "$1" ]; then + ln -sfv "$1" "$2" + fi + register_installed_file "$2" } function postinstall() From 1b572f2ac0cc6c0dd49993dc670351fdf686bbb6 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 16 Nov 2020 15:49:54 +0100 Subject: [PATCH 3/6] install.sh: Create all destination directories The explit list of destination directories to create is incomplete which becomes apparent, if installed into a empty directoy with DESTDIR=... Create any required directory implicitly. --- install.sh | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/install.sh b/install.sh index 69c5d99..dcef027 100755 --- a/install.sh +++ b/install.sh @@ -65,6 +65,8 @@ function install_if() shift 2 if need_update "$src" "$dst"; then + dir="$(dirname "$dst")" + test -d "$dir" || mkdir -p "$dir" "$@" "$src" "$dst" fi register_installed_file "$dst" @@ -73,7 +75,6 @@ function install_if() function install_desktop_file() { - test -d ${desktopdir} || mkdir -p ${desktopdir} install_if "$1" "$2" $INSTALL_DATA update-desktop-database ${desktopdir} register_installed_file "$desktopdir/mimeinfo.cache" @@ -97,6 +98,8 @@ function install_cron() function install_symlink() { if [ "$(readlink "$2")" != "$1" ]; then + dir="$(dirname "$2")" + test -d "$dir" || mkdir -p "$dir" ln -sfv "$1" "$2" fi register_installed_file "$2" @@ -114,13 +117,6 @@ function postinstall() umask 022; -mkdir -p "$DESTDIR$usr_bindir" -mkdir -p "$DESTDIR$usr_sbindir" -mkdir -p "$DESTDIR$systemdunitdir" -mkdir -p "$DESTDIR$usrlocal_bindir" -mkdir -p "$DESTDIR$udev_rulesdir" -mkdir -p "$DESTDIR$udev_helperdir" - install_exec make-automaps/make-automaps "$DESTDIR$usr_sbindir/make-automaps" install_data misc_systemd_units/automount.service "$DESTDIR$systemdunitdir/automount.service" install_data misc_systemd_units/dhcrelay.service "$DESTDIR$systemdunitdir/dhcrelay.service" @@ -176,10 +172,8 @@ install_exec nfsdtop/nfsdtop "$DESTDIR$usr_sbindir/n install_data serial-log/serial-log\@.service "$DESTDIR$systemdunitdir/serial-log@.service" install_exec serial-log/serial-log "$DESTDIR$usr_exec_prefix/libexec/serial-log" install_data misc_systemd_units/nfsd.service "$DESTDIR$systemdunitdir/nfsd.service" -mkdir -p "$DESTDIR$systemdunitdir/user@.service.d" install_data misc_systemd_units/user@.service.d/depend-on-remote-homes.conf \ "$DESTDIR$systemdunitdir/user@.service.d/depend-on-remote-homes.conf" -mkdir -p "$DESTDIR$sysconfdir/systemd/logind.conf.d" install_data misc_etc_files/systemd/logind.conf.d/disable_RemoveIPC.conf \ "$DESTDIR$sysconfdir/systemd/logind.conf.d/disable_RemoveIPC.conf" install_data logrotate/logrotate.conf "$DESTDIR$sysconfdir/logrotate.conf" @@ -187,7 +181,6 @@ install_data logrotate/logrotate.service "$DESTDIR$systemdunitd install_data logrotate/logrotate.timer "$DESTDIR$systemdunitdir/logrotate.timer" install_data misc_systemd_units/network.service "$DESTDIR$systemdunitdir/network.service" install_data misc_systemd_units/mxvlan.service "$DESTDIR$systemdunitdir/mxvlan.service" -mkdir -p "$DESTDIR$usr_prefix/share/applications" install_data applications-defaults/defaults.list "$DESTDIR$usr_prefix/share/applications/defaults.list" install_data misc_etc_files/modprobe.d/nfs_slotlimit.conf "$DESTDIR$sysconfdir/modprobe.d/nfs_slotlimit.conf" install_data misc_etc_files/rsyslog.conf "$DESTDIR$sysconfdir/rsyslog.conf" @@ -195,11 +188,9 @@ install_data crashkernel/crashkernel.service "$DESTDIR$systemdunitd install_exec crashkernel/crash-recovery.sh "$DESTDIR$root_sbindir/crash-recovery.sh" install_data misc_systemd_units/admin-sshd.service "$DESTDIR$systemdunitdir/admin-sshd.service" install_exec checktrust/checktrust "$DESTDIR$usr_sbindir/checktrust" -mkdir -p "$DESTDIR$sysconfdir/xdg/lightdm/lightdm.conf.d" install_data checktrust/lightdm-use-wrapper.conf "$DESTDIR$sysconfdir/xdg/lightdm/lightdm.conf.d/50-use-wrapper.conf" install_exec checktrust/lightdm-greeter-wrapper "$DESTDIR$usr_exec_prefix/libexec/lightdm-greeter-wrapper" install_exec checktrust/lightdm-show-trust-warning "$DESTDIR$usr_exec_prefix/libexec/lightdm-show-trust-warning" -mkdir -p "$DESTDIR$sysconfdir/issue.d/" install_symlink /node/issue.d/notrust.issue "$DESTDIR$sysconfdir/issue.d/notrust.issue" install_data checktrust/getty-checktrust.service "$DESTDIR$systemdunitdir/getty-checktrust.service" install_exec checktrust/getty-checktrust "$DESTDIR$usr_exec_prefix/libexec/getty-checktrust" From e18e3a191199e70f5d67beaff751ead219072c26 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 17 Nov 2020 15:31:58 +0100 Subject: [PATCH 4/6] install.sh: run update-desktop-database only once Don't run update-desktop-database after each installed desktop file but only once after all files are installed. --- install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index dcef027..b969a65 100755 --- a/install.sh +++ b/install.sh @@ -76,8 +76,6 @@ function install_if() function install_desktop_file() { install_if "$1" "$2" $INSTALL_DATA - update-desktop-database ${desktopdir} - register_installed_file "$desktopdir/mimeinfo.cache" } function install_exec() @@ -107,6 +105,9 @@ function install_symlink() function postinstall() { + update-desktop-database ${desktopdir} + register_installed_file "$desktopdir/mimeinfo.cache" + pkg="mxtools-0.0-0"; mkdir -p "$DESTDIR$usr_prefix/share/bee/$pkg" for f in "${INSTALLED_FILES[@]}"; do From 9c30051995b46c48183bcb47c2f5bc492ad51da2 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 17 Nov 2020 15:34:33 +0100 Subject: [PATCH 5/6] Remove install_desktop_file After the previous commits, install_desktop_file is now reduced to the same functionality as install_data, so use this function. --- install.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/install.sh b/install.sh index b969a65..b388afc 100755 --- a/install.sh +++ b/install.sh @@ -73,11 +73,6 @@ function install_if() return 0 } -function install_desktop_file() -{ - install_if "$1" "$2" $INSTALL_DATA -} - function install_exec() { install_if "$1" "$2" $INSTALL_PROGRAM @@ -195,14 +190,12 @@ install_exec checktrust/lightdm-show-trust-warning "$DESTDIR$usr_exec_pre install_symlink /node/issue.d/notrust.issue "$DESTDIR$sysconfdir/issue.d/notrust.issue" install_data checktrust/getty-checktrust.service "$DESTDIR$systemdunitdir/getty-checktrust.service" install_exec checktrust/getty-checktrust "$DESTDIR$usr_exec_prefix/libexec/getty-checktrust" -install_desktop_file desktop-files/org.inkscape.Inkscape.desktop \ - "$DESTDIR$desktopdir/org.inkscape.Inkscape.desktop" -install_desktop_file desktop-files/rstudio.desktop "$DESTDIR$desktopdir/rstudio.desktop" -install_desktop_file desktop-files/meld3.desktop "$DESTDIR$desktopdir/meld3.desktop" -install_desktop_file desktop-files/ugene.desktop "$DESTDIR$desktopdir/ugene.desktop" -install_desktop_file desktop-files/org.octave.Octave.desktop \ - "$DESTDIR$desktopdir/org.octave.Octave.desktop" -install_desktop_file desktop-files/igv.desktop "$DESTDIR$desktopdir/igv.desktop" +install_data desktop-files/org.inkscape.Inkscape.desktop "$DESTDIR$desktopdir/org.inkscape.Inkscape.desktop" +install_data desktop-files/rstudio.desktop "$DESTDIR$desktopdir/rstudio.desktop" +install_data desktop-files/meld3.desktop "$DESTDIR$desktopdir/meld3.desktop" +install_data desktop-files/ugene.desktop "$DESTDIR$desktopdir/ugene.desktop" +install_data desktop-files/org.octave.Octave.desktop "$DESTDIR$desktopdir/org.octave.Octave.desktop" +install_data desktop-files/igv.desktop "$DESTDIR$desktopdir/igv.desktop" postinstall exit From 604d68287453e656b21bb15764c7f1d5193f1848 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 17 Nov 2020 15:43:16 +0100 Subject: [PATCH 6/6] Fix update-desktop-database when DESTDIR is specified --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index b388afc..c029786 100755 --- a/install.sh +++ b/install.sh @@ -100,8 +100,8 @@ function install_symlink() function postinstall() { - update-desktop-database ${desktopdir} - register_installed_file "$desktopdir/mimeinfo.cache" + update-desktop-database "$DESTDIR$desktopdir" + register_installed_file "$DESTDIR$desktopdir/mimeinfo.cache" pkg="mxtools-0.0-0"; mkdir -p "$DESTDIR$usr_prefix/share/bee/$pkg"