summaryrefslogtreecommitdiff
path: root/community/ultimate-ircd/PKGBUILD
blob: dcbdf5b7332f1b7e4b52cabd170391194e30fdeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# $Id: PKGBUILD 90729 2013-05-13 14:39:21Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=ultimate-ircd
pkgver=3.0.2
pkgrel=7
pkgdesc="ultimate irc server"
arch=(i686 x86_64 'mips64el')
url="http://www.shadow-realm.org/"
license=("GPL")
depends=(glibc)
makedepends=(patch)
conflicts=(ircd)
provides=(ircd)
backup=()
install=ircd.install
source=(http://downloads.sourceforge.net/sourceforge/ultimate/Ultimate$pkgver.tar.bz2
	ultimate-ircd.service
	ultimate-ircd.tmpfiles
	conf-fix.patch)
md5sums=('8bc14b97d22a3ce3415cc0540ae459f6'
         '526fd78018b9b011787e4e9012437116'
         'e51723ab29e7a3ddc3589846815de0c9'
         '5e0f2a02e12675ac070a148c3234e111')

build() {
  cd $srcdir/Ultimate$pkgver
  ./configure --prefix=/usr --enable-chinese-nick

  for i in `find -type f -name Makefile`; do
    echo Patching $i...
    sed -i "s#prefix		= /usr#prefix		= $pkgdir/usr#" $i
    sed -i "s#libexecdir	= \${bindir}#libexecdir	= $pkgdir/usr/lib/ircd#" $i
    sed -i "s#sysconfdir	= \${prefix}/etc#sysconfdir	= $pkgdir/etc/ircd#" $i
    sed -i "s#localstatedir	= \${prefix}#localstatedir	= $pkgdir/var#" $i
    sed -i "s#networksubdir   = \${prefix}/etc/networks#networksubdir   = $pkgdir/etc/ircd/networks#" $i
    sed -i "s#\$(localstatedir)/logs#\$(localstatedir)/log/ircd#" $i
  done

  cd include && patch -N <../../conf-fix.patch && cd ..
  make || return 1
}

package() {
  cd $srcdir/Ultimate$pkgver
  mkdir -p $pkgdir/usr/bin
  mkdir -p $pkgdir/var/log/ircd
  mkdir -p $pkgdir/etc/ircd/networks
  make install
  rm -f $pkgdir/usr/ircd
  rm -f $pkgdir/usr/kill
  rm -f $pkgdir/usr/rehash
  cd $pkgdir/usr/bin
  mv mkpasswd irc-mkpasswd
  mv ssl-cert.sh irc-ssl-cert.sh
  mv ssl-search.sh irc-ssl-search.sh
  install -d -m 0755 $pkgdir/var/lib/ircd
  install -Dm0644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
  install -Dm0644 $srcdir/$pkgname.tmpfiles $pkgdir/usr/lib/tmpfiles.d/$pkgname.conf
}