1)  bluefish-01-debug_func.diff
You should define DEBUG_MSG as empty when DEBUG is not defined.

2) bluefish-03-pcre-devel.diff
You should add
pkg-config --cflags libpcre
to compile line rather than change the source code.

Ginn

On Jul 16, 2008, at 11:14 PM, Alfred Peng wrote:

> Hi,
>
> Please help me review the spec file for Bluefish. SUNWbluefish.spec  
> will be in spec-files-other/core.
>
> Thanks,
> -Alfred
> #
> # spec file for package SUNWbluefish
> #
> # Copyright 2008 Sun Microsystems, Inc.
> # This file and all modifications and additions to the pristine
> # package are under the same license as the package itself.
>
> # includes module(s): bluefish
> #
> %include Solaris.inc
>
> Name:                    SUNWbluefish
> Summary:                 Bluefish, a powerful editor for experienced  
> web designers.
> Version:                 1.0.7
> Source:                  
> http://www.bennewitz.com/bluefish/stable/source/bluefish- 
> %{version}.tar.bz2
> URL:                     http://bluefish.openoffice.nl/index.html
> SUNW_Copyright:          SUNWbluefish.copyright
>
> # owner:alfred date:2008-07-16 type:bug
> Patch1:                  bluefish-01-debug_func.diff
> # owner:alfred date:2008-07-16 type:branding
> Patch2:                  bluefish-02-update-mime.diff
> # owner:alfred date:2008-07-16 type:branding
> Patch3:                  bluefish-03-pcre-devel.diff
> SUNW_BaseDir:            %{_basedir}
> BuildRoot:               %{_tmppath}/%{name}-%{version}-build
> %include default-depend.inc
> Requires: SUNWpcre
> Requires: SUNWgnome-spell
> Requires: SUNWgnome-libs
> BuildRequires: SUNWgnome-libs-devel
> Requires: SUNWlibC
>
> %if %build_l10n
> %package l10n
> Summary:                 %{summary} - l10n files
> SUNW_BaseDir:            %{_basedir}
> %include default-depend.inc
> Requires:                %{name}
> %endif
>
> %prep
> %setup -q -n bluefish-%version
> %patch1 -p1
> %patch2 -p1
> %patch3 -p1
>
> %build
> CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
> if test "x$CPUS" = "x" -o $CPUS = 0; then
>    CPUS=1
> fi
> export CFLAGS="%optflags -I/usr/gnu/include -I/usr/sfw/include - 
> DANSICPP"
> export CPPFLAGS="-I/usr/sfw/include"
> export LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib -L/usr/gnu/lib -R/usr/ 
> gnu/lib"
>
> ./configure --prefix=%{_prefix} --mandir=%{_mandir} \
>            --libdir=%{_libdir}              \
>            --libexecdir=%{_libexecdir}      \
>            --sysconfdir=%{_sysconfdir}
> make -j$CPUS
>
> %install
> rm -rf $RPM_BUILD_ROOT
> make install DESTDIR=$RPM_BUILD_ROOT
>
> %if %build_l10n
> %else
> # REMOVE l10n FILES
> rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
> %endif
>
> %clean
> rm -rf $RPM_BUILD_ROOT
>
> %post
> ( echo 'test -x %{_bindir}/update-mime-database || exit 0';
>  echo '%{_bindir}/update-mime-database %{_datadir}/mime'
> ) | $PKG_INSTALL_ROOT/usr/lib/postrun -b -u
>
> %files
> %defattr (-, root, bin)
> %dir %attr (0755, root, bin) %{_bindir}
> %{_bindir}/*
> %dir %attr (0755, root, sys) %{_datadir}
> %dir %attr (0755, root, other) %{_datadir}/application-registry
> %{_datadir}/application-registry/*
> %dir %attr (0755, root, other) %{_datadir}/applications
> %{_datadir}/applications/*
> %{_datadir}/bluefish
> %ghost %attr (0755, root, root)  %{_datadir}/mime
> %dir %attr (0755, root, other) %{_datadir}/mime-info
> %{_datadir}/mime-info/*
> %dir %attr (0755, root, other) %{_datadir}/pixmaps
> %{_datadir}/pixmaps/*
> %dir %attr(0755, root, bin) %{_mandir}
> %dir %attr(0755, root, bin) %{_mandir}/man1
> %{_mandir}/man1/*
>
> %if %build_l10n
> %files l10n
> %defattr (-, root, bin)
> %dir %attr (0755, root, sys) %{_datadir}
> %attr (-, root, other) %{_datadir}/locale
> %endif
>
> %changelog
> * Wed Jul 16 2008 - alfred.peng at sun.com
> - remove bluefish-01-timeval.diff and add bluefish-03-pcre-devel.diff
>  to get rid of the build dependency on SUNWpcre-devel.
> * Wed Oct 17 2007 - laca at sun.com
> - define l10n subpkg
> * Tue Oct 16 2007 - laca at sun.com
> - add /usr/gnu to search paths for the indiana build
> * Thu Mar 29 2007 - daymobrew at users.sourceforge.net
> - Change Requires of SUNWaspell to SUNWgnome-spell. Former has been  
> obsoleted.
> * Wed Jan 24 2007 - daymobrew at users.sourceforge.net
> - s/SFEpcre/SUNWpcre/ because SUNWpcre is in Vermillion Devel.
> * Fri Jan 07 2007 - daymobrew at users.sourceforge.net
> - Bump to 1.0.7. Update source url.
> * Mon Jun 12 2006 - laca at sun.com
> - rename to SFEbluefish
> - change to root:bin to follow other JDS pkgs.
> * Mon Jan 30 2006 - glynn.foster at sun.com
> - Initial version
> --- bluefish-1.0.5/src/highlight.c.orig       2006-02-10  
> 16:32:16.264145000 +0000
> +++ bluefish-1.0.5/src/highlight.c    2006-02-10 16:35:13.346604000 +0000
> @@ -1258,8 +1258,10 @@
> #endif
>                       /* if the tags ends at itstart there is no need to 
> search forward  
> to the end */
>                       if (!gtk_text_iter_ends_tag(&itstart, 
> GTK_TEXT_TAG(slist->data))) {
> +#ifdef DEBUG
>                               DEBUG_MSG("doc_highlight_line, (1) forward 
> looking for tag %p  
> (%s) from so=%d to eo=%d\n", slist->data,  
> get_metaname_from_tag(slist->data),
>                                                 
> gtk_text_iter_get_offset(&itstart),  
> gtk_text_iter_get_offset(&itend));
> +#endif
>                               tag_found = 
> gtk_text_iter_forward_to_tag_toggle(&itsearch,  
> GTK_TEXT_TAG(slist->data));
>                               if (!tag_found) {
>                                       /* this happens with several gtk 
> versions,
> @@ -1281,7 +1283,9 @@
>                                                
> gtk_text_iter_forward_char(&itsearch);
>                                       }
>                               }
> +#ifdef DEBUG
>                               DEBUG_MSG("doc_highlight_line, (1) tag %p (%s) 
> ends at itsearch= 
> %d\n", slist->data, get_metaname_from_tag(slist- 
> >data),gtk_text_iter_get_offset(&itsearch));
> +#endif
>                               if (gtk_text_iter_compare(&itsearch, &itend) > 
> 0) {
>                                       /* both the start and endpoint are 
> within this
>                                          tag --> pattern matching can start 
> with this
> @@ -1324,10 +1328,14 @@
>                                          itstart to the beginning of this tag,
>                                               there is also no need anymore 
> to look further in slist, we  
> have to start with this patternlist */
>                                       if (gtk_text_iter_begins_tag(&itstart, 
> GTK_TEXT_TAG(slist- 
> >data))) {
> +#ifdef DEBUG
>                                               DEBUG_MSG("doc_highlight_line, 
> (1) itstart at %d is already at  
> the beginning of tag %p (%s)\n",gtk_text_iter_get_offset(&itstart),  
> slist->data, get_metaname_from_tag(slist->data));
> +#endif
>                                       } else {
> +#ifdef DEBUG
>                                               DEBUG_MSG("doc_highlight_line, 
> (1) move itstart from %d to  
> beginning of tag %p (%s)\n",
>                                                                 
> gtk_text_iter_get_offset(&itstart), slist->data,  
> get_metaname_from_tag(slist->data));
> +#endif
>                                               
> gtk_text_iter_backward_to_tag_toggle(&itstart,  
> GTK_TEXT_TAG(slist->data));
>                                               DEBUG_MSG("doc_highlight_line, 
> (1) itstart is set back to %d 
> \n", gtk_text_iter_get_offset(&itstart));
>                                       }
> @@ -1354,8 +1362,10 @@
>                       gboolean tag_found;
>                                       /* if the tags starts at itend there is 
> no need to search  
> backward to the start */
>                       if (!gtk_text_iter_begins_tag(&itend, 
> GTK_TEXT_TAG(slist->data))) {
> +#ifdef DEBUG
>                               DEBUG_MSG("doc_highlight_line, (2) backwards 
> looking for tag %p  
> (%s) from eo=%d to so=%d, itsearch=%d\n", slist->data,
>                                                 
> get_metaname_from_tag(slist->data),  
> gtk_text_iter_get_offset 
> (&itend 
> ),gtk_text_iter_get_offset 
> (&itstart) ,gtk_text_iter_get_offset(&itsearch));
> +#endif
> #ifdef DEBUG
>                               DEBUG_MSG("does the itsearch position (%d) 
> toggle(%d), begin(%d)  
> or end(%d) the tag %p (%s)?\n"
>                                               
> ,gtk_text_iter_get_offset(&itsearch)
> @@ -1386,7 +1396,9 @@
>                                               }
>                                       }
>                               }
> +#ifdef DEBUG
>                               DEBUG_MSG("doc_highlight_line, (2) tag %p (%s) 
> starts at  
> itsearch=%d\n", slist->data,get_metaname_from_tag(slist- 
> >data),gtk_text_iter_get_offset(&itsearch));
> +#endif
>                               if (gtk_text_iter_compare(&itsearch, &itstart) 
> <= 0) {
>                                       /* both the start and endpoint are 
> within this
>                                          tag --> pattern matching can start 
> with this
> @@ -1395,10 +1407,14 @@
>                                       /* this tag starts somewhere in the 
> middle of the line, move
>                                          itend to the end of this tag */
>                                       if (gtk_text_iter_ends_tag(&itend, 
> GTK_TEXT_TAG(slist->data))) {
> +#ifdef DEBUG
>                                               DEBUG_MSG("doc_highlight_line, 
> (2) itend at %d is already at  
> the end of tag %p (%s)\n",
>                                                                 
> gtk_text_iter_get_offset(&itend), slist- 
> >data,get_metaname_from_tag(slist->data));
> +#endif
>                                       } else {
> +#ifdef DEBUG
>                                               DEBUG_MSG("doc_highlight_line, 
> (2) move itend from %d to end  
> of tag %p (%s)\n",gtk_text_iter_get_offset(&itend), slist->data,  
> get_metaname_from_tag(slist->data));
> +#endif
>                                               
> gtk_text_iter_forward_to_tag_toggle(&itend, GTK_TEXT_TAG(slist- 
> >data));
>                                               DEBUG_MSG("doc_highlight_line, 
> (2) itend is set forward to %d 
> \n", gtk_text_iter_get_offset(&itend));
>                                       }
> --- bluefish-1.0.5/data/Makefile.in.orig      2006-02-10  
> 18:03:19.392428000 +0000
> +++ bluefish-1.0.5/data/Makefile.in   2006-02-10 18:13:28.694247000  
> +0000
> @@ -58,14 +58,14 @@
>       $(INSTALL_DATA) bluefish-project.desktop $(DESTDIR)$(FDMENU)
>
> install-update-menu:
> -     $(UPDATE_DESKTOP)
> +     # $(UPDATE_DESKTOP)
>
> install-fdmime:
>       $(INSTALL_DIR) $(DESTDIR)$(FDMIME)/packages
>       $(INSTALL_DATA) bluefish.xml $(DESTDIR)$(FDMIME)/packages
>
> install-update-mime:
> -     $(UPDATE_MIME) $(FDMIME)
> +     # $(UPDATE_MIME) $(DESTDIR)$(FDMIME)
>
> install-gnome-2.4-mime:
>       $(INSTALL_DIR) $(DESTDIR)$(GMIMEINFO)
> --- bluefish-1.0.7/src/snr2.c.orig    Wed Jul  9 18:41:51 2008
> +++ bluefish-1.0.7/src/snr2.c Wed Jul  9 18:42:32 2008
> @@ -50,7 +50,7 @@
> #include <string.h>
> #include <sys/types.h>    /* _before_ regex.h for freeBSD */
> #include <regex.h>        /* regcomp() */
> -#include <pcre.h>         /* pcre_compile */
> +#include <pcre/pcre.h>         /* pcre_compile */
>
> #ifdef HAVE_PCRE_UTF8
> #ifndef PCRE_UTF8         /* for compatibility with older libpcre's */
> --- bluefish-1.0.7/src/bluefish.h.orig        Wed Jul  9 18:42:12 2008
> +++ bluefish-1.0.7/src/bluefish.h     Wed Jul  9 18:42:51 2008
> @@ -66,7 +66,7 @@
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <unistd.h>
> -#include <pcre.h>
> +#include <pcre/pcre.h>
>
> #ifdef HAVE_GNOME_VFS
> #include <libgnomevfs/gnome-vfs.h>
> --- bluefish-1.0.7/src/highlight.c.orig       Wed Jul  9 18:42:22 2008
> +++ bluefish-1.0.7/src/highlight.c    Wed Jul  9 18:42:56 2008
> @@ -37,7 +37,7 @@
>
> #include <gtk/gtk.h>
> #include <sys/types.h>    /* _before_ regex.h for freeBSD */
> -#include <pcre.h>         /* pcre_*() */
> +#include <pcre/pcre.h>         /* pcre_*() */
>
> #ifdef HAVE_PCRE_UTF8
> #ifndef PCRE_UTF8         /* for compatibility with older libpcre's */
> --- bluefish-1.0.7/src/document.c.orig        Wed Jul 16 14:14:32 2008
> +++ bluefish-1.0.7/src/document.c     Wed Jul 16 14:14:38 2008
> @@ -39,7 +39,7 @@
> #include <regex.h>             /* regcomp() */
> #include <stdlib.h>            /* system() */
> #include <time.h>              /* ctime_r() */
> -#include <pcre.h>
> +#include <pcre/pcre.h>
>
> /* #define DEBUG */
>

--------
Ginn Chen
Software Engineer, Browser Team
Sun Microsystems, Inc.
Phone: x82869 / +86-10-62673869
Fax: +86-10-62780969



Reply via email to