File gstreamer-0_10.spec of Package gstreamer-0_10

#
# spec file for package gstreamer-0_10
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           gstreamer-0_10
%define build_doc 0
%define _name gstreamer
Version:        0.10.36
Release:        0
%define gst_branch 0.10
Summary:        Streaming-Media Framework Runtime
License:        LGPL-2.1+
Group:          Productivity/Multimedia/Other
Url:            http://gstreamer.freedesktop.org/
Source0:        http://gstreamer.freedesktop.org/src/gstreamer/%{_name}-%{version}.tar.xz
Source1:        gstreamer-0_10.macros
Source2:        gstreamer-0_10.prov
Source99:       baselibs.conf
# PATCH-FIX-OPENSUSE gstreamer-0_10-no-gtk-doc-for-reals.patch maw@novell.com -- to build without gtk-doc, like totally for reals
Patch0:         gstreamer-0_10-no-gtk-doc-for-reals.patch
# PATCH-FEATURE-UPSTREAM gstreamer-0_10-rpm-prov.patch bgo#588783 dimstar@opensuse.org -- Add --rpm parameter to allow creation of rpm provides, patch from fedora
Patch1:         gstreamer-0_10-rpm-prov.patch
# PATCH-FIX-UPSTREAM gstreamer-no-setlocale.patch bnc#779426 bgo#685650 dimstar@opensuse.org -- Don't set the locale in gst_init().
Patch2:         gstreamer-no-setlocale.patch
# PATCH-FIX-UPSTREAM gstreamer-0_10-bison3.patch bgo#706462 dimstar@opensuse.org -- Fix build with Bison 3
Patch3:         gstreamer-0_10-bison3.patch
# PATCH-FIX-UPSTREAM gstreamer-0_10-gtk-doc-1.25.patch dimstar@opensuse.org -- Fix build with gtk-doc 1.25. index.sgml is an internal file and must not be messed with (and with gtk-doc 1.25 it is no longer created).
Patch4:         gstreamer-0_10-gtk-doc-1.25.patch
BuildRequires:  bison
BuildRequires:  check-devel
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  glib2-devel >= 2.24
BuildRequires:  gnome-patch-translation
%if %suse_version >= 1120
BuildRequires:  gobject-introspection-devel >= 0.6.8
%endif
BuildRequires:  libtool
BuildRequires:  libxml2-devel
BuildRequires:  translation-update-upstream
%ifarch %ix86 ppc x86_64
BuildRequires:  valgrind-devel
%endif
%if %suse_version <= 1210
BuildRequires:  xz
%endif
%if %build_doc
BuildRequires:  docbook-toys
BuildRequires:  docbook-utils
BuildRequires:  gtk-doc
BuildRequires:  python
BuildRequires:  python-xml
BuildRequires:  transfig
%if %suse_version <= 1020
# Missing in transfig:
BuildRequires:  ghostscript-fonts-std
BuildRequires:  ghostscript-library
%endif
%if %suse_version > 1030
BuildRequires:  texlive-latex
BuildRequires:  texlive-latex-doc
%endif
%endif
%if %build_doc
# Ensure that the documentation corresponds with the installed version:
Requires:       libgstreamer-0_10-0 = %{version}
# Name up to 10.3:
Provides:       gstreamer010-doc = %{version}
Obsoletes:      gstreamer010-doc < %{version}
%else
# Core modules may depend on new enough libraries:
Requires:       libgstreamer-0_10-0 >= %{version}
Recommends:     %{name}-lang = %{version}
# Name up to 10.3:
Provides:       gstreamer010 = %{version}
Obsoletes:      gstreamer010 < %{version}
Obsoletes:      gstreamer010-lang < %{version}
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
GStreamer is a streaming-media framework, based on graphs of filters
which operate on media data. Applications using this library can do
anything from real-time sound processing to playing videos, and just
about anything else media-related.  Its plug-in-based architecture
means that new data types or processing capabilities can be added by
installing new plug-ins.

%if !%build_doc

%package -n libgstreamer-0_10-0
Summary:        Streaming-Media Framework Runtime
Group:          System/Libraries
# We want to have core modules installed:
Requires:       %{name}

