michael@273: ## michael@273: ## glib2.spec -- OpenPKG RPM Package Specification michael@273: ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. michael@273: ## michael@273: ## Permission to use, copy, modify, and distribute this software for michael@273: ## any purpose with or without fee is hereby granted, provided that michael@273: ## the above copyright notice and this permission notice appear in all michael@273: ## copies. michael@273: ## michael@273: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@273: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@273: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@273: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@273: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@273: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@273: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@273: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@273: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@273: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@273: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@273: ## SUCH DAMAGE. michael@273: ## michael@273: michael@273: # package version michael@273: %define V_glib2_major 2.25 michael@273: %define V_glib2_minor 13 michael@273: michael@273: # package information michael@273: Name: glib2 michael@273: Summary: The Gtk Utility Library michael@273: URL: http://www.gtk.org/ michael@273: Vendor: The Gtk Project michael@273: Packager: OpenPKG Foundation e.V. michael@273: Distribution: OpenPKG Community michael@273: Class: BASE michael@273: Group: Algorithm michael@273: License: GPL michael@273: Version: %{V_glib2_major}.%{V_glib2_minor} michael@274: Release: 20101020 michael@273: michael@273: # package options michael@273: %option with_threads yes michael@273: michael@273: # list of sources michael@273: Source0: ftp://ftp.gnome.org/pub/gnome/sources/glib/%{V_glib2_major}/glib-%{version}.tar.gz michael@273: Patch0: glib2.patch michael@273: michael@273: # build information michael@274: Prefix: %{l_prefix} michael@274: BuildRoot: %{l_buildroot} michael@273: BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make, pkgconfig michael@273: PreReq: OpenPKG, openpkg >= 20100101, perl michael@273: BuildPreReq: gettext, libiconv, pcre, pcre::with_utf8 = yes michael@273: PreReq: gettext, libiconv, pcre, pcre::with_utf8 = yes michael@273: michael@273: %description michael@273: GLib is the low-level core library that originally was split out michael@273: from Gtk+. It provides data structure handling for C, portability michael@273: wrappers, and interfaces for such runtime functionality as an event michael@273: loop, threads, dynamic loading, and an object system. michael@273: michael@273: %track michael@273: prog glib2 = { michael@273: version = %{version} michael@273: url = ftp://ftp.gnome.org/pub/gnome/sources/glib/%{V_glib2_major}/ michael@273: regex = glib-(__VER__)\.tar\.(gz|bz2) michael@273: } michael@273: michael@273: %prep michael@273: %setup -q -n glib-%{version} michael@273: %patch -p0 michael@273: michael@273: %build michael@273: # configure package michael@273: %{l_shtool} subst \ michael@273: -e 's;\$export_dynamic_flag_spec;;g' \ michael@273: -e 's;eval echo \\\\;eval echo ;' \ michael@273: configure michael@273: %{l_shtool} subst \ michael@273: -e 's;/glib-2\.0\.pc;/glib-x.x.pc;g' \ michael@273: -e 's;/gobject-2\.0\.pc;/gobject-x.x.pc;g' \ michael@273: -e 's;/gthread-2\.0\.pc;/gthread-x.x.pc;g' \ michael@273: -e 's;/gmodule-2\.0\.pc;/gmodule-x.x.pc;g' \ michael@273: -e 's;/gio-unix-2\.0\.pc;/gio-unix-x.x.pc;g' \ michael@273: -e 's;/gio-2\.0\.pc;/gio-x.x.pc;g' \ michael@273: -e 's;/glib-2\.0;/glib2;g' \ michael@273: -e 's;/gobject-2\.0;/gobject2;g' \ michael@273: -e 's;/gthread-2\.0;/gthread2;g' \ michael@273: -e 's;/gmodule-2\.0;/gmodule2;g' \ michael@273: -e 's;/gio-unix-2\.0;/gio-unix2;g' \ michael@273: -e 's;/gio-2\.0;/gio2;g' \ michael@273: -e 's;/glib-x\.x\.pc;/glib-2.0.pc;g' \ michael@273: -e 's;/gobject-x\.x\.pc;/gobject-2.0.pc;g' \ michael@273: -e 's;/gthread-x\.x\.pc;/gthread-2.0.pc;g' \ michael@273: -e 's;/gmodule-x\.x\.pc;/gmodule-2.0.pc;g' \ michael@273: -e 's;/gio-unix-x\.x\.pc;/gio-unix-2.0.pc;g' \ michael@273: -e 's;/gio-x\.x\.pc;/gio-2.0.pc;g' \ michael@273: -e 's;lib\(g[a-z]*\)-2\.0;lib\12;g' \ michael@273: `find . -name Makefile.in -print` \ michael@273: m4macros/glib-2.0.m4 michael@273: %{l_shtool} subst \ michael@273: -e 's;/glib-2\.0;/glib2;g' \ michael@273: -e 's;/gobject-2\.0;/gobject2;g' \ michael@273: -e 's;/gthread-2\.0;/gthread2;g' \ michael@273: -e 's;/gmodule-2\.0;/gmodule2;g' \ michael@273: -e 's;/gio-unix-2\.0;/gio-unix2;g' \ michael@273: -e 's;/gio-2\.0;/gio2;g' \ michael@273: -e 's;-l\(g[a-z]*\)-2\.0;-l\12;g' \ michael@273: *-2.0.pc.in michael@273: libs="" michael@273: %if "%{with_threads}" == "yes" michael@273: case "%{l_platform -t}" in michael@273: *-netbsd* ) libs="-lpthread" ;; michael@273: esac michael@273: %endif michael@273: CC="%{l_cc}" \ michael@273: CFLAGS="%{l_cflags -O}" \ michael@273: CPPFLAGS="%{l_cppflags}" \ michael@273: LDFLAGS="%{l_ldflags}" \ michael@273: LIBS="$libs" \ michael@273: PERL="%{l_prefix}/bin/perl" \ michael@273: PERL_PATH="%{l_prefix}/bin/perl" \ michael@273: GREP="grep" \ michael@273: ./configure \ michael@273: --prefix=%{l_prefix} \ michael@273: --mandir=%{l_prefix}/man \ michael@273: --with-libiconv=gnu \ michael@273: --disable-debug \ michael@273: --disable-shared \ michael@273: --with-pcre=system \ michael@273: %if "%{with_threads}" == "yes" michael@273: --enable-threads \ michael@273: %else michael@273: --disable-threads \ michael@273: %endif michael@273: --disable-gtk-doc \ michael@273: --disable-dtrace michael@273: michael@273: # build package michael@273: %{l_make} %{l_mflags} michael@273: michael@273: %install michael@274: rm -rf $RPM_BUILD_ROOT michael@274: michael@273: # install package michael@274: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@273: michael@273: # strip down installation michael@273: rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir michael@273: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias michael@273: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale michael@273: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/glib-2.0 michael@273: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gtk-doc michael@273: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gdb michael@273: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@273: rm $RPM_BUILD_ROOT%{l_prefix}/lib/*.la michael@273: michael@273: # determine installation files michael@273: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@273: michael@273: %files -f files michael@273: michael@273: %clean michael@274: rm -rf $RPM_BUILD_ROOT michael@273: