Skip to content

Add bee inventory #138

Merged
merged 6 commits into from
Nov 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
67 changes: 37 additions & 30 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -58,18 +65,14 @@ 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"
return 0
}

function install_desktop_file()
{
test -d ${desktopdir} || mkdir -p ${desktopdir}
install_if "$1" "$2" $INSTALL_DATA
update-desktop-database ${desktopdir}
}

function install_exec()
{
install_if "$1" "$2" $INSTALL_PROGRAM
Expand All @@ -87,19 +90,28 @@ function install_cron()

function install_symlink()
{
if [ "$(readlink "$2")" != "$1" ]; then
ln -sfv "$1" "$2"
fi
if [ "$(readlink "$2")" != "$1" ]; then
dir="$(dirname "$2")"
test -d "$dir" || mkdir -p "$dir"
ln -sfv "$1" "$2"
fi
register_installed_file "$2"
}

umask 022;
function postinstall()
{
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"
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
}

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"
umask 022;

install_exec make-automaps/make-automaps "$DESTDIR$usr_sbindir/make-automaps"
install_data misc_systemd_units/automount.service "$DESTDIR$systemdunitdir/automount.service"
Expand Down Expand Up @@ -156,39 +168,34 @@ 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"
install_data logrotate/logrotate.service "$DESTDIR$systemdunitdir/logrotate.service"
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"
install_data crashkernel/crashkernel.service "$DESTDIR$systemdunitdir/crashkernel.service"
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"
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