%description -n libgstreamer-0_10-0
GStreamer is a streaming-media framework, based on graphs of filters
which operate on media data. Applications using this library can do
anything from real-time sound processing to playing videos, and just
about anything else media-related.  Its plug-in-based architecture
means that new data types or processing capabilities can be added by
installing new plug-ins.

%if %suse_version >= 1120
%package -n typelib-1_0-Gst-0_10
Summary:        Streaming-Media Framework Runtime -- Introspection bindings
Group:          System/Libraries

%description -n typelib-1_0-Gst-0_10
GStreamer is a streaming-media framework, based on graphs of filters
which operate on media data. Applications using this library can do
anything from real-time sound processing to playing videos, and just
about anything else media-related.  Its plug-in-based architecture
means that new data types or processing capabilities can be added by
installing new plug-ins.

This package provides the GObject Introspection bindings for GStreamer.
%endif

%package utils
Summary:        Streaming-Media Framework Runtime
Group:          Productivity/Multimedia/Other
# Name up to 10.3:
Provides:       gstreamer010:%{_bindir}/gst-launch-%{gst_branch} = %{version}
# Symbol for unversioned wrappers:
Provides:       gstreamer-utils_versioned

%description utils
GStreamer is a streaming-media framework, based on graphs of filters
which operate on media data. Applications using this library can do
anything from real-time sound processing to playing videos, and just
about anything else media-related.  Its plug-in-based architecture
means that new data types or processing capabilities can be added by
installing new plug-ins.

%package utils-unversioned
Summary:        Streaming-Media Framework Runtime
Group:          Productivity/Multimedia/Other
# Name up to 10.3:
Provides:       gstreamer010:%{_bindir}/gst-launch = %{version}
# Was renamed from gstreamer-utils at the beginning of 12.3 to avoid conflict with gstreamer 1.0
Provides:       gstreamer-utils = %{version}
Obsoletes:      gstreamer-utils < %{version}
# At least one versioned package has to be present:
Requires:       gstreamer-utils_versioned

%description utils-unversioned
GStreamer is a streaming-media framework, based on graphs of filters
which operate on media data. Applications using this library can do
anything from real-time sound processing to playing videos, and just
about anything else media-related.  Its plug-in-based architecture
means that new data types or processing capabilities can be added by
installing new plug-ins.

%package devel
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
# gstreamer-utils is required for the gstreamer-provides rpm magic.
Requires:       %{name}-utils
Requires:       libgstreamer-0_10-0 = %{version}
%if %suse_version >= 1120
Requires:       typelib-1_0-Gst-0_10 = %{version}
%endif
# Name up to 10.3:
Provides:       gstreamer010-devel = %{version}
Obsoletes:      gstreamer010-devel < %{version}

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

%endif
%lang_package

%prep
%setup -q -n %{_name}-%{version}
translation-update-upstream po gstreamer-0.10
gnome-patch-translation-prepare po gstreamer-0.10
%if ! %build_doc
%patch0 -p1
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
gnome-patch-translation-update po gstreamer-0.10

%build
# FIXME: GTKDOC_CFLAGS, GST_OBJ_CFLAGS:
# Silently ignored compilation of uninstalled gtk-doc scanners without RPM_OPT_FLAGS.
export V=1
%if %suse_version >= 1110
NOCONFIGURE=1 ./autogen.sh
%endif
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%configure --libexecdir=%{_libdir} \
%if %build_doc
	--enable-gtk-doc\
	--enable-docbook\
%endif
%if %suse_version >= 1120
        --enable-introspection\
%endif
	--disable-static
make %{?jobs:-j%jobs}

