diff --git a/neetbsd.sh b/neetbsd.sh index 16c42c5..d0880f7 100644 --- a/neetbsd.sh +++ b/neetbsd.sh @@ -2,8 +2,6 @@ # NEETBSD # -# DESCRIPTION -# # NetBSD post-installation script via pkgin . # # 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 @@ -29,19 +27,36 @@ echo 'Installing software for NEETBSD' # BINARY PACKAGES via pkgin echo 'Installing binary packages via the root user using su' 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 echo 'Software compilation - this operation should be rapid' -echo 'Compiling xdiskusage' -# TO-DO -# = CHECK IF ALREADY INSTALLED VIA which -# CHECK VERSION VIA curl https://xdiskusage.sourceforge.net/ | grep '1.60' -# su to pkgin install fltk-1.3.9, wget, tar, change line where there's -# FreeBSD to also include NetBSD, ./configure && make CPPFLAGS= -# -I/usr/pkg/include [+ other arg to include X11 /usr/X11R7/include] && su -# to make install clean + verify if there is a .desktop else create it -echo 'Software compilation done' +# Is it installed? `command -v` is +/- equivalent to `which` +if [ -x "$(command -v xdiskusage)" ]; then + echo 'xdiskusage is already installed.' +else + echo 'Compiling xdiskusage' + echo ' xdiskusage version 1.60 - please check if this is the latest!' + curl --silent https://xdiskusage.sourceforge.net/ | grep 'Download source' + sleep 5 # Some time to read the above warning and result + 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'