rpms/sunbird/devel find-external-requires, NONE, 1.1 mozilla-extension-update.sh, NONE, 1.1 sunbird-0.3.1-link-layout.patch, NONE, 1.1 sunbird-0.7-path.patch, NONE, 1.1 sunbird.desktop, NONE, 1.1 sunbird.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Lubomir Kundrak (lkundrak) fedora-extras-commits at redhat.com
Tue Feb 19 17:49:59 UTC 2008


Author: lkundrak

Update of /cvs/pkgs/rpms/sunbird/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21927/devel

Modified Files:
	.cvsignore sources 
Added Files:
	find-external-requires mozilla-extension-update.sh 
	sunbird-0.3.1-link-layout.patch sunbird-0.7-path.patch 
	sunbird.desktop sunbird.spec 
Log Message:
Initial import


--- NEW FILE find-external-requires ---
#!/bin/sh

# Finds requirements provided outside of the current file set

filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`

provides=`echo $filelist | /usr/lib/rpm/find-provides`

{
for f in $filelist ; do
	echo $f | /usr/lib/rpm/find-requires | while read req ; do
		found=0
		for p in $provides ; do
			if [ "$req" = "$p" ]; then
				found=1
			fi
		done
		if [ "$found" = "0" ]; then
			echo $req
		fi
	done
done
} | sort -u

--- NEW FILE mozilla-extension-update.sh ---
#!/bin/sh
# 
# This script is used to add and remove our extension from one of the Mozilla
# products directory, and is run from 'triggers' when the product is installed or
# upgraded, as well as when our package is installed. It is needed because
# Mozilla products are installed into versioned directories in /usr/lib[64]/<product>
# so we have to make a new symlink into the right directory when the
# application is installed or upgraded. But we would rather not leave
# our old symlinks behind, since that will cause the application
# directories not to be removed. (flash-player leaves its old symlinks behind,
# but that's no excuse for us to do the same...)
#
# Because I don't know any way of finding out what the new version
# is on installation or old version on uninstallation, we have
# to do things in a somewhat non-intuitive way
#
# The order on upgrade of the mozilla application is:
#
#  1. new package installed
#  2. triggerin for new package - we add all symlinks
#  3. triggerun for old package - we remove all symlinks
#  4. old package uninstalled
#  5. triggerpostun for old package - we add all symlinks
#
# Triggers are also run on self-upgrade, in that case we do:
#
#  1. new package installed
#  2. triggerin for new package - we add all symlinks
#  3. triggerun for old package - we remove all symlinks
#  4. old package uninstalled
#  5. postun for old package - we add all symlinks
#  6. triggerpostun for old package - NOT RUN (contrary to RPM docs)
#
#
# Script arguments:
# --appname: the mozilla application that this extension should register into.
#            Usually firefox or thunderbird.
# --extname: the name of the extension. It can be determined by looking at
#            the install.rdf file, in the extension directory. This file
#            contains several <em:id> tags. The extname parameter is the
#            content of the em:id tag which is not contained in the
#            em:targetApplication tag
# --extpath: the path where the extension will be installed
# --action:  either "install" or "remove"
# --basedir: the dirname of the directory where the target application is
#            installed. Usually /usr/lib or /usr/lib64>, it defaults to
#            /usr/lib
#
#
# Here's an example implementation in rpm scriptlets:
#
# %define tbupdate %{_libdir}/lightning/mozilla-extension-update.sh --appname thunderbird --extname {e2fda1a4-762b-4020-b5ad-a41df1933103} --basedir %{_libdir} --extpath %{_libdir}/lightning --action 
# 
# %post
# %{tbupdate} install || true
# 
# %preun
# # On removal (but not upgrade), remove the extention
# if [ $1 = 0 ] ; then
#     %{tbupdate} remove || true
# fi
# 
# %postun
# # This is needed not to reverse the effect of our preun, which
# # is guarded against upgrade, but because of our triggerun,
# # which is run on self-upgrade, though triggerpostun isn't
# if [ $1 != 0 ] ; then
#     %{tbupdate} install || true
# fi
# 
# %triggerin -- thunderbird
# %{tbupdate} install || true
# 
# %triggerun -- thunderbird
# %{tbupdate} remove || true
# 
# %triggerpostun -- thunderbird
# # Guard against being run post-self-uninstall, even though that
# # doesn't happen currently (see comment above)
# if [ "$1" != 0 ] ; then
#     %{tbupdate} install || true
# fi


die() {
	echo >&2 "$@"
	exit 0
}

usage() {
	die "Usage: $0 --appname <application-name> --extname <extension-name> --extpath <extension-path> --action <install|remove> [--basedir </usr/lib|/usr/lib64>]"
}

appname=
extname=
extpath=
action=
basedir=/usr/lib
while [ "$#" -gt "0" ]; do
	case "$1" in
	--appname)
		shift; appname="$1" ;;
	--extname)
		shift; extname="$1" ;;
	--extpath)
		shift; extpath="$1" ;;
	--action)
		shift; action="$1" ;;
	--basedir)
		shift; basedir="$1" ;;
	*) usage ;;
	esac
	shift
done


if [ "$action" = "install" ] ; then
	# Add symlinks to any mozilla directory that looks like it is part of a
	# currently installed package
	for d in $basedir/${appname}*; do
	    if [ "$d" = "$basedir/${appname}*" ] ; then
            continue
	    fi
	    link=$d/extensions/$extname
	    if [ -e $extpath -a -e $d/$appname-bin -a -d $d/extensions -a ! -L $link ] ; then
            ln -s $extpath $link
	    fi
	done
elif [ "$action" = "remove" ] ; then
	# Remove any symlinks we've created into any mozilla directory
	for d in $basedir/${appname}*; do
	    if [ "$d" = "$basedir/${appname}*" ] ; then
            continue
	    fi
	    link=$d/extensions/$extname
	    if [ -L $link ] ; then
            rm $link
	    fi
	done
else
    usage
fi

exit 0

sunbird-0.3.1-link-layout.patch:

--- NEW FILE sunbird-0.3.1-link-layout.patch ---
Index: mozilla/layout/build/Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/layout/build/Makefile.in,v
retrieving revision 1.127.8.7
diff -d -u -p -r1.127.8.7 Makefile.in
--- mozilla/layout/build/Makefile.in	17 Jul 2006 19:05:13 -0000	1.127.8.7
+++ mozilla/layout/build/Makefile.in	10 Oct 2006 04:29:16 -0000
@@ -240,6 +240,11 @@ EXTRA_DSO_LDOPTS += \
 	$(NULL)
 endif
 
+# Add explicit X11 dependency when building against X11 toolkits
+ifneq (,$(filter gtk gtk2 qt xlib,$(MOZ_WIDGET_TOOLKIT)))
+EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) -lXrender
+endif
+
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES	+= -I$(srcdir)/../base \


sunbird-0.7-path.patch:

--- NEW FILE sunbird-0.7-path.patch ---
FORTIFY_SOURCE aborts the process if realpath() is called with destination
buffer smaller than PATH_MAX (typically of 4096 characters). Mozilla uses
MAXPATHLEN that is by default defined to 1024 bytes.

This originally comes from firefox-path.patch of firefox package.

diff -ur mozilla.orig/config/pathsub.h mozilla/config/pathsub.h
--- mozilla.orig/config/pathsub.h	2004-04-18 16:17:25.000000000 +0200
+++ mozilla/config/pathsub.h	2007-12-30 19:23:26.000000000 +0100
@@ -46,7 +46,7 @@
 #include <sys/types.h>
 
 #ifndef PATH_MAX
-#define PATH_MAX 1024
+#error  "PATH_MAX is not defined!"
 #endif
 
 /*
diff -ur mozilla.orig/dbm/include/mcom_db.h mozilla/dbm/include/mcom_db.h
--- mozilla.orig/dbm/include/mcom_db.h	2005-04-29 15:33:34.000000000 +0200
+++ mozilla/dbm/include/mcom_db.h	2007-12-30 19:23:26.000000000 +0100
@@ -214,7 +214,8 @@
 #endif  /* __DBINTERFACE_PRIVATE */
 
 #ifdef SCO
-#define MAXPATHLEN 	1024              
+#include <limits.h>
+#define MAXPATHLEN 	PATH_MAX     
 #endif
 
 #include <fcntl.h>
diff -ur mozilla.orig/directory/c-sdk/config/pathsub.h mozilla/directory/c-sdk/config/pathsub.h
--- mozilla.orig/directory/c-sdk/config/pathsub.h	2006-02-03 15:41:18.000000000 +0100
+++ mozilla/directory/c-sdk/config/pathsub.h	2007-12-30 19:23:26.000000000 +0100
@@ -50,7 +50,7 @@
 #endif
 
 #ifndef PATH_MAX
-#define PATH_MAX 1024
+#error  "PATH_MAX is not defined!"
 #endif
 
 /*
diff -ur mozilla.orig/gfx/src/gtk/nsPrintdGTK.h mozilla/gfx/src/gtk/nsPrintdGTK.h
--- mozilla.orig/gfx/src/gtk/nsPrintdGTK.h	2004-04-17 23:52:29.000000000 +0200
+++ mozilla/gfx/src/gtk/nsPrintdGTK.h	2007-12-30 19:23:26.000000000 +0100
@@ -63,7 +63,7 @@
 #ifdef _POSIX_PATH_MAX
 #define PATH_MAX	_POSIX_PATH_MAX
 #else
-#define PATH_MAX	256
+#error "PATH_MAX is not defined!"
 #endif
 #endif
 
diff -ur mozilla.orig/js/src/jsfile.c mozilla/js/src/jsfile.c
--- mozilla.orig/js/src/jsfile.c	2006-07-26 20:55:08.000000000 +0200
+++ mozilla/js/src/jsfile.c	2007-12-30 19:23:26.000000000 +0100
@@ -105,7 +105,8 @@
 #define utfstring               "binary"
 #define unicodestring           "unicode"
 
-#define MAX_PATH_LENGTH         1024
+#include <limits.h>
+#define MAX_PATH_LENGTH         PATH_MAX
 #define MODE_SIZE               256
 #define NUMBER_SIZE             32
 #define MAX_LINE_LENGTH         256
diff -ur mozilla.orig/mailnews/import/comm4x/src/nsComm4xProfile.cpp mozilla/mailnews/import/comm4x/src/nsComm4xProfile.cpp
--- mozilla.orig/mailnews/import/comm4x/src/nsComm4xProfile.cpp	2005-02-16 12:50:13.000000000 +0100
+++ mozilla/mailnews/import/comm4x/src/nsComm4xProfile.cpp	2007-12-30 19:23:26.000000000 +0100
@@ -70,7 +70,8 @@
 #elif defined(CCHMAXPATH)
 #define MAXPATHLEN CCHMAXPATH
 #else
-#define MAXPATHLEN 1024
+#include <limits.h>
+#define MAXPATHLEN PATH_MAX
 #endif
 #endif
 
diff -ur mozilla.orig/modules/libjar/nsZipArchive.cpp mozilla/modules/libjar/nsZipArchive.cpp
--- mozilla.orig/modules/libjar/nsZipArchive.cpp	2006-09-13 20:32:37.000000000 +0200
+++ mozilla/modules/libjar/nsZipArchive.cpp	2007-12-30 19:23:26.000000000 +0100
@@ -121,7 +121,7 @@
 #    define S_IFLNK  0120000
 #  endif
 #  ifndef PATH_MAX
-#    define PATH_MAX 1024
+#    include <limits.h>
 #  endif
 #endif  /* XP_UNIX */
 
diff -ur mozilla.orig/modules/libreg/src/reg.c mozilla/modules/libreg/src/reg.c
--- mozilla.orig/modules/libreg/src/reg.c	2004-05-11 14:15:10.000000000 +0200
+++ mozilla/modules/libreg/src/reg.c	2007-12-30 19:23:26.000000000 +0100
@@ -96,7 +96,8 @@
 #define MAX_PATH PATH_MAX
 #elif defined(XP_UNIX)
 #ifndef MAX_PATH
-#define MAX_PATH 1024
+#include <limits.h>
+#define MAX_PATH PATH_MAX
 #endif
 #elif defined(XP_OS2)
 #ifndef MAX_PATH
diff -ur mozilla.orig/nsprpub/config/pathsub.h mozilla/nsprpub/config/pathsub.h
--- mozilla.orig/nsprpub/config/pathsub.h	2004-04-25 17:00:34.000000000 +0200
+++ mozilla/nsprpub/config/pathsub.h	2007-12-30 19:23:26.000000000 +0100
@@ -50,7 +50,7 @@
 #endif
 
 #ifndef PATH_MAX
-#define PATH_MAX 1024
+#error  "PATH_MAX is not defined!"
 #endif
 
 /*
diff -ur mozilla.orig/security/coreconf/nsinstall/pathsub.h mozilla/security/coreconf/nsinstall/pathsub.h
--- mozilla.orig/security/coreconf/nsinstall/pathsub.h	2004-04-25 17:02:18.000000000 +0200
+++ mozilla/security/coreconf/nsinstall/pathsub.h	2007-12-30 19:23:26.000000000 +0100
@@ -49,7 +49,7 @@
 #endif
 
 #ifndef PATH_MAX
-#define PATH_MAX 1024
+#error  "PATH_MAX is not defined!"
 #endif
 
 /*
diff -ur mozilla.orig/toolkit/mozapps/update/src/updater/updater.cpp mozilla/toolkit/mozapps/update/src/updater/updater.cpp
--- mozilla.orig/toolkit/mozapps/update/src/updater/updater.cpp	2007-09-09 01:31:16.000000000 +0200
+++ mozilla/toolkit/mozapps/update/src/updater/updater.cpp	2007-12-30 19:23:26.000000000 +0100
@@ -107,7 +107,8 @@
 # elif defined(CCHMAXPATH)
 #  define MAXPATHLEN CCHMAXPATH
 # else
-#  define MAXPATHLEN 1024
+#  include <limits.h>
+#  define MAXPATHLEN PATH_MAX
 # endif
 #endif
 
diff -ur mozilla.orig/toolkit/xre/nsAppRunner.h mozilla/toolkit/xre/nsAppRunner.h
--- mozilla.orig/toolkit/xre/nsAppRunner.h	2007-04-30 19:26:58.000000000 +0200
+++ mozilla/toolkit/xre/nsAppRunner.h	2007-12-30 19:23:26.000000000 +0100
@@ -48,7 +48,8 @@
 #elif defined(CCHMAXPATH)
 #define MAXPATHLEN CCHMAXPATH
 #else
-#define MAXPATHLEN 1024
+#include <limits.h>
+#define MAXPATHLEN PATH_MAX
 #endif
 #endif
 
diff -ur mozilla.orig/webshell/tests/viewer/nsViewerApp.cpp mozilla/webshell/tests/viewer/nsViewerApp.cpp
--- mozilla.orig/webshell/tests/viewer/nsViewerApp.cpp	2005-07-21 15:33:41.000000000 +0200
+++ mozilla/webshell/tests/viewer/nsViewerApp.cpp	2007-12-30 19:23:26.000000000 +0100
@@ -692,7 +692,8 @@
 
 #if !defined(XP_WIN) && !defined(XP_OS2)
 #ifndef XP_MAC
-#define _MAX_PATH 512
+#include <limits.h>
+#define _MAX_PATH PATH_MAX
 #endif
 #endif
 
diff -ur mozilla.orig/widget/src/xremoteclient/XRemoteClient.cpp mozilla/widget/src/xremoteclient/XRemoteClient.cpp
--- mozilla.orig/widget/src/xremoteclient/XRemoteClient.cpp	2006-03-30 10:01:13.000000000 +0200
+++ mozilla/widget/src/xremoteclient/XRemoteClient.cpp	2007-12-30 19:23:26.000000000 +0100
@@ -76,7 +76,8 @@
 #endif
     
 #ifndef MAX_PATH
-#define MAX_PATH 1024
+#include <limits.h>
+#define MAX_PATH PATH_MAX
 #endif
 
 #define ARRAY_LENGTH(array_) (sizeof(array_)/sizeof(array_[0]))
diff -ur mozilla.orig/xpcom/build/nsXPCOMPrivate.h mozilla/xpcom/build/nsXPCOMPrivate.h
--- mozilla.orig/xpcom/build/nsXPCOMPrivate.h	2006-01-09 20:03:09.000000000 +0100
+++ mozilla/xpcom/build/nsXPCOMPrivate.h	2007-12-30 19:23:26.000000000 +0100
@@ -252,7 +252,8 @@
 #elif defined(CCHMAXPATH)
 #define MAXPATHLEN CCHMAXPATH
 #else
-#define MAXPATHLEN 1024
+#include <limits.h>
+#define MAXPATHLEN PATH_MAX
 #endif
 #endif
 
diff -ur mozilla.orig/xpcom/io/SpecialSystemDirectory.cpp mozilla/xpcom/io/SpecialSystemDirectory.cpp
--- mozilla.orig/xpcom/io/SpecialSystemDirectory.cpp	2007-09-06 23:44:29.000000000 +0200
+++ mozilla/xpcom/io/SpecialSystemDirectory.cpp	2007-12-30 19:23:26.000000000 +0100
@@ -109,7 +109,8 @@
 #elif defined(CCHMAXPATH)
 #define MAXPATHLEN CCHMAXPATH
 #else
-#define MAXPATHLEN 1024
+#include <limits.h>
+#define MAXPATHLEN PATH_MAX
 #endif
 #endif
 
diff -ur mozilla.orig/xpcom/obsolete/nsFileSpecUnix.cpp mozilla/xpcom/obsolete/nsFileSpecUnix.cpp
--- mozilla.orig/xpcom/obsolete/nsFileSpecUnix.cpp	2006-11-28 01:18:37.000000000 +0100
+++ mozilla/xpcom/obsolete/nsFileSpecUnix.cpp	2007-12-30 19:23:26.000000000 +0100
@@ -79,7 +79,8 @@
 #endif
 
 #ifndef MAXPATHLEN
-#define MAXPATHLEN	1024  /* Guessing this is okay.  Works for SCO. */
+#include <limits.h>
+#define MAXPATHLEN	PATH_MAX  /* Guessing this is okay.  Works for SCO. */
 #endif
  
 #if defined(__QNX__)
diff -ur mozilla.orig/xpcom/typelib/xpidl/xpidl_java.c mozilla/xpcom/typelib/xpidl/xpidl_java.c
--- mozilla.orig/xpcom/typelib/xpidl/xpidl_java.c	2007-08-31 06:20:17.000000000 +0200
+++ mozilla/xpcom/typelib/xpidl/xpidl_java.c	2007-12-30 19:23:26.000000000 +0100
@@ -44,6 +44,7 @@
 #include "xpidl.h"
 #include <ctype.h>
 #include <glib.h>
+#include <limits.h>
 
 #ifdef XP_WIN
 #include <windef.h>


--- NEW FILE sunbird.desktop ---
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Sunbird Calendar
Name[de]=Sunbird Kalender
Name[cs]=Sunbird Kalendár
Name[sk]=Sunbird Kalendár
Comment=The Mozilla Calendar
Comment[de]=Der Mozilla-Kalender
Comment[cs]=Mozilla Kalendár
Comment[sk]=Mozilla Kalendár
GenericName=The Mozilla Calendar
GenericName[de]=Der Mozilla-Kalender
GenericName[cs]=Mozilla Kalendár
GenericName[sk]=Mozilla Kalendár
Exec=sunbird
TryExec=sunbird
Icon=sunbird
MimeType=text/calendar;text/x-vcalendar;
Categories=Office;Calendar;
Terminal=false


--- NEW FILE sunbird.spec ---
%define cairo_version 0.5
%define progdir %{_prefix}/%{_lib}/%{name}-%{version}
%define docs LEGAL LICENSE README.txt
%{?_with_official:%define official 1}

Name:           sunbird
Version:        0.7
Release:        8%{?official:.official}%{?dist}
Summary:        Mozilla Sunbird Calendar

Group:          Applications/Productivity
License:        MPLv1.1
URL:            http://www.mozilla.org/projects/calendar/sunbird/
Source0:        http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/%{version}/source/lightning-sunbird-%{version}-source.tar.bz2
Source1:        sunbird.desktop
Source2:        sunbird-langpacks-%{version}.tar.gz
Source3:        mozilla-extension-update.sh
Source100:      find-external-requires

# build patches
Patch1:         sunbird-0.3.1-link-layout.patch
Patch2:         sunbird-0.7-path.patch
   
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  cairo-devel >= %{cairo_version}
BuildRequires:  libpng-devel, libjpeg-devel
BuildRequires:  zlib-devel, zip
BuildRequires:  libIDL-devel
BuildRequires:  desktop-file-utils
BuildRequires:  libgnomeui-devel
BuildRequires:  krb5-devel
BuildRequires:  freetype-devel >= 2.1.9
BuildRequires:  libXt-devel
BuildRequires:  desktop-file-utils
BuildRequires:  glib2-devel
BuildRequires:  nss-devel

Requires(pre):  desktop-file-utils

AutoProv: 0
%define _use_internal_dependency_generator 0
%define __find_requires %{SOURCE100}

%description
Mozilla Sunbirdâ„¢ is a cross-platform calendar application, built upon
Mozilla Toolkit. Our goal is to bring Mozilla-style ease-of-use to your
calendar, without tying you to a particular storage solution.

%package     -n thunderbird-lightning
Summary:        The calendar extension to Thunderbird
Group:          Applications/Productivity
Requires:       thunderbird

%description -n thunderbird-lightning
Lightning brings the Sunbird calendar to the popular email client,
Mozilla Thunderbird. Since it's an extension, Lightning is tightly
integrated with Thunderbird, allowing it to easily perform email-related
calendaring tasks.

%package     -n thunderbird-lightning-wcap
Summary:        WCAP support in Mozilla Lightning
Group:          Applications/Productivity
Requires:       thunderbird-lightning = %{version}

%description -n thunderbird-lightning-wcap
This extension enables support for the Sun Java System Calendar Server
(WCAP) in the Lightning calendar extension.


%define tbupdate_lightning %{_libdir}/thunderbird-lightning/mozilla-extension-update.sh --appname thunderbird --extname {e2fda1a4-762b-4020-b5ad-a41df1933103} --basedir %{_libdir} --extpath %{_libdir}/thunderbird-lightning --action 
%define tbupdate_wcap %{_libdir}/thunderbird-lightning/mozilla-extension-update.sh --appname thunderbird --extname wcap-enabler at calendar.mozilla.org --basedir %{_libdir} --extpath %{_libdir}/thunderbird-lightning-wcap --action 

%prep
%setup -q -n mozilla
%patch1   -p1 -b .link-layout
%patch2   -p1 -b .path
# Fix source perms to avoid errors in the debuginfo RPM (bug 357661)
find . -type f \( -name "*.cpp" -o -name "*.h" \) -exec chmod -x '{}' \;


%build
%if 0%{?official}
export MOZILLA_OFFICIAL=1
export BUILD_OFFICIAL=1
%endif
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$CFLAGS"
cat << EOF > .mozconfig
%if 0%{?official}
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
ac_add_options --enable-official-branding
%endif
mk_add_options MOZ_MAKE_FLAGS=%{?_smp_mflags}
ac_add_options --enable-application=calendar
ac_add_options --prefix=%{_prefix}
ac_add_options --libdir=%{_libdir}
ac_add_options --sysconfdir=%{_sysconfdir}
ac_add_options --mandir=%{_mandir}
ac_add_options --includedir=%{_includedir}
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-png
ac_add_options --with-pthreads
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-installer
ac_add_options --enable-optimize="$RPM_OPT_FLAGS"
ac_add_options --enable-xinerama
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --disable-xprint
ac_add_options --disable-strip
ac_add_options --enable-pango
ac_add_options --enable-system-cairo
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --enable-extensions=default,lightning
ac_add_options --disable-updater
EOF
make -f client.mk build
# make package directory
make -C xpinstall/packager STRIP=/bin/true


%install
rm -rf $RPM_BUILD_ROOT
# The make install does not work (it tries to build additional stuff that break)
#make install DESTDIR=$RPM_BUILD_ROOT
# copy tree into RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{progdir}
cp -rf $RPM_BUILD_DIR/mozilla/dist/%{name}/* $RPM_BUILD_ROOT%{progdir}
mkdir $RPM_BUILD_ROOT%{_bindir}
ln -sf ../..%{progdir}/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}


desktop-file-install --vendor="mozilla"               \
       --dir=$RPM_BUILD_ROOT%{_datadir}/applications/   \
       %{SOURCE1}

# Fix some permissions
find $RPM_BUILD_ROOT%{progdir} -name "*.xpm" -o -name "*.png" | xargs chmod -x
chmod -x $RPM_BUILD_ROOT%{progdir}/defaults/profile/prefs.js \
         $RPM_BUILD_ROOT%{progdir}/js/calAlarmMonitor.js \
         $RPM_BUILD_ROOT%{progdir}/js/calFreeBusyService.js

# Avoid "Chrome Registration Failed" message on first startup and extension installation
touch $RPM_BUILD_ROOT%{progdir}/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/chrome.manifest

# Icon
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps
ln -s %{progdir}/icons/mozicon128.png \
    $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/%{name}.png

# Docs in %%doc
for doc in %{docs}; do rm -f $RPM_BUILD_ROOT%{progdir}/$doc; done

# Install langpacks
mkdir -p $RPM_BUILD_ROOT%{progdir}/extensions
rm -rf sunbird-langpacks ; mkdir sunbird-langpacks
tar xzf %{SOURCE2} -C sunbird-langpacks
for langpack in `ls sunbird-langpacks/*.xpi`; do
  language=`basename $langpack .xpi`
  extensiondir=$RPM_BUILD_ROOT%{progdir}/extensions/langpack-$language at sunbird.mozilla.org
  mkdir -p $extensiondir
  unzip $langpack -d $extensiondir
  find $extensiondir -type f | xargs chmod 644
done
rm -rf sunbird-langpacks

# Lightning
unzip -d $RPM_BUILD_ROOT%{_libdir}/thunderbird-lightning dist/xpi-stage/lightning.xpi
install -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_libdir}/thunderbird-lightning/mozilla-extension-update.sh
# Fix some permissions
chmod -x $RPM_BUILD_ROOT%{_libdir}/thunderbird-lightning/js/calAlarmMonitor.js \
         $RPM_BUILD_ROOT%{_libdir}/thunderbird-lightning/js/calFreeBusyService.js
# WCAP support for Lightning
unzip -d $RPM_BUILD_ROOT%{_libdir}/thunderbird-lightning-wcap dist/xpi-stage/wcap-enabler.xpi



%clean
rm -rf $RPM_BUILD_ROOT


%post
update-desktop-database %{_datadir}/applications
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%postun
update-desktop-database %{_datadir}/applications
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%post -n thunderbird-lightning
%{tbupdate_lightning} install || true

%preun -n thunderbird-lightning
if [ $1 = 0 ] ; then
    %{tbupdate_lightning} remove || true
fi

%postun -n thunderbird-lightning
# This is needed not to reverse the effect of our preun, which
# is guarded against upgrade, but because of our triggerun,
# which is run on self-upgrade, though triggerpostun isn't
if [ $1 != 0 ] ; then
    %{tbupdate_lightning} install || true
fi

%triggerin -n thunderbird-lightning -- thunderbird
%{tbupdate_lightning} install || true

%triggerun -n thunderbird-lightning -- thunderbird
%{tbupdate_lightning} remove || true

%triggerpostun -n thunderbird-lightning -- thunderbird
# Guard against being run post-self-uninstall, even though that
# doesn't happen currently (see comment above)
if [ "$1" != 0 ] ; then
    %{tbupdate_lightning} install || true
fi

# Same thing here for the second extension
%post -n thunderbird-lightning-wcap
%{tbupdate_wcap} install || true

%preun -n thunderbird-lightning-wcap
if [ $1 = 0 ] ; then
    %{tbupdate_wcap} remove || true
fi

%postun -n thunderbird-lightning-wcap
if [ $1 != 0 ] ; then
    %{tbupdate_wcap} install || true
fi

%triggerin -n thunderbird-lightning-wcap -- thunderbird
%{tbupdate_wcap} install || true

%triggerun -n thunderbird-lightning-wcap -- thunderbird
%{tbupdate_wcap} remove || true

%triggerpostun -n thunderbird-lightning-wcap -- thunderbird
if [ "$1" != 0 ] ; then
    %{tbupdate_wcap} install || true
fi


%files
%defattr(-,root,root,-)
%doc %{docs}
%{_bindir}/sunbird
%{_datadir}/applications/*.desktop
%{progdir}
%{_datadir}/icons/hicolor/128x128/apps/sunbird.png

%files -n thunderbird-lightning
%defattr(-,root,root,-)
%{_libdir}/thunderbird-lightning

%files -n thunderbird-lightning-wcap
%defattr(-,root,root,-)
%{_libdir}/thunderbird-lightning-wcap


%changelog
* Mon Jan 21 2008 Lubomir Kundrak <lkundrak at redhat.com> 0.7-8
- Streamlined BuildRequires a bit
- Do not provide stuff that has to be provided by firefox
- Do not require what's in our fileset
- Removed redundant and useless Source0 without upstream

* Thu Jan 03 2008 Lubomir Kundrak <lkundrak at redhat.com> 0.7-7
- Add patch to correct build with FORTIFY_SOURCE
- Replace the name in .desktop file with a more descriptive one
- Add translations to .desktop file

* Sun Dec 30 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.7-6
- disable updater

* Tue Dec 11 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.7-5
- fix debuginfo package

* Tue Oct 30 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.7-4
- rename the mozilla-lightning subpackage to thunderbird-lightning
  since it's a thunderbird extension
- create a "chrome.manifest" file to avoid "Chrome Registration Failed" message

* Mon Oct 29 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.7-3
- be even more complicated: build the wcap-enabler extension
  (really, it's just cut'n'paste)

* Mon Oct 29 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.7-2
- split the lightning package
- use scriptlets and triggers based on the mugshot package

* Sat Oct 27 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.7-1
- version 0.7

* Tue Sep 11 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.5-3
- minor spec cleanups
- build the Lightning extension
- add an option to build with official branding

* Sun Sep 09 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.5-2
- fix icon

* Wed Jul 25 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.5-1
- initial release


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/sunbird/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	19 Feb 2008 17:26:31 -0000	1.1
+++ .cvsignore	19 Feb 2008 17:49:15 -0000	1.2
@@ -0,0 +1,2 @@
+lightning-sunbird-0.7-source.tar.bz2
+sunbird-langpacks-0.7.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/sunbird/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	19 Feb 2008 17:26:31 -0000	1.1
+++ sources	19 Feb 2008 17:49:15 -0000	1.2
@@ -0,0 +1,2 @@
+14412fad1c72a5281164ca96f6c23cf4  lightning-sunbird-0.7-source.tar.bz2
+6de364aa11992f2e5d3e714592913c3c  sunbird-langpacks-0.7.tar.gz




More information about the fedora-extras-commits mailing list