%define majorminor   1.0
%define gstreamer    gstreamer1

%define gst_minver   1.2.4
%define gstpb_minver 1.2.4

Summary: GStreamer streaming media framework "bad" plug-ins
Name: gstreamer1-plugins-bad
Version: 1.2.4
Release: 1%{?_dist_release}
# The freeze and nfs plugins are LGPLv2 (only)
License: LGPLv2+
Group: Applications/Multimedia
URL: http://gstreamer.freedesktop.org/
Source: http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: %{gstreamer} >= %{gst_minver}
BuildRequires: %{gstreamer}-devel >= %{gst_minver}
BuildRequires: %{gstreamer}-plugins-base-devel >= %{gstpb_minver}
BuildRequires: %{gstreamer}-plugins-bad-free-devel >= %{gstpb_minver}

BuildRequires: check
BuildRequires: gettext
BuildRequires: PyXML
BuildRequires: libXt-devel

BuildRequires: bzip2-devel
BuildRequires: celt-devel
BuildRequires: exempi-devel
BuildRequires: jasper-devel
#BuildRequires: ladspa-devel
BuildRequires: libass-devel
BuildRequires: libdc1394-devel
BuildRequires: libdvdnav-devel
BuildRequires: libexif-devel
#BuildRequires: libiptcdata-devel
BuildRequires: kate-devel
BuildRequires: libmodplug-devel
BuildRequires: libmpcdec-devel
#BuildRequires: libofa-devel
BuildRequires: librsvg2-devel
BuildRequires: libsndfile-devel
#BuildRequires: libtimidity-devel
BuildRequires: libvpx-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: openssl-devel
BuildRequires: orc-devel
#BuildRequires: schroedinger-devel
BuildRequires: SDL-devel
#BuildRequires: slv2-devel
BuildRequires: soundtouch-devel
BuildRequires: wavpack-devel
#BuildRequires: wildmidi-devel
#BuildRequires: zbar-devel
BuildRequires: libmms-devel
BuildRequires: twolame-devel
#BuildRequires: libmimic-devel

# self build
#BuildRequires: libdca-devel
#BuildRequires: faad2-devel
#BuildRequires: xvidcore-devel
#BuildRequires: mjpegtools-devel


%description
GStreamer is a streaming media framework, based on graphs of elements which
operate on media data.

This package contains plug-ins that have licensing issues, aren't tested
well enough, or the code is not of good enough quality.


# %package extras
# Summary: Extra GStreamer "bad" plugins (less often used "bad" plugins)
# Group: Applications/Multimedia
# Requires: %{name} = %{version}-%{release}

# %description extras
# GStreamer is a streaming media framework, based on graphs of elements which
# operate on media data.

# gstreamer1-plugins-bad contains plug-ins that have licensing issues, aren't
# tested well enough, or the code is not of good enough quality.

# This package (gstreamer1-plugins-bad-extras) contains extra "bad" plugins for
# sources (mythtv), sinks (jack, nas) and effects (pitch) which are not used
# very much and require additional libraries to be installed.


%prep
%setup -q -n gst-plugins-bad-%{version}

%build
%configure \
	--enable-debug --disable-static --disable-gtk-doc --enable-experimental

# Don't use rpath!
%{__sed} -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
%{__sed} -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%{__make} %{?_smp_mflags}


%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR="%{buildroot}"

