summaryrefslogtreecommitdiff
path: root/community/ejabberd/PKGBUILD
blob: f39532775dc577e5fd1878eafb1c02fe47d269b4 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# $Id: PKGBUILD 111330 2014-05-16 16:35:25Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jeff 'codemac' Mickey <jeff@archlinux.org>
# Contributor: Alexander Rødseth <rodseth@gmail.com>

pkgname=ejabberd
pkgver=14.05
pkgrel=1
pkgdesc="Jabber server written in Erlang"
arch=('x86_64' 'i686')
url="http://www.ejabberd.im/"
license=("GPL")
depends=('expat' 'openssl' 'zlib' 'erlang-nox' 'pam' 'iproute2' 'erlang-unixodbc' 'libyaml')
makedepends=('git' 'rebar')
backup=('etc/ejabberd/ejabberd.yml'
	'etc/ejabberd/ejabberdctl.cfg'
	'etc/logrotate.d/ejabberd')
install=$pkgname.install
replaces=('ejabberd-mod_mysql' 'ejabberd-mod_mysql-svn'
	  'ejabberd-mod_pgsql' 'ejabberd-mod_pgsql-svn')
source=("$pkgname-$pkgver.tar.gz::https://github.com/processone/ejabberd/archive/$pkgver.tar.gz"
	"p1_cache_tab::git://github.com/processone/cache_tab"
	"p1_tls::git://github.com/processone/tls"
	"p1_stringprep::git://github.com/processone/stringprep"
	"p1_xml::git://github.com/processone/xml"
	"p1_yaml::git://github.com/processone/p1_yaml"
	"git://github.com/rds13/xmlrpc"
	"p1_pam::git://github.com/processone/epam"
	"p1_zlib::git://github.com/processone/zlib"
	"git://github.com/basho/lager"
	"p1_iconv::git://github.com/processone/eiconv"
	"git://github.com/DeadZen/goldrush.git"
	"p1_mysql::git://github.com/processone/mysql.git"
	"p1_pgsql::git://github.com/processone/pgsql.git"
	"p1_stun::git://github.com/processone/stun"
	"git://github.com/davisp/jiffy"
	"git://github.com/cmullaparthi/ibrowse"
	"git://github.com/esl/lhttpc"
	"$pkgname.logrotate"
	"ejabberd.service")
md5sums=('16bffbf9b9e18b69133e983fd82364b6'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'f97c8a96160f30e0aecc9526c12e6606'
         'a437aff9d7d477fb036d527205617e18')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  mkdir -p "$srcdir/$pkgname-$pkgver/deps"
  for i in goldrush lager p1_cache_tab p1_iconv p1_pam \
           p1_stringprep p1_tls p1_xml p1_yaml p1_zlib xmlrpc \
           p1_mysql p1_pgsql p1_stun jiffy ibrowse lhttpc; do
    rm -rf "$srcdir/$pkgname-$pkgver/deps/$i"
    mv $srcdir/$i "$srcdir/$pkgname-$pkgver/deps"
  done

  pushd deps/lhttpc/src/
  mv lhttpc.app.src lhttpc.app.src.bak
  cat lhttpc.app.src.bak | iconv -f utf8 -c >lhttpc.app.src
  popd
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --enable-all
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  install -Dm04750 deps/p1_pam/priv/bin/epam $pkgdir/usr/lib/ejabberd/priv/bin/epam
  install -d "$pkgdir/var/lib/$pkgname"
  install -D -m0644 "$srcdir/$pkgname.logrotate" "$pkgdir/etc/logrotate.d/$pkgname"
  chmod ug+r "$pkgdir/etc/$pkgname/"*
  mkdir -p $pkgdir/usr/bin
  mv $pkgdir/usr/sbin/ejabberdctl $pkgdir/usr/bin/ejabberdctl
  chmod a+rx "$pkgdir/usr/bin/ejabberdctl" "$pkgdir/usr/lib/ejabberd/priv/bin/captcha.sh"
  rm -rf "$pkgdir/var/lock" "$pkgdir/usr/sbin"
  install -Dm0644 $srcdir/ejabberd.service $pkgdir/usr/lib/systemd/system/ejabberd.service
  # workaround
  ln -s mod_configure.beam $pkgdir/usr/lib/ejabberd/ebin/configure.beam
}

# vim:set ts=2 sw=2 et: