Commit d1bdbe15 authored by Seblu's avatar Seblu
Browse files

base-seblu: Mutiple updates

- add lz4, diffutils, sed
- Setup basic seblu.net config files
parent 5ab2f125
Loading
Loading
Loading
Loading
+85 −79
Original line number Diff line number Diff line
# Maintainer: Sébastien Luttringer <seblu@archlinux.org>

pkgname=base-seblu
pkgver=2013.07.05
pkgver=2013.09.06
pkgrel=1
pkgdesc='Provide depends on minimal seblu hosts packages'
arch=('any')
@@ -17,6 +17,7 @@ bash
    bash-completion
    bridge-utils
    conntrack-tools
    diffutils
    dmidecode
    dnsutils
    dstat
@@ -49,6 +50,7 @@ lshw
    lsof
    lsscsi
    ltrace
    lz4
    most
    mtr
    munin-node
@@ -71,6 +73,7 @@ rsync
    rxvt-unicode-terminfo
    screen
    sdparm
    sed
    smartmontools
    strace
    stress
@@ -81,10 +84,13 @@ traceroute
    tree
    vi-killer
    vim
    watchdog
    whois
    wget
    zsh
  )
  optdepends=(
  )
  conflicts=(
    consolekit
    initscripts
+46 −7
Original line number Diff line number Diff line
# vim:set ts=2 sw=2 et:

p() {
  echo
  for i in $(seq 1 ${#1}); do echo -n '='; done; echo
  echo "$1"
  for i in $(seq 1 ${#1}); do echo -n '='; done; echo
# $1: the string to be
# $2: the file to update
check_file() {
  if [[ ! -e "$2" ]] || ! diff "$2" <(printf "%s" "$1") >/dev/null; then
    printf "%s" "$1" > "$2"
    echo "** file $2 updated"
  fi
}

# $1: the link target
# $2: the link himself
check_link() {
  _ct="$(readlink "$2")"
  if (( $? != 0 )) || [[ "$_ct" != "$1" ]]; then
    ln -vsnf "$1" "$2"
  fi
}

# arg 1:  the new package version
post_install() {
  _out="$(pacman -Qdt)" && p 'Unused dependencies' && echo "$_out"
  _out="$(pacman -Qm)" && p 'Local-only packages' && echo "$_out"
  # motd
  check_file "" /etc/motd

  # issue
  rm -f /etc/issue.net
  check_file "\n (\s \r) on \l"$'\n' /etc/issue

  # vconsole
  check_file 'KEYMAP=fr'$'\n' /etc/vconsole.conf

  # localtime
  check_link '/usr/share/zoneinfo/Europe/Paris' /etc/localtime

  # locale.conf
  check_file 'LANG=fr_FR.UTF-8'$'\n''LC_MESSAGES=en_US.UTF8'$'\n' /etc/locale.conf

  # locales
  _md5="$(md5sum /etc/locale.gen)"
  sed -ri 's/#(en_US|fr_FR)/\1/' /etc/locale.gen
  [[ "$_md5" != "$(md5sum /etc/locale.gen)" ]] && locale-gen

  # check full hostname
  grep -q \. /etc/hostname || echo '!! /etc/hostname without FQDN'

  # sbin must be a symlink
  [[ -L /usr/local/sbin ]] || echo '!! /usr/local/sbin is not a symlink'

  # display depency info
  echo '-- Unused dependencies:'; pacman -Qdt
  echo '-- Local-only packages'; pacman -Qm
  true
}