%install
%makeinstall
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gstreamer-%{gst_branch}/presets
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
%if %build_doc
mv $RPM_BUILD_ROOT%{_datadir}/doc/gstreamer-*/* $RPM_BUILD_ROOT%{_docdir}/%{name}
rmdir $RPM_BUILD_ROOT%{_datadir}/doc/gstreamer-*
%else
# TODO is empty
cp AUTHORS COPYING ChangeLog NEWS README RELEASE $RPM_BUILD_ROOT%{_docdir}/%{name}
%find_lang %{_name}-%{gst_branch}
rm $RPM_BUILD_ROOT%{_libdir}/gstreamer-*/*.*a
%endif
%if %build_doc
rm -rf $RPM_BUILD_ROOT/%{_bindir}/*
rm -rf $RPM_BUILD_ROOT/%{_libdir}
rm -rf $RPM_BUILD_ROOT/%{_datadir}/aclocal
rm -rf $RPM_BUILD_ROOT/%{_includedir}/*
rm -rf $RPM_BUILD_ROOT/%{_datadir}/locale
rm -rf $RPM_BUILD_ROOT/%{_mandir}
rm -rf $RPM_BUILD_ROOT%{_datadir}/gir-1.0/
rm -rf $RPM_BUILD_ROOT%{_datadir}/gstreamer-%{gst_branch}
rm -rf %{buildroot}%{_libexecdir}/gstreamer-%{gst_branch}/gst-plugin-scanner
%else
rm -rf $RPM_BUILD_ROOT/%{_datadir}/gtk-doc
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}/manual
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}/pwg
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gstreamer-%{gst_branch}/presets
# Install the rpm macros
%if 0%?suse_version >= 1210
%__install -m644 -D %{S:1} %{buildroot}%{_libexecdir}/rpm/fileattrs/gstreamer_0_10.attr
%else
%__install -m644 -D %{S:1} %{buildroot}%{_sysconfdir}/rpm/macros.gstreamer_0_10
%endif
%__install -m755 -D %{S:2} %{buildroot}%{_libexecdir}/rpm/gstreamer-0_10-provides
%endif
%fdupes %{buildroot}

%clean
rm -rf $RPM_BUILD_ROOT
%if ! %build_doc

%post -n libgstreamer-0_10-0 -p /sbin/ldconfig

%postun -n libgstreamer-0_10-0 -p /sbin/ldconfig
%endif
%if %build_doc

%files
%defattr(-,root,root)
%doc %dir %{_docdir}/%{name}
%{_datadir}/gtk-doc/html/*
%doc %{_docdir}/%{name}/manual
%doc %{_docdir}/%{name}/pwg
%doc %{_docdir}/%{name}/faq
%else

%files
%defattr(-, root, root)
%dir %{_datadir}/gstreamer-%{gst_branch}
%dir %{_datadir}/gstreamer-%{gst_branch}/presets
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/AUTHORS
%doc %{_docdir}/%{name}/COPYING
%doc %{_docdir}/%{name}/ChangeLog
%doc %{_docdir}/%{name}/NEWS
%doc %{_docdir}/%{name}/README
%doc %{_docdir}/%{name}/RELEASE
%dir %{_libdir}/gstreamer-%{gst_branch}
%{_libdir}/gstreamer-%{gst_branch}/*.so
%{_libdir}/gstreamer-%{gst_branch}/gst-plugin-scanner

%files lang -f %{_name}-%{gst_branch}.lang

%files -n libgstreamer-0_10-0
%defattr(-, root, root)
%{_libdir}/*.so.*

%if %suse_version >= 1120
%files -n typelib-1_0-Gst-0_10
%defattr(-, root, root)
%{_libdir}/girepository-1.0/Gst-0.10.typelib
%{_libdir}/girepository-1.0/GstBase-0.10.typelib
%{_libdir}/girepository-1.0/GstCheck-0.10.typelib
%{_libdir}/girepository-1.0/GstController-0.10.typelib
%{_libdir}/girepository-1.0/GstNet-0.10.typelib
%endif

%files utils
%defattr(-, root, root)
%{_bindir}/*-%{gst_branch}
%doc %{_mandir}/man?/*-%{gst_branch}.*

%files utils-unversioned
%defattr(-, root, root)
%{_bindir}/*
%exclude %{_bindir}/*-%{gst_branch}

%files devel
%defattr(-, root, root)
%{_datadir}/aclocal/*.m4
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/*.*a
%{_libdir}/pkgconfig/*.pc
%{_libexecdir}/rpm
%if 0%?suse_version < 1210
%{_sysconfdir}/rpm
%endif
%if %suse_version >= 1120
%{_datadir}/gir-1.0/*.gir
%endif
%endif

%changelog