# $Id: PKGBUILD 82 2009-07-17 19:56:55Z aaron $ # Maintainer: Allan McRae pkgname=sunbird pkgver=0.9 pkgrel=2 pkgdesc="Standalone calendar" arch=('i686' 'x86_64') license=('MPL' 'GPL' 'LGPL') url="http://www.mozilla.org/projects/calendar/sunbird/" depends=('gtk2>=2.16.2-2' 'libidl2' 'mozilla-common' 'nss' 'libxt') makedepends=('zip' 'imagemagick' 'pkgconfig') options=('!makeflags') source=(http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/${pkgver}/source/lightning-sunbird-${pkgver}-source.tar.bz2 mozconfig sunbird.desktop sunbird-locale.patch xulrunner-elif.patch) md5sums=('ff4ae1e9c1071d8d478504d95d7dabee' 'd6c00a58875bf28dff006abeb32a1a14' 'b1b2ec37458828a7bddaac50db4d43f1' '07cb0fcd13a7a4237ab87f45cf64fb4a' '38457261a6355365079dbe5c2342ec68') build() { cd ${srcdir}/mozilla export LDFLAGS='-lX11 -lXrender' export MOZ_CO_PROJECT=calendar unset CXXFLAGS unset CFLAGS patch -Np1 -i ${srcdir}/xulrunner-elif.patch || return 1 # patch launcher file for locale support patch -Np1 -i ${srcdir}/sunbird-locale.patch || return 1 cp ${srcdir}/mozconfig .mozconfig make -f client.mk build || return 1 # for some reason this misses some files (v0.9) # make DESTDIR=${pkgdir} -i install || return 1 # hack the install by hand... install -dm755 ${pkgdir}/usr/lib/sunbird-${pkgver}/ cp -RL ${srcdir}/mozilla/dist/bin/* ${pkgdir}/usr/lib/sunbird-${pkgver} install -dm755 ${pkgdir}/usr/bin/ install -m755 ${srcdir}/mozilla/build/unix/sunbird-config ${pkgdir}/usr/bin/ install -m755 ${srcdir}/mozilla/calendar/sunbird/app/sunbird ${pkgdir}/usr/bin/ touch ${pkgdir}/usr/lib/sunbird-${pkgver}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest touch ${pkgdir}/usr/lib/sunbird-${pkgver}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest cd ${pkgdir}/usr/lib/sunbird-${pkgver} export MOZ_DISABLE_GNOME=1 export MOZTMP=`mktemp -d -p ${srcdir}` LD_PRELOAD="" LD_LIBRARY_PATH="`pwd`" HOME="${MOZTMP}" ./sunbird-bin -register rm -rf "${MOZTMP}" cd chrome find . -maxdepth 1 -type d -exec rm -rf {} \; # Tidy up unnneeded files rm -rf ${pkgdir}/usr/share rm -rf ${pkgdir}/usr/include rm -rf ${pkgdir}/usr/lib/pkgconfig rm -rf ${pkgdir}/usr/bin/defaults cd ${pkgdir}/usr/lib && ln -sf sunbird-${pkgver} sunbird # desktop entry and icons install -Dm644 ${srcdir}/sunbird.desktop \ ${pkgdir}/usr/share/applications/sunbird.desktop install -dm755 ${pkgdir}/usr/share/pixmaps convert ${srcdir}/mozilla/dist/branding/default.xpm \ ${pkgdir}/usr/share/pixmaps/sunbird.png install -Dm644 ${srcdir}/mozilla/dist/branding/default.xpm \ ${pkgdir}/usr/lib/sunbird/chrome/icons/default/default.xpm install -Dm644 ${srcdir}/mozilla/dist/branding/default.xpm \ ${pkgdir}/usr/lib/sunbird/icons/default.xpm }