Skip to content

Commit

Permalink
Register with bee after make install
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Nov 17, 2020
1 parent 691bb17 commit 19691c1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 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 @@ -60,6 +67,7 @@ function install_if()
if need_update "$src" "$dst"; then
"$@" "$src" "$dst"
fi
register_installed_file "$dst"
return 0
}

Expand All @@ -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()
Expand All @@ -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;
Expand Down Expand Up @@ -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

0 comments on commit 19691c1

Please sign in to comment.