# See the License for the specific language governing permissions and
# limitations under the License.
+### setup
errcatch
+src="${BASH_SOURCE%/*}"
+source $src/pkgs
set -x
-
exec &> >(sudo tee -a /var/log/distro-end)
echo "$0: $(date): starting now)"
-
-src="${BASH_SOURCE%/*}"
-
-source $src/pkgs
-
# see example of usage to understand.
end_msg() {
local y
IFS= read -r -d '' y ||:
end_msg_var+="$y"
}
-
spa() { # simple package add
simple_packages+=($@)
}
-
distro=$(distro-name)
-
pending_reboot=false
sed="sed --follow-symlinks"
-
# template
case $distro in
esac
+#### initial packages
pup
if isdeb; then
pi aptitude
fi
-simple_packages=(${p3[@]})
-
-case $HOSTNAME in
- lj|li) : ;;
- *)
- simple_packages+=(${p4[@]})
- spa $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}')
- ;;
-esac
-
-
########### begin section including li ################
+pi ${p3[@]} $($src/distro-pkgs)
conflink
case $distro in
- arch)
- # ubuntu 14.04 uses b-cron,
- # but its not maintained in arch.
- # of the ones in the main repos, cronie is only one maintained.
- # fcron appears abandoned software.
- pi cronie
- sgo cronie
- ;;
- *) : ;; # other distros come with cron.
+ arch) sgo cronie ;;
esac
-
-
case $distro in
- *) pi at ;;&
arch) sgo atd ;;
esac
case $distro in
- debian|trisquel|ubuntu) pi curl;;
- arch) : ;;
- # fedora: unknown
-esac
-
-case $distro in
- # tk for gitk
- arch) spa git tk ;;
- *) spa git ;;
-esac
-
-case $distro in
- arch) spa the_silver_searcher ;;
- debian|trisquel|ubuntu) spa silversearcher-ag ;;
- # fedora unknown
-esac
-
-case $distro in
- debian|trisquel|ubuntu) spa ntp;;
- arch)
- pi ntp
- sgo ntpd
- ;;
- # others unknown
+ arch) sgo ntpd ;;
esac
# no equivalent in other distros:
case $distro in
debian|trisquel|ubuntu)
- pi aptitude
if ! dpkg -s apt-file &>/dev/null; then
# this condition is just a speed optimization
pi apt-file
s apt-file update
fi
- # for debconf-get-selections
- spa debconf-utils
;;
esac
-case $distro in
- arch|debian|trisquel|ubuntu)
- spa bash-completion
- ;;
- # others unknown
-esac
-
-
-
-
-
# disable motd junk.
case $distro in
debian)
setup-debian-auto-update
fi
-# we've got a few dependencies later on, so install them now.
-pi eatmydata; PI_PREFIX=eatmydata
-pi "${simple_packages[@]}"
-simple_packages=()
-
### begin docker install ####
-
if isdeb; then
# https://store.docker.com/editions/community/docker-ce-server-debian?tab=description
pi software-properties-common apt-transport-https
# website setup
case $HOSTNAME in
lj|li)
-
case $HOSTNAME in
lj) domain=iank.bid; exit 0 ;;
li) domain=iankelling.org ;;
;;
esac
-
-# needed for checkrestart
-if isdeb; then
- spa debian-goodies
-fi
-
-
-
########### end section including li/lj ###############
-case $distro in
- debian) spa gnome-session-flashback ;;
- # flidas is missing dependency gnome-panel. others unknown
-esac
-
+pi ${p4[@]} $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}')
-case $distro in
- trisquel|ubuntu|debian) spa ack-grep ;;
- arch|fedora) spa ack ;;
- # fedora unknown
-esac
;;
esac
-case $distro in
- debian)
- spa cpio-doc ;;
- # not packaged in flidas. others unknown. gfdl nonfree issue
-esac
-
-
-
-
-case $distro in
- fedora) spa unrar ;;
- *) spa unrar-free ;;
-esac
-
### begin home vpn server setup
if [[ $HOSTNAME == tp ]]; then
+ ##### rss2email
# note, see bashrc for more documentation.
pi rss2email
s dd of=/etc/systemd/system/rss2email.service <<'EOF'
sgo rss2email.timer
fi
+
######### begin pump.io periodic backup #############
if [[ $HOSTNAME == frodo ]]; then
s dd of=/etc/systemd/system/pumpbackup.service <<'EOF'
fi
######### end pump.io periodic backup #############
+
case $distro in
debian|trisquel|ubuntu)
# suggests because we want the resolvconf package. however, i install it earlier
spa lib32stdc++6 default-jdk
+############# begin syncthing setup ###########
if [[ $HOSTNAME == frodo ]]; then
- ############# begin syncthing setup ###########
-
# It\'s simpler to just worry about running it in one place for now.
# I assume it would work to clone it\'s config to another non-phone
# and just run it in one place instead of the normal having a
# Note, the other thing i did was port forward port 22000,
# per https://docs.syncthing.net/users/firewall.html
- ############# end syncthing setup ###########
fi
+############# end syncthing setup ###########
-# no equivalent in other distros:
-case $distro in
- debian|trisquel|ubuntu)
- # for gui bug reporting
- spa python-vte
- ;;
-esac
-
-
####### begin misc packages ###########
reset-sakura
EOF
done
fi
+######### end transmission client setup ######
# dunno why it\'s there, but get rid of it
case $HOSTNAME in
esac
-# printer
+### printer setup
case $distro in
arch)
pi cups ghostscript gsfonts # from arch wiki cups page
trisquel|ubuntu|debian) pi --no-install-recommends mairix notmuch ;;
fedora|arch) spa mairix notmuch ;;
esac
-case $distro in
- arch) spa nfs-utils ;;
- trisquel|ubuntu|debian) spa nfs-client ;;
-esac
-case $distro in
- trisquel|ubuntu|debian) spa par2 ;;
- arch|fedora) spa par2cmdline ;;
-esac
-
-# needed for my tex resume
-case $distro in
- trisquel|ubuntu|debian) spa texlive-full ;;
- arch) spa texlive-most ;;
- # fedora unknown
-esac
-
-
-case $distro in
- # optional dep for firefox for h.264 video
- arch) spa gst-libav ;;
- # other distros, probably come by default
-esac
-case $distro in
- fedora|trisquel|ubuntu|debian) spa gnupg-agent ;;
- arch) : ;;
-esac
-
-
-case $distro in
- fedora) spa pinentry-gtk ;;
- *) : ;; # comes default or with other packages
-esac
-
-case $distro in
- arch) spa firefox pulseaudio;;
- trisquel) spa abrowser ;;
- *) : ;; # comes default or with other packages, or uknown
-esac
-
-
-case $distro in
- arch) spa ttf-dejavu;;
- debian|trisquel|ubuntu) spa fonts-dejavu ;;
- # others unknown
-esac
-
-
-case $distro in
- arch) spa xorg-xev;;
- debian|trisquel|ubuntu) spa x11-utils ;;
- # others unknown
-esac
-
-case $distro in
- arch) pi virt-install;;&
- debian|trisquel|ubuntu) pi virtinst ;;&
- *) pi virt-manager ;; # creates the libvirt group in debian at least
- # others unknown
-esac
# allow user to run vms, from debian handbook
for x in iank traci; do s usermod -a -G libvirt,kvm $x; done
# bridge networking as user fails. google lead here, but it doesn\'t work:
# #s chown root:qemu $f # debian has somethig like qemu-libvirt. equivalent?
# s chmod 640 $f
-
-case $distro in
- arch) spa cdrkit;;
- debian|trisquel|ubuntu) spa genisoimage;;
- # others unknown
-esac
-
-case $distro in
- arch) spa spice-gtk3 ;;
- debian|trisquel|ubuntu) spa spice-client-gtk;;
- # others unknown
-esac
-
# general known for debian/ubuntu, not for fedora
case $distro in
debian|trisquel|ubuntu)
- pi golang-go
# a bit of googling, and added settings to bashrc
go get -u github.com/mvdan/fdroidcl/cmd/fdroidcl
;;
- # others unknown
esac
-
case $distro in
arch)
- # cdrkit for cloud-init isos
- # dnsmasq & ebtables for nat networking in libvirt
- # qemu for qemu-img, bind-tools for dig
- # dmidecode just because syslog complains
- pi unzip xorg-xmodmap dmidecode ebtables\
- bridge-utils dnsmasq qemu bind-tools
# otherwise we get error about accessing kvm module.
# seems like there might be a better way, but google was a bit vague.
s $sed -ri '/^ *user *=/d' /etc/libvirt/qemu.conf
# guessing this is not needed
#sgo virtlogd.service
sgo libvirtd
-
;;
esac
-case $distro in
- arch) pi virtviewer ;;
- *) : ;; # other distros have it as a dependency afaik.
-esac
-
-
-
-case $distro in
- fedora) cabal install shellcheck ;;
- *) spa shellcheck ;;
- # unknown for older ubuntu
-esac
-
-
-case $distro in
- arch|debian|trisquel|ubuntu) spa pumpa ;;
- # others unknown. do have a buildscript:
- # /a/bin/buildscripts/pumpa ;;
-esac
-
-
-case $distro in
- debian) pi adb ;;
- debian|trisquel|ubuntu) spa android-tools-adbd ;;
- # todo: not sure this is needed anymore, or if trisqel etc works even
- # debian) spa android-tools-adbd/unstable ;;
- arch) spa android-tools ;;
- # other distros unknown
-esac
-
-
case $distro in
fedora)
esac
-case $distro in
- debian)
- pi task-mate-desktop
- # in settings, change scrolling to two-finger,
- # because the default edge scroll doesn\'t work.
- pu transmission-gtk
- ;;
- trisquel)
- # mate-indicator-applet and beyond are msc things I noticed diffing a
- # standard install with mine.
- pi xorg lightdm mate-desktop-environment mate-desktop-environment-extras mate-indicator-applet anacron
- ;;
- # others unknown
-esac
-
-case $distro in
- arch) spa apg ;;
- # already in debian
-esac
-
-
-
# note this failed running at the beginning of this file,
# esac
cd /a/opt/btrbk
s make install
-spa pv # for progress bar when running interactively.
# ian: temporarily disabled while hosts are in flux.
# if [[ $HOSTNAME == tp ]]; then
# fi
+end_msg <<'EOF'
+In mate settings settings, change scrolling to two-finger,
+because the default edge scroll doesn\'t work. Originally found this in debian.
+EOF
+
+case $distro in
+ debian)
+ # remove dep that came in with desktop
+ pu transmission-gtk
+ ;;
+ esac
case $distro in
debian|trisquel|ubuntu) s gpasswd -a iank adm ;; #needed for reading logs
esac
-# tor
+#### tor
case $distro in
# based on
# https://www.torproject.org/docs/rpms.html.en
# https://www.torproject.org/docs/debian.html.en
# todo: figure out if the running service needs to be restarted upon updates
-
-
# todo on fedora: setup non-dev packages
fedora)
s dd of=/etc/yum.repos.d/torproject.repo <<'EOF'
e "$end_msg_var"
-# persistent virtual machines
-case $distro in
- debian|trisquel|ubuntu)
- pi libosinfo-bin;
- ;;
-esac
+
# if I was going to create a persistent vm, i might do it like this:
# variant=something # from: virt-install --os-variant list
# s virt-install --noautoconsole --graphics spice,listen=0.0.0.0 \
######### begin stuff belonging at the end ##########
-case $distro in
- ubuntu|debian)
- spa spacefm-gtk3 ;;
- arch)
- spa spacefm ;;
-esac
-
-
-pi "${simple_packages[@]}"
-
-
if $pending_reboot; then
echo "$0: pending reboot and then finished. doing it now."
s reboot now
--- /dev/null
+#!/bin/bash -l
+
+errcatch
+
+
+usage() {
+ cat <<EOF
+Usage: ${0##*/} [DISTRO_NAME]
+Print packages to install for each distro.
+Default DISTRO_NAME is the one currently running.
+
+
+-h|--help Print help and exit.
+
+Note: Uses GNU getopt options parsing style
+EOF
+ exit $1
+}
+
+if [[ $1 ]]; then
+ distro=$1
+else
+ distro=$(distro-name)
+fi
+
+isdeb() {
+ case $distro in
+ debian|trisquel|ubuntu)
+ return 0
+ ;;
+ esac
+ return 1
+}
+
+bool_opt=false # default
+long_opt=foo # default
+temp=$(getopt -l help,long-opt: hso: "$@") || usage 1
+eval set -- "$temp"
+while true; do
+ case $1 in
+ -s) bool_opt=true; shift ;;
+ -o|--long-opt) long_opt="$2"; shift 2 ;;
+ -h|--help) usage ;;
+ --) shift; break ;;
+ *) echo "$0: Internal error! unexpected args: $*" ; exit 1 ;;
+ esac
+done
+
+
+case $distro in
+ arch)
+ # ubuntu 14.04 uses b-cron,
+ # but its not maintained in arch.
+ # of the ones in the main repos, cronie is only one maintained.
+ # fcron appears abandoned software.
+ e cronie
+ ;;
+ *) : ;; # other distros come with cron.
+esac
+
+case $distro in
+ arch) e tk ;;
+ *) : ;; # other distros come with tk from git
+esac
+
+case $distro in
+ arch) e the_silver_searcher ;;
+ debian|trisquel|ubuntu) e silversearcher-ag ;;
+ # fedora unknown
+esac
+
+if isdeb; then
+ # for debconf-get-selections
+ e debconf-utils
+fi
+
+# needed for checkrestart
+if isdeb; then
+ e debian-goodies
+fi
+
+###### quit now for li/lj
+case $HOSTNAME in
+ lj|li)
+ exit 0
+ ;;
+esac
+
+case $distro in
+ debian) e gnome-session-flashback ;;
+ # flidas is missing dependency gnome-panel. others unknown
+esac
+
+case $distro in
+ trisquel|ubuntu|debian) e ack-grep ;;
+ arch|fedora) e ack ;;
+ # fedora unknown
+esac
+
+case $distro in
+ debian)
+ e cpio-doc ;;
+ # not packaged in flidas. in ubuntu it is in multiverse
+esac
+
+case $distro in
+ fedora) e unrar ;;
+ *) e unrar-free ;;
+esac
+
+case $distro in
+ debian|trisquel|ubuntu)
+ # for gui bug reporting
+ e python-vte
+ ;;
+ # no equivalent in other distros:
+esac
+
+case $distro in
+ arch) e nfs-utils ;;
+ trisquel|ubuntu|debian) e nfs-client ;;
+esac
+
+case $distro in
+ trisquel|ubuntu|debian) e par2 ;;
+ arch|fedora) e par2cmdline ;;
+esac
+
+# needed for my tex resume
+case $distro in
+ trisquel|ubuntu|debian) e texlive-full ;;
+ arch) e texlive-most ;;
+ # fedora unknown
+esac
+
+case $distro in
+ # optional dep for firefox for h.264 video
+ arch) e gst-libav ;;
+ # other distros, probably come by default
+esac
+
+case $distro in
+ fedora|trisquel|ubuntu|debian) e gnupg-agent ;;
+ arch) : ;;
+esac
+
+
+case $distro in
+ fedora) e pinentry-gtk ;;
+ *) : ;; # comes default or with other packages
+esac
+
+case $distro in
+ arch) e firefox pulseaudio;;
+ trisquel) e abrowser ;;
+ *) : ;; # comes default or with other packages, or uknown
+esac
+
+
+case $distro in
+ arch) e ttf-dejavu;;
+ debian|trisquel|ubuntu) e fonts-dejavu ;;
+ # others unknown
+esac
+
+
+case $distro in
+ arch) e xorg-xev;;
+ debian|trisquel|ubuntu) e x11-utils ;;
+ # others unknown
+esac
+
+case $distro in
+ arch) e virt-install;;&
+ debian|trisquel|ubuntu) e virtinst ;;&
+ *) e virt-manager ;; # creates the libvirt group in debian at least
+ # others unknown
+esac
+
+
+
+case $distro in
+ arch) e cdrkit;;
+ debian|trisquel|ubuntu) e genisoimage;;
+ # others unknown
+esac
+
+case $distro in
+ arch) e spice-gtk3 ;;
+ debian|trisquel|ubuntu) e spice-client-gtk;;
+ # others unknown
+esac
+
+case $distro in
+ debian|trisquel|ubuntu)
+ # fdroidcl dependency
+ e golang-go
+ ;;
+ # others unknown
+esac
+
+
+### stuff brought in through deps in other distros
+case $distro in
+ arch)
+ # for nat networking in libvirt
+ e ebtables
+ # dmidecode just because syslog complains
+ e dmidecode
+ e unzip xorg-xmodmap bridge-utils qemu virtviewer apg
+ # for dig
+ e bind-tools
+ ;;
+esac
+
+case $distro in
+ fedora) cabal install shellcheck ;;
+ *) e shellcheck ;;
+ # unknown for older ubuntu
+esac
+
+case $distro in
+ arch|debian|trisquel|ubuntu) e pumpa ;;
+ # others unknown. do have a buildscript:
+ # /a/bin/buildscripts/pumpa ;;
+esac
+
+case $distro in
+ debian) e adb ;;
+ debian|trisquel|ubuntu) e android-tools-adbd ;;
+ # todo: not sure this is needed anymore, or if trisqel etc works even
+ # debian) e android-tools-adbd/unstable ;;
+ arch) e android-tools ;;
+ # other distros unknown
+esac
+
+#### desktopy stuff
+case $distro in
+ debian)
+ e task-mate-desktop
+ ;;
+ trisquel)
+ # mate-indicator-applet and beyond are msc things I noticed diffing a
+ # standard install with mine.
+ e xorg lightdm mate-desktop-environment mate-desktop-environment-extras mate-indicator-applet anacron
+ ;;
+ # others unknown
+esac
+
+case $distro in
+ debian|trisquel|ubuntu)
+ e libosinfo-bin;
+ ;;
+ # others unknown
+esac
+
+case $distro in
+ ubuntu|debian)
+ e spacefm-gtk3 ;;
+ arch)
+ e spacefm ;;
+esac