Hi Simon,
On Tue, 2008-01-29 at 15:09 +0800, simon.zheng at sun.com wrote:
> Hi,
>
> Glibmm is a set of C++ bindings for Glib2 Library, including
> cross-platform APIs such as a std::string-like UTF8 string class,
> string
> utility methods, such as a text encoding converter API, file access,
> and
> threads.
>
> Spec files are based on SFE version and changed a little. Please
> review.
This is one of the trickier modules, because it's C++.
The problem we need deal with is that of the different C++
ABIs of Sun Studio CC and GNU g++. Now that Sun Studio is
available as a free download it's not such a big problem,
but there are modules (inkscape is one of them) that won't
build with Sun Studio so it would be good to be able to
build against these libs with g++ too.
One possible solution is (and Doug started doing that in SFE)
to build and ship 2 copies of this library: one built with
Sun Studio and one build with g++. The g++-built lib is
installed in a non-default location, e.g. /usr/gnu, although
it may not be a good idea to overload /usr/gnu and in theory
there may be a C++ lib that clashes with an existing Solaris
lib in /usr/lib and therefore belongs to /usr/gnu.
So maybe /usr/lib/g++/libfoo.so is a better location.
Some comments on the spec files below.
>
>
>
>
>
> rpm spec file
> attachment
> (SUNWglibmm.spec)
>
> #
> # spec file for package SUNWglibmm
> #
> # includes module(s): glibmm
> #
> # # 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.
> #
> # Owner: SimonZheng
> #
> %include Solaris.inc
> %use glibmm = glibmm.spec
>
> Name: SUNWglibmm
> Summary: glibmm - C++ Wrapper for the Glib2 Library
> Version: %{default_pkg_version}
> SUNW_BaseDir: %{_basedir}
> BuildRoot: %{_tmppath}/%{name}-%{version}-build
>
> %include default-depend.inc
> Requires: SUNWgnome-base-libs
> BuildRequires: SUNWgnome-base-libs-devel
> Requires: SUNWsigcpp
Note: you can't commit this spec file until SUNWsigcpp is committed.
> BuildRequires: SUNWsigcpp-devel
>
> %package devel
> Summary: %{summary} - development files
> SUNW_BaseDir: %{_basedir}
> %include default-depend.inc
> Requires: %name
> Requires: SUNWgnome-base-libs-devel
>
> %if %build_l10n
> %package l10n
> Summary: %{summary} - l10n files
> SUNW_BaseDir: %{_basedir}
> %include default-depend.inc
> Requires: %{name}
> %endif
>
> %prep
> rm -rf %name-%version
> mkdir %name-%version
> %glibmm.prep -d %name-%version
> cd %{_builddir}/%name-%version
>
> %build
> %if %cc_is_gcc
> %else
> export CXX="${CXX} -norunpath"
> %endif
> export CXXFLAGS="%cxx_optflags"
> export PERL_PATH=/usr/perl5/bin/perl
> %glibmm.build -d %name-%version
>
> %install
> rm -rf $RPM_BUILD_ROOT
> %glibmm.install -d %name-%version
> find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
> find $RPM_BUILD_ROOT -type f -name "*.a" -exec rm -f {} ';'
>
> %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 /usr/bin/gtk-update-icon-cache || exit 0';
> echo 'rm -f %{_datadir}/icons/*/icon-theme.cache';
> echo 'ls -d %{_datadir}/icons/* | xargs
> -l1 /usr/bin/gtk-update-icon-cache'
> ) | $BASEDIR/lib/postrun -b -u -t 5 -c JDS
> ( echo 'test -x /usr/bin/update-desktop-database || exit 0';
> echo '/usr/bin/update-desktop-database'
> ) | $BASEDIR/lib/postrun -b -u -c JDS_wait
> ( echo 'test -x /usr/bin/scrollkeeper-update || exit 0';
> echo '/usr/bin/scrollkeeper-update'
> ) | $BASEDIR/lib/postrun -b -u -c JDS
Please use %include-s for these scripts.
> %postun
> test -x $BASEDIR/lib/postrun || exit 0
> ( echo 'test -x /usr/bin/update-desktop-database || exit 0';
> echo '/usr/bin/update-desktop-database'
> ) | $BASEDIR/lib/postrun -b -u -c JDS
> ( echo 'test -x /usr/bin/scrollkeeper-update || exit 0';
> echo '/usr/bin/scrollkeeper-update'
> ) | $BASEDIR/lib/postrun -b -u -c JDS
Same again.
> %files
> %defattr (-, root, bin)
> %dir %attr (0755, root, bin) %{_libdir}
> %{_libdir}/lib*
>
> %files devel
> %defattr (-, root, bin)
> %dir %attr (0755, root, bin) %{_libdir}
> %dir %attr (0755, root, other) %{_libdir}/pkgconfig
> %{_libdir}/pkgconfig/*
> %{_libdir}/glibmm*
> %dir %attr (0755, root, sys) %{_datadir}
> %dir %attr (0755, root, other) %{_datadir}/doc
> %{_datadir}/doc/*
> %dir %attr (0755, root, other) %{_datadir}/aclocal
> %{_datadir}/aclocal/*
> %dir %attr (0755, root, bin) %{_includedir}
> %{_includedir}/*
>
> %changelog
> * Mon Jau 28 2008 - simon.zheng at sun.com
> - Split into SUNWglibmm.spec and glibmm.spec.
> - Change download URL to GNOME official website.
> * Fri Aug 17 2007 - trisk at acm.jhu.edu
> - Bump to 2.12.10
> * Tue Apr 17 2007 - daymobrew at users.sourceforge.net
> - Bump to 2.12.8.
> * Fri Mar 16 2007 - laca at sun.com
> - bump to 2.12.7
> * Wed Jan 03 2007 - daymobrew at users.sourceforge.net
> - Bump to 2.12.4
> * Fri Jun 23 2006 - laca at sun.com
> - rename to SFEglibmm
> - update permissions
> - bump to 2.10.4
> * Fri May 12 2006 - damien.carbery at sun.com
> - Bump to 2.10.2.
> * Fri Mar 10 2006 - damien.carbery at sun.com
> - Bump to 2.10.0.
> * Thu Nov 17 2005 - laca at sun.com
> - create
>
>
>
>
>
>
>
> rpm spec file
> attachment
> (glibmm.spec)
>
> #
> # spec file for package glibmm
> #
> # 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.
> #
> # Owner: simonzheng
> #
> %include Solaris.inc
>
> Name: glibmm
> License: LGPL
> Group: System/Libraries
> Version: 2.12.10
> Release: 1
> Distribution: Java Desktop System
> Vendor: Sun Microsystems, Inc.
> Summary: glibmm - C++ Wrapper for the Glib2 Library
> URL: http://www.gtkmm.org/
> Source:
> http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.12/%{name}-%{version}.tar.bz2
> BuildRoot: %{_tmppath}/%{name}-%{version}-build
>
> %include default-depend.inc
> Requires: SUNWgnome-base-libs
> BuildRequires: SUNWgnome-base-libs-devel
> Requires: SUNWsigcpp
> BuildRequires: SUNWsigcpp-devel
These dependencies don't belong in the Linux spec file.
> %package devel
> Summary: %{summary} - development files
> SUNW_BaseDir: %{_basedir}
> %include default-depend.inc
> Requires: %name
> Requires: SUNWgnome-base-libs-devel
This one's wrong too.
Otherwise looks okay.
Laca
> %prep
> %setup -q -n glibmm-%version
>
> %build
> %ifos linux
> if [ -x /usr/bin/getconf ]; then
> CPUS=`getconf _NPROCESSORS_ONLN`
> fi
> %else
> CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
> %endif
> if test "x$CPUS" = "x" -o $CPUS = 0; then
> CPUS=1
> fi
>
> ./configure --prefix=%{_prefix} --mandir=%{_mandir} \
> --libdir=%{_libdir} \
> --libexecdir=%{_libexecdir} \
> --sysconfdir=%{_sysconfdir} --disable-python
> make -j$CPUS
>
> %install
> rm -rf $RPM_BUILD_ROOT
> make install DESTDIR=$RPM_BUILD_ROOT
>
> %clean
> rm -rf $RPM_BUILD_ROOT
>
> %files
> %defattr (-, root, bin)
> %dir %attr (0755, root, bin) %{_libdir}
> %{_libdir}/lib*
>
> %files devel
> %defattr (-, root, bin)
> %dir %attr (0755, root, bin) %{_libdir}
> %dir %attr (0755, root, other) %{_libdir}/pkgconfig
> %{_libdir}/pkgconfig/*
> %{_libdir}/glibmm*
> %dir %attr (0755, root, sys) %{_datadir}
> %dir %attr (0755, root, other) %{_datadir}/doc
> %{_datadir}/doc/*
> %dir %attr (0755, root, other) %{_datadir}/aclocal
> %{_datadir}/aclocal/*
> %dir %attr (0755, root, bin) %{_includedir}
> %{_includedir}/*
>
> %changelog
> * Mon Jau 28 2008 - simon.zheng at sun.com
> - Create. Split from SFEglibmm.
>