updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / red5-dev / PKGBUILD
blob6f9f230d2f6728ded440c80d88869da654b235b2
1 # Contributor: Kosenko Roman <madkite@gmail.com>
2 pkgname=red5-dev
3 pkgver=1.0.0
4 pkgrel=4195
5 pkgdesc='Open-Source Flash Server (Development Version)'
6 arch=('i686' 'x86_64')
7 url='http://osflash.org/red5'
8 license=('LGPL')
9 depends=('java-environment>=5')
10 makedepends=(subversion 'apache-ant>=1.7.0')
11 backup=(etc/conf.d/red5 etc/red5/{access.properties,catalina.policy,context.xml,ehcache.xml,logback.xml,password.properties,quartz.properties,realm.properties,red5.globals,red5.policy,red5.properties,red5.xml,tomcat-users.xml,web.xml})
12 install="${pkgname%-*}.install"
13 source=(
14         #http://dist.osjava.org/releases/official/simple-jndi/simple-jndi-0.11.4.1.tar.gz \
15         http://mirrors.ibiblio.org/pub/mirrors/maven2/simple-jndi/simple-jndi/0.11.4.1/simple-jndi-0.11.4.1.jar \
16         ${pkgname%-*}.sh ${pkgname%-*}.conf)
17 noextract=(red5-$pkgver.tar.gz)
18 options=(docs)
19 provides=("red5=$pkgver")
20 conflicts=("red5")
22 _svnurl='http://red5.googlecode.com/svn/java/server/trunk'
23 _svnsrc="${SRCDEST}/$pkgname-$pkgver.tar.gz"
24 _docurl='http://red5.googlecode.com/svn/doc/trunk'
25 _demosurl='http://red5.googlecode.com/svn/flash/trunk/deploy'
27 #if you want to build 1.0rc1 then comment out next line
28 true && pkgrel=$(svn info "${_svnurl}" | awk '/Revision/ {print $2}')
30 build() {
31         cd $startdir/src
32         msg 'Preparing sources...'
33         [ -d $pkgname ] && rm -rf $pkgname
34         [ -f ${_svnsrc} ] && tar -xzf ${_svnsrc}
35         if [ -d $pkgname/.svn ]; then
36                 msg "Updating from ${_svnurl}"
37                 svn up -r $pkgrel $pkgname
38         else
39                 msg "Checkouting from ${_svnurl}"
40                 svn co "${_svnurl}" -r $pkgrel $pkgname
41         fi
42         cd $pkgname
43         if [ -d doc/.svn ]; then
44                 msg "Updating from ${_docurl}"
45                 svn up -r $pkgrel doc
46         else
47                 msg "Checkouting from ${_docurl}"
48                 svn co "${_docurl}" -r $pkgrel doc
49         fi
50         if [ -d webapps/root/demos/.svn ]; then
51                 msg "Updating from ${_demosurl}"
52                 svn up -r $pkgrel webapps/root/demos
53         else
54                 msg "Checkouting from ${_demosurl}"
55                 svn co "${_demosurl}" -r $pkgrel webapps/root/demos
56         fi
57         cd -
58         tar -czf ${_svnsrc} $pkgname
59         cd $pkgname || return $?
61         msg 'Starting make...'
62         sed 's/${java.target_version}/1.6/g' -i build.xml
63         ant || return $?
64         cd dist
65         #sed -i 's|\(.port\)=443|\1=8443|' conf/red5.properties
67         msg 'Starting install...'
68         mkdir -p $startdir/pkg/opt/red5
69         #mv $startdir/src/simple-jndi-*/simple-jndi-*.jar lib
70         install -m0644 $startdir/src/simple-jndi-*.jar lib
71         mv lib $startdir/pkg/opt/red5
72         #install -m0755 red5.sh $startdir/pkg/opt/red5
73         install -m0644 *.jar $startdir/pkg/opt/red5
74         mv plugins $startdir/pkg/opt/red5
76         for i in conf/red5*.xml conf/red5.globals; do
77                 sed 's#${red5.root}/webapps#/srv/red5#' -i $i
78         done
80         mkdir -p $startdir/pkg/etc
81         mv conf $startdir/pkg/etc/red5
82         chgrp -R 67 $startdir/pkg/etc/red5
83         chmod 0640 $startdir/pkg/etc/red5/*
84         ln -s /etc/red5 $startdir/pkg/opt/red5/conf
86         mkdir -p $startdir/pkg/srv
87         mv webapps $startdir/pkg/srv/red5
88         chown -R 67:67 $startdir/pkg/srv/red5
89         chmod 0775 $startdir/pkg/srv/red5
90         ln -s /srv/red5 $startdir/pkg/opt/red5/webapps
92         install -d -m775 -o 67 -g 67 $startdir/pkg/var/log/red5
93         ln -s /var/log/red5 $startdir/pkg/opt/red5/log
95         ln -s /var/tmp $startdir/pkg/opt/red5/work
97         find ../doc -depth -type d -name .svn -exec rm -r {} \;
98         mkdir -p $startdir/pkg/usr/share/doc
99         mv ../doc $startdir/pkg/usr/share/doc/red5
100         #mv swf $startdir/pkg/usr/share/doc/red5
102         cd ../src; rm -rf conf; find -depth -type d -name .svn -exec rm -r {} \;
103         zip -rq $startdir/pkg/opt/red5/src.zip *
105         install -D -m0754 -o 67 -g 67 $startdir/src/${pkgname%-*}.sh $startdir/pkg/etc/rc.d/${pkgname%-*}
106         install -D -m0664 -o 67 -g 67 $startdir/src/${pkgname%-*}.conf $startdir/pkg/etc/conf.d/${pkgname%-*}
109 #md5sums=('e19aaacee16be383fe805ce8acd28620' '5a7ff7c813c0862b96bca96984c89797' 'b49fadd28934e899b2143f297faa97a2')
110 md5sums=('5141e422734fd718e0f82d73124388ba' '5a7ff7c813c0862b96bca96984c89797' 'b49fadd28934e899b2143f297faa97a2')