Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mxtools/install.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
268 lines (239 sloc)
14.7 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Although these should be inherited from the Makefile, | |
# we set some defaults ourself, too, in case we are called | |
# not from make but standalone. | |
if [ -z "$prefix" ]; then | |
: ${root_prefix:=} | |
: ${usr_prefix:=/usr} | |
: ${usrlocal_prefix:=/usr/local} | |
else | |
: ${root_prefix:=$prefix} | |
: ${usr_prefix:=$prefix} | |
: ${usrlocal_prefix:=$prefix} | |
fi | |
: ${root_exec_prefix:=$root_prefix} | |
: ${root_bindir:=$root_exec_prefix/bin} | |
: ${root_sbindir:=$root_exec_prefix/sbin} | |
: ${usr_exec_prefix:=$usr_prefix} | |
: ${usr_bindir:=$usr_exec_prefix/bin} | |
: ${usr_sbindir:=$usr_exec_prefix/sbin} | |
: ${usr_mandir:=$usr_exec_prefix/share/man} | |
: ${usr_libdir:=$usr_prefix/lib} | |
: ${usrlocal_exec_prefix:=$usrlocal_prefix} | |
: ${usrlocal_bindir:=$usrlocal_exec_prefix/bin} | |
: ${usrlocal_sbindir:=$usrlocal_exec_prefix/sbin} | |
: ${sysconfdir:=$prefix/etc} | |
: ${systemdunitdir:=$sysconfdir/systemd/system} | |
: ${udev_rulesdir:=$sysconfdir/udev/rules.d} | |
: ${crond_dir:=$sysconfdir/cron.d} | |
: ${udev_helperdir:=$prefix/lib/udev} | |
: ${desktopdir:=${usr_prefix}/local/package/share/applications} | |
: ${INSTALL:=install -v} | |
: ${INSTALL_PROGRAM:=$INSTALL} | |
: ${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" | |
local dst="$2" | |
test -e "$dst" || return 0 | |
test "$(stat -c%s "$src")" = "$(stat -c%s "$dst")" || return 0 | |
cmp -s "$src" "$dst" || return 0 | |
return 1 | |
} | |
function install_if() | |
{ | |
local src="$1" | |
local dst="$2" | |
shift 2 | |
true < "$src" || exit 1 | |
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_exec() | |
{ | |
install_if "$1" "$2" $INSTALL_PROGRAM | |
} | |
function install_data() | |
{ | |
install_if "$1" "$2" $INSTALL_DATA | |
} | |
function install_cron() | |
{ | |
install_if "$1" "$2" $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" | |
} | |
function install_etc_files() | |
{ | |
while read -r path; do | |
path="${path#./}" | |
if [[ -L "etc/$path" ]]; then | |
install_symlink "$(readlink "etc/$path")" "$DESTDIR$sysconfdir/$path" | |
elif [[ -x "etc/$path" ]]; then | |
install_exec "etc/$path" "$DESTDIR$sysconfdir/$path" | |
else | |
install_data "etc/$path" "$DESTDIR$sysconfdir/$path" | |
fi | |
done < <(cd etc ; find ./* -type f -or -type l) | |
} | |
function postinstall() | |
{ | |
update-desktop-database "$DESTDIR$desktopdir" | |
register_installed_file "$DESTDIR$desktopdir/mimeinfo.cache" | |
(cd "$DESTDIR$usrlocal_prefix/package/admin" && ./makebin) | |
pkg="mxtools-0.0-0" | |
rm "$DESTDIR$usr_prefix/share/bee/$pkg/CONTENT" 2>&1 || true | |
bee cache update $pkg | |
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; | |
install_etc_files | |
install_exec make-automaps/make-automaps "$DESTDIR$usr_sbindir/make-automaps" | |
install_data unbound/unbound.service "$DESTDIR$systemdunitdir/unbound.service" | |
install_exec unbound/unbound-startup "$DESTDIR$usr_sbindir/unbound-startup" | |
install_exec mkmotd/mkmotd.pl "$DESTDIR$usr_sbindir/mkmotd.pl" | |
install_data mkmotd/motd.service "$DESTDIR$systemdunitdir/motd.service" | |
install_exec mxgrub/mxgrub "$DESTDIR$usr_sbindir/mxgrub" | |
install_exec mxnetctl/mxnetctl "$DESTDIR$usr_sbindir/mxnetctl" | |
install_exec mxrouter/mxrouterctl "$DESTDIR$usr_sbindir/mxrouterctl" | |
install_exec mxvlan/mxvlanctl "$DESTDIR$usr_sbindir/mxvlanctl" | |
install_exec netlog/netlog "$DESTDIR$usr_sbindir/netlog" | |
install_data netlog/netlog.service "$DESTDIR$systemdunitdir/netlog.service" | |
install_exec nvidiactl/nvidiactl "$DESTDIR$usr_sbindir/nvidiactl" | |
install_data nvidiactl/nvidia.service "$DESTDIR$systemdunitdir/nvidia.service" | |
install_exec pdist/pdist "$DESTDIR$usrlocal_bindir/pdist" | |
install_exec pmirror/pmirror "$DESTDIR$usrlocal_bindir/pmirror" | |
install_exec prun/prun "$DESTDIR$usr_bindir/prun" | |
install_exec prun/ptype "$DESTDIR$usr_bindir/ptype" | |
install_exec prun/pman "$DESTDIR$usr_bindir/pman" | |
install_exec put_websafe/put_websafe "$DESTDIR$usrlocal_bindir/put_websafe" | |
install_exec pkgadmin/pkgadmin "$DESTDIR$usr_sbindir/pkgadmin" | |
install_data pkgadmin/pkgadmin-update.service "$DESTDIR$systemdunitdir/pkgadmin-update.service" | |
install_data pkgadmin/pkgadmin-update.timer "$DESTDIR$systemdunitdir/pkgadmin-update.timer" | |
install_exec mxraid/mxraid "$DESTDIR$usr_sbindir/mxraid" | |
install_exec mxraid/mxraid_assemble "$DESTDIR$usr_sbindir/mxraid_assemble" | |
install_data mxraid/mxraid.service "$DESTDIR$systemdunitdir/mxraid.service" | |
install_data mxraid/mxraid.shutdown.service "$DESTDIR$systemdunitdir/mxraid.shutdown.service" | |
install_exec mxraid/mdcheck.safe "$DESTDIR$usr_bindir/mdcheck.safe" | |
install_cron mxraid/crond-mdcheck "$DESTDIR$crond_dir/mdcheck" | |
install_exec kvm_monitor/kvm_monitor.pl "$DESTDIR$udev_helperdir/kvm_monitor.pl" | |
install_data kvm_monitor/51-raritan-kvm.rules "$DESTDIR$udev_rulesdir/51-raritan-kvm.rules" | |
install_exec mxmirror/mxmirror "$DESTDIR$usr_sbindir/mxmirror" | |
install_exec blink/blinkd.py "$DESTDUR$udev_helperdir/blinkd.py" | |
install_data blink/blinkd.service "$DESTDIR$systemdunitdir/blinkd.service" | |
install_data blink/51-blink.rules "$DESTDIR$udev_rulesdir/51-blink.rules" | |
install_data clusterd/clusterd.service "$DESTDIR$systemdunitdir/clusterd.service" | |
install_exec clusterd/clusterd "$DESTDIR$usr_sbindir/clusterd" | |
install_exec uvpn/uvpn "$DESTDIR$usr_bindir/uvpn" | |
install_exec mxmount/mxmount "$DESTDIR$usr_bindir/mxmount" | |
install_data mxmount/mxmount.service "$DESTDIR$systemdunitdir/mxmount.service" | |
install_exec hostconfig/hostconfig "$DESTDIR$usr_sbindir/hostconfig" | |
install_symlink /usr/sbin/hostconfig "$DESTDIR$usr_bindir/hostconfig" | |
install_exec fon/fon.pl "$DESTDIR$usr_bindir/fon" | |
install_exec nfsdtop/nfsdtop "$DESTDIR$usr_sbindir/nfsdtop" | |
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 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 applications-defaults/defaults.list "$DESTDIR$usr_prefix/share/applications/defaults.list" | |
install_data crashkernel/crashkernel.service "$DESTDIR$systemdunitdir/crashkernel.service" | |
install_exec crashkernel/crash-recovery.sh "$DESTDIR$root_sbindir/crash-recovery.sh" | |
install_exec checktrust/checktrust "$DESTDIR$usr_sbindir/checktrust" | |
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" | |
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_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" | |
install_data desktop-files/brave-browser.desktop "$DESTDIR$desktopdir/brave-browser.desktop" | |
install_data desktop-files/atom.desktop "$DESTDIR$desktopdir/atom.desktop" | |
install_data desktop-files/code.desktop "$DESTDIR$desktopdir/code.desktop" | |
install_data desktop-files/pulsar.desktop "$DESTDIR$desktopdir/pulsar.desktop" | |
install_exec usrlocalpkg/admin/makebin "$DESTDIR$usrlocal_prefix/package/admin/makebin" | |
install_data usrlocalpkg/admin/config "$DESTDIR$usrlocal_prefix/package/admin/config" | |
for f in usrlocalpkg/admin/lib/*; do | |
install_data "$f" "$DESTDIR$usrlocal_prefix/package/admin/lib/$(basename "$f")" | |
done | |
install_symlink /usr/bin/prun "$DESTDIR$usrlocal_prefix/package/bin/prun" | |
install_symlink /usr/bin/ptype "$DESTDIR$usrlocal_prefix/package/bin/ptype" | |
install_symlink /usr/bin/pman "$DESTDIR$usrlocal_prefix/package/bin/pman" | |
install_exec wakeonlan/wakeonlan "$DESTDIR$usr_sbindir/wakeonlan" | |
install_data mxshadow/mxshadow.cert.pem "$DESTDIR$sysconfdir/mxshadow.cert.pem" | |
install_data mxshadow/mxshadow.conf "$DESTDIR$sysconfdir/mxshadow.conf" | |
install_data mxshadow/mxshadow.service "$DESTDIR$systemdunitdir/mxshadow.service" | |
install_exec vmcontrol/vmcontrol.pl "$DESTDIR$usr_bindir/vmcontrol.pl" | |
install_data prun/prun.1 "$DESTDIR$usr_mandir/man1/prun.1" | |
install_data prun/ptype.1 "$DESTDIR$usr_mandir/man1/ptype.1" | |
install_data prun/pman.1 "$DESTDIR$usr_mandir/man1/pman.1" | |
install_exec crashkernel/startup-crashmemory "$DESTDIR$usr_sbindir/startup-crashmemory" | |
install_data crashkernel/startup-crashmemory.service "$DESTDIR$systemdunitdir/startup-crashmemory.service" | |
install_exec mxsnoop/mxsnoop.sh "$DESTDIR$usr_sbindir/mxsnoop.sh" | |
install_exec net_qdisc_nfs_low/net_qdisc_nfs_low "$DESTDIR$usr_sbindir/net_qdisc_nfs_low" | |
install_exec cronwrap/cronwrap "$DESTDIR$usrlocal_bindir/cronwrap" | |
install_exec mxproxmox/proxmox-backup-client.wrapper "$DESTDIR$usr_bindir/proxmox-backup-client.wrapper" | |
install_exec mxproxmox/mxproxmox "$DESTDIR$usr_bindir/mxproxmox" | |
install_data mxproxmox/proxmox-backup.service "$DESTDIR$systemdunitdir/proxmox-backup.service" | |
install_data mxproxmox/proxmox-backup.timer "$DESTDIR$systemdunitdir/proxmox-backup.timer" | |
install_exec kill-exuser/kill-exuser "$DESTDIR$usr_sbindir/kill-exuser" | |
install_data kill-exuser/kill-exuser.service "$DESTDIR$systemdunitdir/kill-exuser.service" | |
install_data kill-exuser/kill-exuser.timer "$DESTDIR$systemdunitdir/kill-exuser.timer" | |
install_data slowio/slowio.slice "$DESTDIR$systemdunitdir/slowio.slice" | |
install_exec slowio/slowio-mem-control "$DESTDIR$sysconfdir/systemd/system-generators/slowio-mem-control" | |
install_exec slowio/slowio "$DESTDIR$usr_sbindir/slowio" | |
install_exec forensics/forensics "$DESTDIR$usr_sbindir/forensics" | |
install_exec forensics/forensicsd "$DESTDIR$usr_sbindir/forensicsd" | |
install_data forensics/forensicsd.service "$DESTDIR$systemdunitdir/forensicsd.service" | |
install_data forensics/forensicsd.timer "$DESTDIR$systemdunitdir/forensicsd.timer" | |
install_exec forensics/mxvmem "$DESTDIR$usr_bindir/mxvmem" | |
for f in libexec_cron/*; do | |
install_exec "$f" "$DESTDIR$usr_exec_prefix/libexec/cron/$(basename "$f")" | |
done | |
for f in libexec_startup/*; do | |
install_exec "$f" "$DESTDIR$usr_exec_prefix/libexec/startup/$(basename "$f")" | |
done | |
install_symlink /etc/local/access.conf "$DESTDIR$sysconfdir/security/access.conf" | |
install_exec mxstartup/mxservicectl "$DESTDIR$usr_sbindir/mxservicectl" | |
install_exec mxstartup/mxstartup2mxconfig "$DESTDIR$usr_sbindir/mxstartup2mxconfig" | |
install_exec mxstartup/mxstartupctl "$DESTDIR$usr_sbindir/mxstartupctl" | |
install_exec mxstartup/mxvipctl "$DESTDIR$usr_sbindir/mxvipctl" | |
install_data mxstartup/mxstartup.service "$DESTDIR$systemdunitdir/mxstartup.service" | |
install_data pdist/pdistd.socket "$DESTDIR$systemdunitdir/pdistd.socket" | |
install_data pdist/pdistd@.service "$DESTDIR$systemdunitdir/pdistd@.service" | |
install_exec pdist/pdist-bootcheck "$DESTDIR$usr_exec_prefix/libexec/pdist-bootcheck" | |
install_data pdist/pdist-bootcheck.service "$DESTDIR$systemdunitdir/pdist-bootcheck.service" | |
install_exec wakeonlan/wake "$DESTDIR$usr_bindir/wake" | |
install_data make-automaps/make-automaps.service "$DESTDIR$systemdunitdir/make-automaps.service" | |
install_exec mxqi/mxqi "$DESTDIR$usr_bindir/mxqi" | |
install_exec mozilla-launcher/mozilla-launcher "$DESTDIR$usr_libdir/mariux64/mozilla_launcher" | |
install_exec mozilla-launcher/fix-thunderbird-amd "$DESTDIR$usr_bindir/fix-thunderbird-amd" | |
postinstall | |
exit |