Browse Source

Scripting the compilation of xdiskusage

master
fiorile 1 month ago
parent
commit
f1f89fe11c
  1. 41
      neetbsd.sh

41
neetbsd.sh

@ -2,8 +2,6 @@
# NEETBSD # NEETBSD
# #
# DESCRIPTION
#
# NetBSD post-installation script via pkgin <https://pkgin.net/>. # NetBSD post-installation script via pkgin <https://pkgin.net/>.
# #
# DETAILS # DETAILS
@ -20,7 +18,7 @@
echo 'NEETBSD' && echo 'UNFINISHED SCRIPT DO NOT USE' # DEV echo 'NEETBSD' && echo '<!!!> UNFINISHED SCRIPT DO NOT USE' # DEV warning
# SOFTWARE INSTALLATION # SOFTWARE INSTALLATION
@ -29,19 +27,36 @@ echo 'Installing software for NEETBSD'
# BINARY PACKAGES via pkgin # BINARY PACKAGES via pkgin
echo 'Installing binary packages via the root user using su' echo 'Installing binary packages via the root user using su'
echo 'This operation might take a long moment to complete!!' echo 'This operation might take a long moment to complete!!'
su root 'pkgin install enlightenment firefox-esr xfe grafx2 dillo mumble psi kvirc lxqt-archiver stalonetray htop mc ncdu ufetch wget' # FIX-ME: uncertain packages are left out - xine/mpv(?) and [xterm](terminology) # <!!!> ncdu is ambiguous su root -c 'pkgin install enlightenment firefox-esr xfe grafx2 dillo mumble psi kvirc lxqt-archiver stalonetray htop mc ncdu ufetch wget' # FIX-ME: uncertain packages are left out - xine/mpv(?) and [xterm](terminology) # <!!!> ncdu is ambiguous
# COMPILATION via various utilities # COMPILATION via various utilities
echo 'Software compilation - this operation should be rapid' echo 'Software compilation - this operation should be rapid'
echo 'Compiling xdiskusage' # Is it installed? `command -v` is +/- equivalent to `which`
# TO-DO if [ -x "$(command -v xdiskusage)" ]; then
# = CHECK IF ALREADY INSTALLED VIA which echo 'xdiskusage is already installed.'
# CHECK VERSION VIA curl https://xdiskusage.sourceforge.net/ | grep '1.60' else
# su to pkgin install fltk-1.3.9, wget, tar, change line where there's echo 'Compiling xdiskusage'
# FreeBSD to also include NetBSD, ./configure && make CPPFLAGS= echo '<!!!> xdiskusage version 1.60 - please check if this is the latest!'
# -I/usr/pkg/include [+ other arg to include X11 /usr/X11R7/include] && su curl --silent https://xdiskusage.sourceforge.net/ | grep 'Download source'
# to make install clean + verify if there is a .desktop else create it sleep 5 # Some time to read the above warning and result
echo 'Software compilation done' su root -c 'pkgin install fltk-1.3.9' # FLTK is the sole dependency
wget https://xdiskusage.sourceforge.net/xdiskusage-1.60.tgz # Download src
mv xdiskusage-1.60.tgz /tmp # This operation shall be done in a tmp area
cd /tmp
tar xfv xdiskusage-1.60.tgz # Extract
cd xdiskusage-1.60
ed xdiskusage.C <<'END' # ed(1) replacing 'APPLE' with 'NetBSD'
s/defined(__APPLE__)/defined(__NetBSD__)/g
wq
END # xdiskusage now acts like the FreeBSD version - probably hacky, but it seems functional
# Configure, compile, install, clean
./configure && make CPPFLAGS=-I/usr/pkg/include -I/usr/X11R7/include && su root -c 'make install clean'
# .desktop
su root -c 'printf "[Desktop Entry]\nType=Application\nName=xdiskusage\nComment=Graphical disk usage program\nTerminal=false\nTryExec=xdiskusage\nExec=/usr/local/bin/xdiskusage\nCategories=Utility" > /usr/share/applications/xdiskusage.desktop'
cd .. # Go back to /tmp
rm -r /tmp/xdiskusage-1.60* # Erase tmp compilation data
echo 'Software compilation done'
fi
echo 'SOFTWARE INSTALLATION FINISHED' echo 'SOFTWARE INSTALLATION FINISHED'

Loading…
Cancel
Save