updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / etherpad-git / PKGBUILD
blob3933ba2ad378aae9e09a918f2918fde9ea83ef6f
1 # Contributor: Philipp 'TamCore' B. <philipp {at} tamcore {dot} eu>
2 # Maintainer: Hoang Duc Hieu <hdh @ lazny.tang.la>
4 pkgname=etherpad-git
5 pkgver=20100824
6 pkgrel=1
7 pkgdesc="This is the open source repo of EtherPad, a web-based realtime collaborative document editor"
8 url="http://github.com/ether/pad"
9 license=('APACHE')
10 arch=('i686' 'x86_64')
11 depends=('scala2.7' 'mysql' 'jre') # scala 2.8 broke something with the byte type
12 makedepends=('git' 'jdk' 'javacc')
13 source=(http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-5.1.11.tar.gz
14     variable-scala-exe.patch
15     etherpad.sh
16     etherpad.install)
17 install=('etherpad.install')
19 md5sums=('22630172e67c1a96996c3201d9b30398'
20          '94d92ea833649f18acbead9818258e21'
21          '139aca195c80df64b102b5fb98bffac6'
22          '5c7013916f7fa770e64f964bd8926bed')
24 _gitroot="http://github.com/ether/pad.git"
25 _gitname="etherpad"
27 build() {
28         # msg "Connecting to Git server..."
29         # if [ -d $_gitname ]; then
30         #       cd $_gitname
31         #       git pull origin
32         #       msg2 "The local files have been updated"
33         # else
34         #       git clone $_gitroot $_gitname || return 1
35         #       msg2 "Git checkout done"
36         # fi
37         # msg "Update complete."
39         if [ ! -z "`grep 'localbox.info' $srcdir/$_gitname/etherpad/etc/etherpad.localdev-default.properties`" ]; then
40                 echo "Under which domain do you want to run etherpad? "
41                 read domain
42                 sed -i "s/localbox.info/${domain}/" "$srcdir"/$_gitname/etherpad/etc/etherpad.localdev-default.properties
43         fi
45         if [ ! -z "`grep 'listen = 9000' $srcdir/$_gitname/etherpad/etc/etherpad.localdev-default.properties`" ]; then
46                 echo "On which port do you want to run etherpad?: "
47                 read port
48                 sed -i "s/listen = 9000/listen = ${port}/" "$srcdir"/$_gitname/etherpad/etc/etherpad.localdev-default.properties
49         fi
51         if [ ! -z "`grep 'etherpad.adminPass = password' $srcdir/$_gitname/etherpad/etc/etherpad.localdev-default.properties`" ]; then
52                 echo "Enter an etherpad admin password: "
53                 read adminpass
54                 sed -i "s/etherpad.adminPass = password/etherpad.adminPass = ${adminpass}/" "$srcdir"/$_gitname/etherpad/etc/etherpad.localdev-default.properties
55         fi
57         source "$srcdir"/etherpad.sh
58         export CC=$SCALA_HOME/bin/fsc
59         export SCALA_LIBRARY_JAR=$SCALA_HOME/lib/scala-library.jar
60         export MYSQL_CONNECTOR_JAR="$srcdir"/mysql-connector-java-5.1.11/mysql-connector-java-5.1.11-bin.jar
62         cd "$srcdir"/$_gitname/
63         git checkout infrastructure/bin/comp.sh infrastructure/ace/bin/make infrastructure/ace/bin/serve # for some reason patch makes makepkg abort, have to revert the files
64         patch -Np1 -i "$srcdir"/variable-scala-exe.patch
65         cd "$srcdir"/$_gitname/infrastructure/
66         bin/makejar.sh || return 1
67         cd "$srcdir"/$_gitname/infrastructure/ace
68         bin/make normal etherpad || return 1
69         cd "$srcdir"/$_gitname/
70         mv infrastructure/build/appjet.jar etherpad/appjet-eth-dev.jar
71         rm -rf infrastructure/{appjet,build,buildjs,buildcache}
73         mkdir -p "$pkgdir"/opt/etherpad
74         cp -a "$srcdir"/$_gitname/etherpad "$srcdir"/$_gitname/infrastructure "$pkgdir"/opt/etherpad/ || return 1
75         rm -r "$pkgdir"/opt/etherpad/infrastructure/{bin,rhino1_7R1,yuicompressor}
76         install -D -m644 "$srcdir"/etherpad.sh "$pkgdir"/etc/profile.d/etherpad.sh || return 1
78         mkdir -m 774 "$pkgdir"/opt/etherpad/etherpad/data
79         chown http "$pkgdir"/opt/etherpad/etherpad/data