# Clean out files that should not be part of the rpm.
%{__rm} -f %{buildroot}%{_libdir}/gstreamer-%{majorminor}/*.la
%{__rm} -f %{buildroot}%{_libdir}/*.la

# conflict with gstreamer1-plugins-bad
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/*.so*
%{__rm} -rf $RPM_BUILD_ROOT%{_libdir}/girepository-1.0
%{__rm} -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig
%{__rm} -rf $RPM_BUILD_ROOT%{_includedir}
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}

REMOVE_MODULE_LIST=" \
	libgstadpcmdec.so \
	libgstadpcmenc.so \
	libgstasfmux.so \
	libgstaudiovisualizers.so \
	libgstautoconvert.so \
	libgstbayer.so \
	libgstbz2.so \
	libgstcamerabin2.so \
	libgstcoloreffects.so \
	libgstdataurisrc.so \
	libgstdebugutilsbad.so \
	libgstdtmf.so \
	libgstdvb.so \
	libgstfestival.so \
	libgstfieldanalysis.so \
	libgstfragmented.so \
	libgstfrei0r.so \
	libgstgaudieffects.so \
	libgstgdp.so \
	libgstgeometrictransform.so \
	libgstgsm.so \
	libgstid3tag.so \
	libgstinter.so \
	libgstinterlace.so \
	libgstjpegformat.so \
	libgstliveadder.so \
	libgstmpegpsdemux.so \
	libgstmpegtsdemux.so \
	libgstmpegpsmux.so \
	libgstmpegtsmux.so \
	libgstmidi.so \
	libgstneonhttpsrc.so \
	libgstpcapparse.so \
	libgstpnm.so \
	libgstrawparse.so \
	libgstremovesilence.so \
	libgstresindvd.so \
	libgstrfbsrc.so \
	libgstrtpmux.so \
	libgstrtpvp8.so \
	libgstscaletempoplugin.so \
	libgstsdpelem.so \
	libgstsegmentclip.so \
	libgstshm.so \
	libgstsmooth.so \
	libgstsoundtouch.so \
	libgstspeed.so \
	libgstsubenc.so \
	libgstvideoparsersbad.so \
	libgsty4mdec.so \
	libgstaccurip.so \
	libgstaiff.so \
	libgstaudiofxbad \
	libgstfreeverb.so \
	libgstivtc.so \
	libgstmfc.so \
	libgstmxf.so \
	libgstrsvg.so \
	libgstvideofiltersbad.so \
	libgstaudiofxbad.so \
	libgstyadif.so"
for file in $REMOVE_MODULE_LIST; do
	rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-%{majorminor}/$file
done

%clean
%{__rm} -rf %{buildroot}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README REQUIREMENTS
%{_libdir}/gstreamer-%{majorminor}/libgstassrender.so
%{_libdir}/gstreamer-%{majorminor}/libgstdecklink.so
%{_libdir}/gstreamer-%{majorminor}/libgstdtsdec.so
%{_libdir}/gstreamer-%{majorminor}/libgstdvbsuboverlay.so
%{_libdir}/gstreamer-%{majorminor}/libgstdfbvideosink.so
%{_libdir}/gstreamer-%{majorminor}/libgstdvdspu.so
%{_libdir}/gstreamer-%{majorminor}/libgstfaac.so
%{_libdir}/gstreamer-%{majorminor}/libgstfaad.so
%{_libdir}/gstreamer-%{majorminor}/libgstmms.so
%{_libdir}/gstreamer-%{majorminor}/libgstmodplug.so
%{_libdir}/gstreamer-%{majorminor}/libgstmpeg2enc.so
%{_libdir}/gstreamer-%{majorminor}/libgstmplex.so
%{_libdir}/gstreamer-%{majorminor}/libgstopenal.so
%{_libdir}/gstreamer-%{majorminor}/libgstrtmp.so
%{_libdir}/gstreamer-%{majorminor}/libgstsiren.so
%{_libdir}/gstreamer-%{majorminor}/libgstdashdemux.so
%{_libdir}/gstreamer-%{majorminor}/libgstfbdevsink.so
%{_libdir}/gstreamer-%{majorminor}/libgstsmoothstreaming.so
%{_libdir}/gstreamer-%{majorminor}/libgstvdpau.so


%changelog
* Sat Apr 19 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.4-1
- new upstream release

* Sun Mar 16 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.3-1
- new upstream release

* Mon Dec 30 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.2-1
- new upstream release

* Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.1-1
- new upstream release

* Sun Oct 27 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.0-1
- new upstream release

* Sat Aug 31 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.10-1
- new upstream release

* Sun Aug 11 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.9-1
- new upstream release

* Mon Jul 15 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.8-1
- new upstream release

* Sun Apr 28 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.7-1
- new upstream release

* Sat Mar 23 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.6-1
- new upstream release

* Wed Jan 09 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.5-1
- new upstream release

* Wed Jan 02 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.4-1
- new upstream release

* Fri Oct 26 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.1-2
- new upstream release
- rename package

* Sun Dec 18 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.10.22-1
- new upstream release
- added BuildRequires: libvpx-devel

* Wed Nov  2 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.10.21-2
- s/self-build-libdvdnav/libdvdnav/

* Sat Mar 26 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.10.21-1
- new upstream release
- added BuildRequires: 
  - libmms-devel
  - librtmp-devel

* Fri Sep 17 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.10.20-1
- new upstream release

* Sun Jun 27 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.10.19-1
- new upstream release

* Sat Mar 20 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.10.18-1
- new upstream release
- added BuildRequires: libvdpau-devel

* Wed Feb 17 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.10.17-1
- new upstream release

* Wed May 27 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.10.12-1
- new upstream release
- dropped gstreamer-plugins-bad-0.10.5-sys-modplug.patch, 
  gst-plugins-bad-0.10.5-mms-seek.patch

* Sun Mar 01 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.10.10-1
- new upstream release
- dropped devel and devel-docs subpackages

* Sun Feb 15 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.10.9-2
- rebuild with twolame-devel, libmpcdec-devel, mjpegtools-devel
- changed to BuildRequires:  self-build-faad2 from faad2-devel

* Sun Jan 11 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.10.9-1
- initial build based on RPM Fusion package

* Sat Dec 27 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.9-3
- Put devel docs in seperate subpackage to avoid multilib conflict (rf 276)

* Wed Dec 17 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.9-2
- Rebuild for new x264 (using patch from Rathann)

* Sun Oct 26 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.9-1
- New upstream release 0.10.9
- Rebuild for new directfb

* Sun Sep 14 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.8-4
- Rebuild for new x264 and to generate new magic gstreamer provides

* Sat Aug 16 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.8-3
- Enable DVD navigation plugin

* Fri Aug  1 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.8-2
- Release bump to keep rpmfusion version higher then livna

* Fri Aug  1 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.8-1
- New upstream release 0.10.8
- Merge changes from latest freshrpms package: enable ofa and dirac plugins

* Fri Jun 27 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.7-2
- Rebuild for new x264

* Thu Apr 24 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.7-1
- New upstream release 0.10.7
- Drop many upstreamed patches

* Sun Mar  9 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.6-3
- Rebuild for new x264

* Tue Feb 26 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.6-2
- Enable dc1394 plugin

* Sun Feb 24 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.6-1
- New upstream release 0.10.6-1
- Drop many upstreamed patches
- Fixes conflict with the latest gstreamer-plugins-good (livna 1884)

* Tue Feb  5 2008  Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-15
- Fix compilation with gcc 4.3

* Tue Feb  5 2008  Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-14
- Add flv demuxer from CVS (livna bug 1846)

* Sun Dec  9 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-13
- Add patch fixing compilation with mjpegtools 1.9.0rc3

* Sun Dec  9 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-12
- Add patch from upstream vcs which makes mms honor your connection speed
  settings
- Add (painstakingly self written) patch adding support for mms / mmsh seeking! 

* Tue Nov 13 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-11
- Rebuild for new faad2

* Sun Nov  4 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-10
- Rebuild for new libdca

* Thu Oct 18 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-9
- Rebuild for new (old) faad2 (livna bug 1679)

* Sat Sep 29 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-8
- Update mythtvsrc code to CVS version (livna bug 1660)

* Thu Sep 27 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-7
- No libgstreal.so on ppc / ppc64

* Thu Sep 27 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-6
- Fix detection of libdts with current livna libtds, this might need to be
  changed back again for rpmfusion, depending on how libdts will look there

* Sat Sep 22 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-5
- Add mythtvsrc plugin (livna 1646)
- Put some less often used plugins, which bring in also usually not installed
  deps in a -extras package

* Sat Sep 15 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.10.5-4
- Merge livna spec bugfixes into freshrpms spec for rpmfusion:
- Set release to 4 to be higher as both livna and freshrpms latest release
- Set package name and origin to rpmfusion
- Make mpeg2enc plugin compile with current mjpegtools
- Make the real plugins search for the RealPlayer .so files in various
  known possible locations instead of using only one hardcoded path to them
- Make the wildmidi plugin work with the default Fedora timidity patch set
- Add a couple of missing modtracker mimetypes to the modplug plugin
- Use the system version of libmodplug
- Fix building of the neonsrc plugin with the latest (rawhide) neon
- Disable the ladspa plugin as this has been added to Fedora's rawhide
  gstreamer-plugins-good
- Don't put an rpath in the .so's on x86_64
- Re-enable gtk-doc now that we have a -devel package again
- Enable libtimidity plugin
- Fix detection of (and linking with) libdca for the dtsdec plugin

* Tue Aug 21 2007 Matthias Saou <http://freshrpms.net/> 0.10.5-1
- Update to 0.10.5.
- Update faad2 patch : Some fixes went in, but faad2.h still produces an error.
- Remove libgstqtdemux, libgstvideocrop and libgstwavpack, all are in good now.
- Enable new nas, x264, wildmidi and libsndfile plugins.
- Re-add devel package now that we have a main shared lib and header files.
- Add check build requirement.

* Fri Mar 30 2007 Matthias Saou <http://freshrpms.net/> 0.10.4-1
- Update to 0.10.4 for F7.
- Disable swfdec... does anything/anyone even use it here? Once it stabilizes
  somewhat more, maybe then it'll be worth re-enabling.
- Re-enable wavpack, it works again now.
- Enable libcdaudio support.
- Enable jack support.
- Enable ladspa support.
- Enable mpeg2enc (mjpegtools) support.
- Remove no longer present libgstvideo4linux2.so and add all new plugins.
- Remove all gtk-doc references (all gone...?) and devel package too.

* Tue Jan  9 2007 Matthias Saou <http://freshrpms.net/> 0.10.3-3
- Update faad2 patch to also update the plugin sources, not just configure.

* Mon Dec 18 2006 Matthias Saou <http://freshrpms.net/> 0.10.3-2
- Try to rebuild against new wavpack 4.40 from Extras : Fails.
- Try to update to 0.10.3.2 pre-release : Fails, it needs a more recent gst.
- Try to include patch to update wavpack plugin source from 0.10.3.2
  pre-release : Fails to find wavpack/md5.h.
- Give up and disable wavpack support for now, sorry! Patches welcome.
- Include patch to fix faad2 2.5 detection.
- Add soundtouch support.

* Thu Jun  1 2006 Matthias Saou <http://freshrpms.net/> 0.10.3-1
- Update to 0.10.3.
- Add new translations.
- Add libgstmodplug.so, libgstvideo4linux2.so and libgstxingheader.so.
- Add new libmusicbrainz support.

* Thu Mar 23 2006 Matthias Saou <http://freshrpms.net/> 0.10.1-2
- Add libmms support, thanks to Daniel S. Rogers.

* Wed Feb 22 2006 Matthias Saou <http://freshrpms.net/> 0.10.1-1
- Update to 0.10.1.
- Add libgstcdxaparse.so and libgstfreeze.so.
- Enable libgstbz2.so, libgstglimagesink.so and libgstneonhttpsrc.so.

* Wed Jan 25 2006 Matthias Saou <http://freshrpms.net/> 0.10.0.1-1
- Update to 0.10.0.1, add new plugins.
- Spec file cleanup and rebuild for FC5.

* Mon Dec 05 2005 Thomas Vander Stichele <thomas at apestaart dot org>
- 0.10.0-0.gst.1
- new release

* Thu Dec 01 2005 Thomas Vander Stichele <thomas at apestaart dot org>
- 0.9.7-0.gst.1
- new release with 0.10 major/minor

* Sat Nov 12 2005 Thomas Vander Stichele <thomas at apestaart dot org>
- new release
- remove tta patch
- don't check for languages, no translations yet
- added gtk-doc

* Wed Oct 26 2005 Thomas Vander Stichele <thomas at apestaart dot org>
- 0.9.4-0.gst.1
- new release
- added speed plugin

* Mon Oct 03 2005 Thomas Vander Stichele <thomas at apestaart dot org>
- 0.9.3-0.gst.1
- new release