updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / pms-svn / PKGBUILD
blob7d6f8e4259c2a56f97ada70113fad68ebe99fc19
1 # Contributor: Benjamin Bukowski <benjamin.bukowski@googlemail.com>
2 pkgname=pms-svn
3 pkgver=494
4 pkgrel=1
5 pkgdesc="PS3 Media Server is a DLNA compliant Upnp Media Server for the PS3, written in Java, with the purpose of streaming or transcoding any kind of media files, with minimum configuration."
6 arch=(any)
7 url="http://code.google.com/p/ps3mediaserver/"
8 license=('GPL2')
9 depends=('mplayer' 'ffmpeg' 'java-runtime' 'tsmuxer' 'libmediainfo')
10 makedepends=('subversion' 'apache-ant')
11 provides=('pms')
12 conflicts=('pms')
13 backup=('opt/pms/PMS.conf' 'opt/pms/WEB.conf')
14 install=$pkgname.install
15 source=('rc-pms' 'pms.desktop' 'pms.conf')
16 md5sums=('387ae6c96d63f1e6bade60c130c339ab'
17          'e909cfeb522c4f9d933a0eec40037d2f'
18          'a3dcdcde0c247405e4370adf1bc0f816')
20 _svntrunk=http://ps3mediaserver.googlecode.com/svn/trunk/
21 _svnmod=ps3ms
23 build() {       
24         msg "Making sure Ant environmet is set.."
25         if [[ -z "$ANT_HOME" && -r /etc/profile.d/apache-ant.sh ]]; then
26                 if [ -r /etc/profile.d/apache-ant.sh ]; then
27                         source /etc/profile.d/apache-ant.sh
28                 else
29                         return 1
30                 fi
31         fi
33         cd "$srcdir"
35   if [ -d $_svnmod/.svn ]; then
36     (cd $_svnmod && svn up -r $pkgver)
37   else
38     svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
39   fi
41   msg "SVN checkout done or server timeout"
42   msg "Starting ant..."
44   rm -rf "$srcdir/$_svnmod-build"
45   cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
46   cd "$srcdir/$_svnmod-build/ps3mediaserver"
48   ant || return 1
50   install -dm755 $pkgdir/opt/pms \
51                  $pkgdir/usr/bin \
52                  $pkgdir/usr/share/pixmaps \
53                  $pkgdir/usr/share/applications/ \
54                  $pkgdir/etc/conf.d/ \
55                  $pkgdir/etc/rc.d \
56                  $pkgdir/var/log/
58   cd dist
59   mkdir pms
60   tar -xf *.tgz --exclude tsMuxeR* -C ./pms/ || return 1
61   cd ./pms/*/
63   find . -type d -exec install -dm755 $pkgdir/opt/pms/{} \;
64   find . -type f -exec install -Dm644 {} $pkgdir/opt/pms/{} \;
66   sed -i '2i PMS_HOME=/opt/pms\ncd $PMS_HOME' $pkgdir/opt/pms/PMS.sh
67   chmod +x $pkgdir/opt/pms/PMS.sh
68   ln -sf /opt/pms/PMS.sh $pkgdir/usr/bin/pms
70   touch $pkgdir/opt/pms/{PMS.conf,WEB.conf,debug.log} $pkgdir/var/log/pms.log
71   chmod 644 $pkgdir/opt/pms/{PMS.conf,WEB.conf,debug.log} $pkgdir/var/log/pms.log
73   install -Dm644 $srcdir/pms.conf $pkgdir/etc/conf.d/pms
74   install -Dm755 $srcdir/rc-pms $pkgdir/etc/rc.d/pms
75   install -Dm644 $srcdir/pms.desktop $pkgdir/usr/share/applications/
76   install -Dm644 $srcdir/$_svnmod-build/ps3mediaserver/resources/images/icon-32.png $pkgdir/usr/share/pixmaps/pms.png
77   
78   ln -s /usr/bin/tsMuxeR $pkgdir/opt/pms/linux/tsMuxeR