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