1 # Contributor: Philipp 'TamCore' B. <philipp {at} tamcore {dot} eu>
2 # Maintainer: Hoang Duc Hieu <hdh @ lazny.tang.la>
7 pkgdesc="This is the open source repo of EtherPad, a web-based realtime collaborative document editor"
8 url="http://github.com/ether/pad"
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
17 install=('etherpad.install')
19 md5sums=('22630172e67c1a96996c3201d9b30398'
20 '94d92ea833649f18acbead9818258e21'
21 '139aca195c80df64b102b5fb98bffac6'
22 '5c7013916f7fa770e64f964bd8926bed')
24 _gitroot="http://github.com/ether/pad.git"
28 # msg "Connecting to Git server..."
29 # if [ -d $_gitname ]; then
32 # msg2 "The local files have been updated"
34 # git clone $_gitroot $_gitname || return 1
35 # msg2 "Git checkout done"
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? "
42 sed -i "s/localbox.info/${domain}/" "$srcdir"/$_gitname/etherpad/etc/etherpad.localdev-default.properties
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?: "
48 sed -i "s/listen = 9000/listen = ${port}/" "$srcdir"/$_gitname/etherpad/etc/etherpad.localdev-default.properties
51 if [ ! -z "`grep 'etherpad.adminPass = password' $srcdir/$_gitname/etherpad/etc/etherpad.localdev-default.properties`" ]; then
52 echo "Enter an etherpad admin password: "
54 sed -i "s/etherpad.adminPass = password/etherpad.adminPass = ${adminpass}/" "$srcdir"/$_gitname/etherpad/etc/etherpad.localdev-default.properties
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