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