]> piware.de Git - bin.git/blob - postinst-setup
postinst-setup: update default packages
[bin.git] / postinst-setup
1 #!/bin/sh -e
2
3 # move backup to /var
4 if [ -d /home/martin/backup ] && [ ! -d /var/backups/martin ]; then
5     cp -a /home/martin/backup /var/backups/martin
6     rm -rf /home/martin/backup
7 fi
8
9 # need bzr and postfix for the setup below
10 DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends postfix openssh-server bzr python-paramiko apt-cacher-ng
11
12 # root's ssh stuff
13 if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then
14     mkdir -p /root/.ssh
15     chmod 700 /root/.ssh
16     cp /home/martin/.ssh/id_rsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/
17 fi
18
19 # restore /etc bzr branch, rescue the files we do not want to restore
20 # completely
21 cd /etc
22 if [ ! -d /etc/.bzr ]; then
23     [ -e /backup-etc ] || bzr branch bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc
24     cp -av /backup-etc/* /etc/
25     cp -av /backup-etc/.bzr/ /etc/
26     rm -rf /backup-etc
27     chmod 600 /etc/ssh/ssh_*_key
28     chmod 700 /etc/ssl/private
29     chmod 640 /etc/ssl/private/ssl-cert-*
30     chown root:ssl-cert /etc/ssl/private/ssl-cert*
31     echo "none /tmp tmpfs defaults 0 0" >> /etc/fstab
32 fi
33
34 # update postfix for new configuration
35 newaliases
36 /etc/init.d/postfix restart
37
38 # remove packages that we do not need
39 killall apt-get || true # cronjob goo
40 apt-get purge -y --auto-remove hplip hplip-data printer-driver-hpcups brltty bluez-cups gnome-accessibility-themes gnome-orca onboard thunderbird || true
41
42 # install packages from network sources
43 killall apt-get || true
44 apt-get update
45
46 DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y --force-yes vim patchutils offlineimap diffstat gtimelog libtool devhelp python3-doc manpages-dev weechat weechat-plugins weechat-scripts wdiff ccache listadmin quilt mutt editmoin lintian ubuntu-dev-tools dput easytag rsnapshot texlive-lang-german texlive-latex-extra powertop qemu-kvm qemu-utils bzr-buildpackage git build-essential fakeroot devscripts libglib2.0-doc libgtk-3-doc git-buildpackage d-feet debootstrap wmctrl libnotify-bin svn-buildpackage pastebinit lptools openvpn pdfjam sbuild schroot exiv2 android-tools-adb phablet-tools gstreamer1.0-plugins-ugly flashplugin-installer valgrind calibre
47
48 apt-get -y --no-install-recommends build-dep postgresql-9.1 apport calibre udisks2 upower systemd pygobject umockdev
49
50 # have schroot use tmpfs
51 rmdir /var/lib/schroot/unpack /var/lib/schroot/union/overlay/
52 ln -s /tmp /var/lib/schroot/unpack
53 ln -s /tmp /var/lib/schroot/union/overlay
54
55 # set up users
56 echo "Setting up users"
57 adduser martin sbuild
58 if ! getent passwd joe > /dev/null; then
59     adduser --gecos "Joe" joe
60     adduser joe audio
61     adduser joe video
62 fi
63
64 # crontabs
65 crontab -u martin - <<EOF
66 # m h  dom mon dow   command
67 05 * * * * \$HOME/bin/backup >/dev/null
68 EOF