updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / statusnet / PKGBUILD
blob92a9b713d0ff2a6589e7acbf8845eb10bd749ae3
1 # Contributor: fauno <fauno@kiwwwi.com.ar>
2 pkgbase=statusnet
3 pkgname=statusnet
4 pkgver=0.9.9
6 # find available plugins and locales
7 srcfile=${SRCDEST}/${pkgbase}-${pkgver}.tar.gz
8 if [ -e ${srcfile} ]; then
9 plugins=($(bsdtar -tf ${srcfile} \
10                       ${pkgbase}-${pkgver}/plugins | \
11                       cut -d'/' -f3 | sort -u))
12 locales=($(bsdtar -tf ${srcfile} \
13                       ${pkgbase}-${pkgver}/locale | \
14                       cut -d'/' -f3 | sort -u))
17 # looping avoids having "statusnet-plugin-" package
18 true && pkgname=(${pkgname}-base
19          $(for plugin in ${plugins[@]}; do
20              echo ${plugin} | tr [A-Z] [a-z] | \
21              sed "s/^/statusnet-plugin-/"
22          done)
23          $(for locale in ${locales[@]}; do
24              echo ${locale} | tr [A-Z] [a-z] | \
25              sed "s/^/statusnet-i18n-/"
26          done))
27 pkgrel=2
28 arch=('any')
29 pkgdesc="StatusNet is a Free and Open Source microblogging platform."
30 url="http://status.net"
31 license=('AGPL')
32 depends=('php>=5.2.3' 'mysql>=5' 'php-gd' 'php-curl' 'php-gmp')
33 source=("http://status.net/${pkgbase}-${pkgver}.tar.gz"
34         statusnet.install)
35 install=statusnet.install
36 md5sums=('766c9d42825fc99d8ad6c554a959568b'
37          'c638cb36b7da7eb67a67e031f59e6068')
38 options=(!strip !zipman emptydirs)
40 build() {
41     /bin/true
44 package_statusnet-base() {
45   provides=('statusnet')
46   optdepends=('memcache: for caching database queries'
47               'php-xcache: for accelerating PHP code execution'
48               'php-apc: for accelerating PHP code execution'
49               'php-ldap: for the LDAP plugin'
50               'statusnet-plugin-ostatus: for federation')
52   cd "$srcdir/$pkgbase-${pkgver}"
54   etc_dir="${pkgdir}/etc/webapps/${pkgbase}"
55   usr_dir="${pkgdir}/usr/share/webapps/${pkgbase}"
57   install -d ${usr_dir}
58   install -d ${etc_dir}
59   install -d ${pkgdir}/usr/share/doc/${pkgbase}/
60   install -d ${pkgdir}/usr/share/licenses/${pkgbase}
62   install -m644 ./{config.php,htaccess}.sample \
63       ${pkgdir}/usr/share/doc/${pkgbase}/
65   install -m644 ./{README,EVENTS.txt,lighttpd.conf.example} \
66       ${pkgdir}/usr/share/doc/${pkgbase}/
68   install -m644 COPYING ${pkgdir}/usr/share/licenses/${pkgbase}/
70   rm -f *.sample README COPYING README EVENTS.txt *.example
72   cp -ra * ${usr_dir}/
73   chmod a+w ${usr_dir}/{avatar,background,file}
75   msg2 "Install bogus config.php"
76   touch ${etc_dir}/config.php
77   chmod a+w ${etc_dir}/config.php
78   ln -s /etc/webapps/statusnet/config.php ${usr_dir}/config.php
80   msg2 "Remove locale and plugins in favor of split packages"
81   rm -rf ${usr_dir}/{locale,plugins}
83   install -d ${usr_dir}/plugins
84   install -d ${usr_dir}/locale
86   install -d ${pkgdir}/srv/http
87   ln -s /usr/share/webapps/${pkgbase} ${pkgdir}/srv/http/
88
90 # Helper for creating i18n packages
91 statusnet-i18n-helper() {
92   cd "${srcdir}/${pkgbase}-${pkgver}"
94   install -d "${pkgdir}/usr/share/webapps/statusnet/locale/${1}"
95   cp -ra "./locale/${1}" "${pkgdir}/usr/share/webapps/statusnet/locale/${1}/"
98 # Helper for creating plugin packages
99 statusnet-plugin-helper() {
100   cd "${srcdir}/${pkgbase}-${pkgver}"
102   install -d "${pkgdir}/usr/share/webapps/statusnet/plugins/${1}"
103   cp -ra "./plugins/${1}" "${pkgdir}/usr/share/webapps/statusnet/plugins/${1}/"
107 for plugin in ${plugins[@]}; do
108     plugin_lower=$(echo ${plugin} | tr [A-Z] [a-z])
110     eval "
111 package_statusnet-plugin-${plugin_lower}() {
112     pkgdesc='${plugin} plugin for StatusNet'
113     depends=('statusnet-base')
114     groups=('statusnet-plugins')
116     statusnet-plugin-helper ${plugin}
118 done
120 for locale in ${locales[@]}; do
121     locale_lower=$(echo ${locale} | tr [A-Z] [a-z])
123     eval "
124 package_statusnet-i18n-${locale_lower}() {
125     pkgdesc='${locale} locale for StatusNet'
126     depends=('statusnet-base')
127     groups=('statusnet-locales')
129     statusnet-i18n-helper ${locale}
131 done
132 pkgdesc="StatusNet is a Free and Open Source microblogging platform."