updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / sunbird-branded / PKGBUILD
blob3bc8d5527c29d47db9384c1fba21a8b1c412e816
1 # Contributor: WAntilles <wantilles@adslgr.com>
2 # Many thanks to: Allan McRae <mcrae_allan@hotmail.com>
4 pkgname=sunbird-branded
5 pkgver=0.9
6 pkgrel=4
7 pkgdesc="Standalone calendar"
8 arch=('i686' 'x86_64')
9 license=('MPL' 'GPL' 'LGPL')
10 url="http://www.mozilla.org/projects/calendar/sunbird/"
11 depends=('gtk2>=2.16.2-2' 'libidl2' 'mozilla-common' 'nss' 'libxt')
12 makedepends=('zip' 'imagemagick' 'pkgconfig')
13 conflicts=('sunbird')
14 provides=("sunbird=${pkgver}")
15 options=('!makeflags')
16 source=(http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/${pkgver}/source/lightning-sunbird-${pkgver}-source.tar.bz2
17         mozconfig
18         sunbird.desktop
19         sunbird-locale.patch
20         xulrunner-elif.patch
21         libpng14.patch
22         accelerators.patch)
23 md5sums=('ff4ae1e9c1071d8d478504d95d7dabee'
24          '29b0a7a2c87d5b7c6723292fa6353bf0'
25          'b1b2ec37458828a7bddaac50db4d43f1'
26          '07cb0fcd13a7a4237ab87f45cf64fb4a'
27          '38457261a6355365079dbe5c2342ec68'
28          'bb3f75cadc6e929c6934b4bebff75e4b'
29          '89059f5398470d51b808bb142b2c4a48')
31 build() {
32   cd ${srcdir}/mozilla
34   export LDFLAGS='-lX11 -lXrender'
35   export MOZ_CO_PROJECT=calendar
36   unset CXXFLAGS
37   unset CFLAGS  
39   # patch launcher file for locale support
40   patch -Np1 -i ${srcdir}/sunbird-locale.patch || return 1
41   
42   patch -Np1 -i ${srcdir}/xulrunner-elif.patch || return 1
43   patch -Np1 -i ${srcdir}/libpng14.patch || return 1
44   patch -Np0 -i ${srcdir}/accelerators.patch || return 1
46   cp ${srcdir}/mozconfig .mozconfig
47   make -f client.mk build || return 1
48   
49   # for some reason this misses some files (v0.9)
50   # make DESTDIR=${pkgdir} -i install || return 1
52   # hack the install by hand...
53   install -dm755 ${pkgdir}/usr/lib/sunbird-${pkgver}/
54   cp -RL ${srcdir}/mozilla/dist/bin/* ${pkgdir}/usr/lib/sunbird-${pkgver}
55   install -dm755 ${pkgdir}/usr/bin/
56   install -m755 ${srcdir}/mozilla/build/unix/sunbird-config ${pkgdir}/usr/bin/
57   install -m755 ${srcdir}/mozilla/calendar/sunbird/app/sunbird ${pkgdir}/usr/bin/
58   touch ${pkgdir}/usr/lib/sunbird-${pkgver}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest
59   touch ${pkgdir}/usr/lib/sunbird-${pkgver}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
60     
61   cd ${pkgdir}/usr/lib/sunbird-${pkgver}
62   export MOZ_DISABLE_GNOME=1
63   export MOZTMP=`mktemp -d -p ${srcdir}`
64   LD_PRELOAD="" LD_LIBRARY_PATH="`pwd`" HOME="${MOZTMP}" ./sunbird-bin -register
65   rm -rf "${MOZTMP}"
66   cd chrome
67   find . -maxdepth 1 -type d -exec rm -rf {} \;
69   # Tidy up unnneeded files
70   rm -rf ${pkgdir}/usr/share
71   rm -rf ${pkgdir}/usr/include
72   rm -rf ${pkgdir}/usr/lib/pkgconfig
73   rm -rf ${pkgdir}/usr/bin/defaults
74   
75   cd ${pkgdir}/usr/lib && ln -sf sunbird-${pkgver} sunbird
77   # desktop entry and icons
78   install -Dm644 ${srcdir}/sunbird.desktop \
79     ${pkgdir}/usr/share/applications/sunbird.desktop
80   install -dm755 ${pkgdir}/usr/share/pixmaps
81   convert ${srcdir}/mozilla/dist/branding/default.xpm \
82     ${pkgdir}/usr/share/pixmaps/sunbird.png
83   install -Dm644 ${srcdir}/mozilla/dist/branding/default.xpm \
84     ${pkgdir}/usr/lib/sunbird/chrome/icons/default/default.xpm
85   install -Dm644 ${srcdir}/mozilla/dist/branding/default.xpm \
86     ${pkgdir}/usr/lib/sunbird/icons/default.xpm