Modernize the spec file

Shouldn't have any functional changes.
This commit is contained in:
Kalev Lember 2015-08-22 23:18:35 +02:00
parent 88eaba7d6e
commit 438eadce9d

View File

@ -8,27 +8,16 @@
%define python3_version 3.1
%endif
%if 1
# Verbose build
%global verbosity V=1
%else
# Quiet build
%global verbosity %{nil}
%endif
%global with_check 0
### Abstract ###
Name: pygobject3
Version: 3.17.90
Release: 2%{?dist}
License: LGPLv2+ and MIT
Group: Development/Languages
Summary: Python bindings for GObject Introspection
License: LGPLv2+ and MIT
URL: https://live.gnome.org/PyGObject
#VCS: git:git://git.gnome.org/pygobject
Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.17/pygobject-%{version}.tar.xz
Source0: http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.17/pygobject-%{version}.tar.xz
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
@ -67,7 +56,6 @@ for use in Python programs.
%package -n python-gobject
Summary: Python 2 bindings for GObject Introspection
Group: Development/Languages
Requires: python-gobject-base%{?_isa} = %{version}-%{release}
# The cairo override module depends on this
Requires: pycairo%{?_isa}
@ -83,7 +71,6 @@ for use in Python 2 programs.
%package -n python-gobject-base
Summary: Python 2 bindings for GObject Introspection base package
Group: Development/Languages
Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version}
Obsoletes: %{name}-base < 3.17.90-2
@ -94,20 +81,9 @@ Provides: %{name}-base%{?_isa} = %{version}-%{release}
This package provides the non-cairo specific bits of the GObject Introspection
library.
%package devel
Summary: Development files for embedding PyGObject introspection support
Group: Development/Languages
Requires: python-gobject%{?_isa} = %{version}-%{release}
Requires: python3-gobject%{?_isa} = %{version}-%{release}
Requires: gobject-introspection-devel%{?_isa}
%description devel
This package contains files required to embed PyGObject
%if 0%{?with_python3}
%package -n python3-gobject
Summary: Python 3 bindings for GObject Introspection
Group: Development/Languages
Requires: python3-gobject-base%{?_isa} = %{version}-%{release}
# The cairo override module depends on this
Requires: python3-cairo%{?_isa}
@ -119,7 +95,6 @@ for use in Python 3 programs.
%package -n python3-gobject-base
Summary: Python 3 bindings for GObject Introspection base package
Group: Development/Languages
Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version}
%description -n python3-gobject-base
@ -128,6 +103,15 @@ library.
%endif # with_python3
%package devel
Summary: Development files for embedding PyGObject introspection support
Requires: python-gobject%{?_isa} = %{version}-%{release}
Requires: python3-gobject%{?_isa} = %{version}-%{release}
Requires: gobject-introspection-devel%{?_isa}
%description devel
This package contains files required to embed PyGObject
%prep
%setup -q -n pygobject-%{version}
@ -143,14 +127,14 @@ find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
PYTHON=%{__python}
export PYTHON
%configure
make %{?_smp_mflags} %{verbosity}
make %{?_smp_mflags} V=1
%if 0%{?with_python3}
pushd %{py3dir}
PYTHON=%{__python3}
export PYTHON
%configure
make %{_smp_mflags} %{verbosity}
make %{?_smp_mflags} V=1
popd
%endif # with_python3
@ -176,7 +160,6 @@ cp -a examples _docs
rm _docs/examples/Makefile*
%check
%if %{with_check}
# Run the selftests under a temporary xvfb X server (so that they can
# initialize Gdk etc):
@ -191,11 +174,11 @@ rm _docs/examples/Makefile*
pushd %{py3dir}
PYTHON=%{__python3}
export PYTHON
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity}
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
popd
%endif # with_python3
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity}
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
%endif # with_check
@ -217,13 +200,6 @@ xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity}
%{python_sitearch}/pygobject-*.egg-info
%{python_sitearch}/pygtkcompat/
%files devel
%defattr(644, root, root, 755)
%doc _docs/*
%dir %{_includedir}/pygobject-3.0/
%{_includedir}/pygobject-3.0/pygobject.h
%{_libdir}/pkgconfig/pygobject-3.0.pc
%if 0%{?with_python3}
%files -n python3-gobject
%defattr(644, root, root, 755)
@ -238,9 +214,15 @@ xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity}
%exclude %{python3_sitearch}/gi/_gi_cairo*.so
%{python3_sitearch}/pygobject-*.egg-info
%{python3_sitearch}/pygtkcompat/
%endif # with_python3
%files devel
%defattr(644, root, root, 755)
%doc _docs/*
%dir %{_includedir}/pygobject-3.0/
%{_includedir}/pygobject-3.0/pygobject.h
%{_libdir}/pkgconfig/pygobject-3.0.pc
%changelog
* Sat Aug 22 2015 Kalev Lember <klember@redhat.com> - 3.17.90-2
- Rename Python 2 subpackage to python-gobject for consistency with the