summaryrefslogtreecommitdiff
path: root/autoinstall/bootstrap/bootstrap-wheezy-script.txt
diff options
context:
space:
mode:
Diffstat (limited to 'autoinstall/bootstrap/bootstrap-wheezy-script.txt')
-rw-r--r--autoinstall/bootstrap/bootstrap-wheezy-script.txt193
1 files changed, 3 insertions, 190 deletions
diff --git a/autoinstall/bootstrap/bootstrap-wheezy-script.txt b/autoinstall/bootstrap/bootstrap-wheezy-script.txt
index 376382d..2c363ec 100644
--- a/autoinstall/bootstrap/bootstrap-wheezy-script.txt
+++ b/autoinstall/bootstrap/bootstrap-wheezy-script.txt
@@ -1,202 +1,15 @@
#!/bin/bash
-# Add kolab user to sudo group and give sudo permissions without password
-gpasswd -a kolab sudo
-sed -r -i -e 's/%sudo.*$/%sudo ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers
-
-# Add IP address to /etc/issue
-expr="s/\s\\n\s/$(ip addr sh dev eth0 | grep -E "\s+inet\s" | awk '{print $2}')/g"
-sed -i -e $expr /etc/issue
-
# Add the kolab repository.
cat > /etc/apt/sources.list.d/kolab-3.0.list << EOF
deb http://mirror.kolabsys.com/pub/debian/kolab-3.0 wheezy development
deb-src http://mirror.kolabsys.com/pub/debian/kolab-3.0 wheezy development
EOF
-cat > /etc/apt/preferences.d/kolab << EOF
-Package: *
-Pin: origin mirror.kolabsys.com
-Pin-Priority: 501
-EOF
-
apt-get update || :
-apt-get -y --force-yes build-dep \
- 389-admin 389-adminutil 389-console 389-ds-base 389-ds-console 389-dsgw \
- apache2 cyrus-imapd jss ldapjdk libapache2-mod-nss libcalendaring libkolab \
- libkolabxml libmozilla-ldap-perl mozilla-ldap-sdk php5 pykolab roundcube \
- roundcube-plugins-extra || :
-
-apt-get -y --force-yes install \
- build-essential cowbuilder debhelper devscripts dh-make dh-autoreconf \
- fakeroot git-buildpackage libcurl4-gnutls-dev lintian openssh-server \
- pbuilder pkg-kde-tools quilt sudo vim wget || :
-
-mkdir -p /home/kolab/bin
-cat > /home/kolab/bin/reinit-cowbuilder << EOF
-#!/bin/bash
-
-for ARCH in i386 amd64; do
- for DIST in precise quantal wheezy sid; do
- . \${HOME}/.pbuilderrc
- sudo rm -rf /var/cache/pbuilder/base-\${DIST}-\${ARCH}.cow
- sudo cowbuilder --create \
- --architecture \${ARCH} --distribution \${DIST} \
- --basepath /var/cache/pbuilder/base-\${DIST}-\${ARCH}.cow \
- --mirror \${MIRRORSITE}
- done
-done
-EOF
-chmod 755 /home/kolab/bin/reinit-cowbuilder
-
-mkdir -p /root/.ssh
-cat > /root/.ssh/known_hosts << EOF
-git.kolabsys.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAoSSetGj23+QtuBaRA93W5HDofS0HW4lXmXpkxFjRQi/pzCSCfo8CmVnDN/woKBlvUfi9u4iKBMAhm0LkndvZOHYpGHxVAq65CXDcjyg9ZtS0SGOsD8EvuNa3Y+zVXHzF0h6ehoAgHI0r9lE/cSfqanJujSrzPV1Ro/jkSF+IQm7ibCXabk4dZfqSUDwp6lnde8mG+0KcHzwlkKacEQDZOThNO0RPl30nJI5uUkgWHsiY+lgzd4d2N7+IMHwlGhBN9aXwNEkShQrgZ3W5uLhpAIvHi5FkJhJwjMi6iI5K3NQGlc1TFSzoZOMy1we2NeDJk965+8cz6ZbJno0GZAz0Aw==
-EOF
-cat > /root/.ssh/authorized_keys << EOF
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuYwrguPlzuOXUNV9AwtbduNy0Waq1crncyb8ijHNEng4SX/kMhqULK4Z6g0Go5vXFzkabmQqHvRPxi5jtTN+P80xsdqEznKETbyjiPnw56qLYERf1UvTUl41yMTgrB9M7/74cD1RnpjnMKU/KRUelWtv/xzpVvYoMsNBZlS64cCRXvrE2z7tZC2hdBKPU+6yeUSe1HVwklMzhAvCpPplN7riVO6hV4J1QCdLFpS8cScIYKBo7f6Xrt3aWOsmMr9OJx2CZiJkwYLotSkbf5VFMAsJhaSnO8UTNNEOZFkIU7My0+u2oyfQX2vuaaVaJix1gsNLW4q3bqvW5+XaNJuiZ kanarip@kanarip.com
-EOF
-chmod 700 /root/.ssh
-chmod 600 /root/.ssh/authorized_keys
-
-mkdir -p /home/kolab/.ssh
-cat > /home/kolab/.ssh/known_hosts << EOF
-git.kolabsys.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAoSSetGj23+QtuBaRA93W5HDofS0HW4lXmXpkxFjRQi/pzCSCfo8CmVnDN/woKBlvUfi9u4iKBMAhm0LkndvZOHYpGHxVAq65CXDcjyg9ZtS0SGOsD8EvuNa3Y+zVXHzF0h6ehoAgHI0r9lE/cSfqanJujSrzPV1Ro/jkSF+IQm7ibCXabk4dZfqSUDwp6lnde8mG+0KcHzwlkKacEQDZOThNO0RPl30nJI5uUkgWHsiY+lgzd4d2N7+IMHwlGhBN9aXwNEkShQrgZ3W5uLhpAIvHi5FkJhJwjMi6iI5K3NQGlc1TFSzoZOMy1we2NeDJk965+8cz6ZbJno0GZAz0Aw==
-EOF
-cat > /home/kolab/.ssh/authorized_keys << EOF
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuYwrguPlzuOXUNV9AwtbduNy0Waq1crncyb8ijHNEng4SX/kMhqULK4Z6g0Go5vXFzkabmQqHvRPxi5jtTN+P80xsdqEznKETbyjiPnw56qLYERf1UvTUl41yMTgrB9M7/74cD1RnpjnMKU/KRUelWtv/xzpVvYoMsNBZlS64cCRXvrE2z7tZC2hdBKPU+6yeUSe1HVwklMzhAvCpPplN7riVO6hV4J1QCdLFpS8cScIYKBo7f6Xrt3aWOsmMr9OJx2CZiJkwYLotSkbf5VFMAsJhaSnO8UTNNEOZFkIU7My0+u2oyfQX2vuaaVaJix1gsNLW4q3bqvW5+XaNJuiZ kanarip@kanarip.com
-EOF
-chmod 700 /home/kolab/.ssh
-chmod 600 /home/kolab/.ssh/authorized_keys
-
-# Initialize the Kolab user account for building
-cat > /home/kolab/.devscripts << EOF
-DEBUILD_DPKG_BUILDPACKAGE_OPTS="-i.git/ -I.git/ -us -uc -sa"
-EOF
-
-cat > /home/kolab/.bashrc << EOF
-# .bashrc
-
-# Source global definitions
-if [ -f /etc/bashrc ]; then
- . /etc/bashrc
-fi
-
-# Set PATH before searching for sudo_utils
-export PATH=\$HOME/bin:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
-
-# User specific aliases and functions
-export HISTSIZE=9999999
-export SVN_EDITOR=vim
-export EDITOR=vim
-export TMP=\$HOME/tmp
-export TMPDIR=\$HOME/tmp
-export DEBEMAIL=vanmeeuwen@kolabsys.com
-export DEBFULLNAME="Jeroen van Meeuwen (Kolab Systems)"
-
-export LS_OPTIONS='--color=auto'
-eval "\$(dircolors)"
-alias ls='ls \$LS_OPTIONS'
-alias ll='ls \$LS_OPTIONS -l'
-alias l='ls \$LS_OPTIONS -lA'
-alias rm='rm -i'
-alias cp='cp -i'
-alias mv='mv -i'
-
-export GIT_PS1_SHOWDIRTYSTATE=1
-export GIT_PS1_SHOWUNTRACKEDFILES=1
-export GIT_PS1_SHOWUPSTREAM="auto verbose"
-
-if [ ! -f "/etc/bash_completion" ]; then
- if [ -f "/etc/bash_completion.d/git" ]; then
- cp /etc/bash_completion.d/git ~/.git-completion.sh
- . ~/.git-completion.sh
- PS1='[\u@\h \W\$(__git_ps1 " (%s)")]\\$ '
- fi
-else
- PS1='[\u@\h \W\$(__git_ps1 " (%s)")]\\$ '
-fi
-EOF
-
-ln -sf /home/kolab/.bashrc /root/.bashrc
-
-cat > /home/kolab/.dupload.conf << EOF
-package config;
-\$preupload{'changes'} = "echo Starting %1";
-
-\$cfg{'pub-3.0-wheezy-dev'} = {
- 'fqdn' => 'mirror.kolabsys.com',
- 'method' => 'scpb',
- 'login' => 'vanmeeuwen',
- 'incoming' => '/srv/mirror/public/debian/kolab-3.0/incoming/wheezy/development/',
- 'dinstall_runs' => 1
- };
-
-1;
-EOF
-
-cat > /home/kolab/.gitignore << EOF
-[user]
- name = Jeroen van Meeuwen (Kolab Systems)
- email = vanmeeuwen
-EOF
-
-cat > /home/kolab/.pbuilderrc << EOF
-# do not specify variables when running cowbuilder --create or --update
-if [ -f debian/changelog ]; then
- [ -z "\$ARCH" ] && ARCH=\$(dpkg --print-architecture)
- [ -z "\$DIST" ] && DIST=\$(dpkg-parsechangelog | sed -n 's/^Distribution: //p')
-fi
-
-if [ "\${DIST}" == "squeeze" -o "\${DIST}" == "wheezy" -o "\${DIST}" == "sid" ]; then
- MIRRORSITE=http://ftp.uk.debian.org/debian
-else
- MIRRORSITE=http://mirror.krystal.co.uk/ubuntu/
-fi
-
-DEBOOTSTRAPOPTS[${#DEBOOTSTRAPOPTS[@]}]="--no-check-gpg"
-PDEBUILD_PBUILDER="cowbuilder --build --basepath /var/cache/pbuilder/base-\${DIST}-\${ARCH}.cow --mirror \${MIRRORSITE}"
-DEBBUILDOPTS="-us -uc -sa -d \${OPTS}"
-ARCHITECTURE=\${ARCH}
-BUILDRESULT=~/builds
-EXTRAPACKAGES="\$EXTRAPACKAGES lintian"
-AUTO_DEBSIGN=no
-HOOKDIR=\${HOME}/.pbuilder/hooks/
-PKGNAME_LOGFILE_EXTENTION="_\${ARCH}.build"
-EOF
-
-ln -sf /home/kolab/.pbuilderrc /root/.pbuilderrc
-
-# Initialize .quiltrc (from http://www.debian.org/doc/manuals/maint-guide/modify.en.html)
-cat > /home/kolab/.quiltrc << EOF
-d=. ; while [ ! -d \$d/debian -a \$(readlink -e \$d) != / ]; do d=\$d/..; done
-if [ -d \$d/debian ] && [ -z \$QUILT_PATCHES ]; then
- # if in Debian packaging tree with unset \$QUILT_PATCHES
- QUILT_PATCHES="debian/patches"
- QUILT_PATCH_OPTS="--reject-format=unified"
- QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
- QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
- QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
- if ! [ -d \$d/debian/patches ]; then mkdir \$d/debian/patches; fi
-fi
-EOF
-
-# Set some vimrc's to the usual 4 spaces for an indentation level
-cat > /root/.vimrc << EOF
-set shiftwidth=4
-set tabstop=4
-set expandtab
-EOF
-
-cat > /home/kolab/.vimrc << EOF
-set shiftwidth=4
-set tabstop=4
-set expandtab
-EOF
-
-wget -q -O/tmp/git-clone-apt-packaging-repositories.sh "http://hosted.kolabsys.com/~vanmeeuwen/git-clone-apt-packaging-repositories.txt"
-chmod 755 /tmp/git-clone-apt-packaging-repositories.sh
-/tmp/git-clone-apt-packaging-repositories.sh
+wget -q -O/tmp/common.sh "http://git.kolab.org/kolab-scripts/plain/autoinstall/bootstrap/common.txt"
+chmod 755 /tmp/common.sh
+/tmp/common.sh
chown -R kolab:kolab ~kolab