%global majorminor 1.0

Name:           gstreamer1-plugins-bad-free
Summary:        GStreamer streaming media framework "bad" plugins
Version:        1.22.6
Release:        1%{?_dist_release}
Group:          system,multimedia
Vendor:         Project Vine
Distribution:   Vine Linux

License:        LGPLv2+ and LGPLv2
Group:          system,multimedia
URL:            https://gstreamer.freedesktop.org/
# The source is:
# https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-%{version}.tar.xz
# modified with gst-p-bad-cleanup.sh from SOURCE1
Source0:        gst-plugins-bad-free-%{version}.tar.xz
Source1:        gst-p-bad-cleanup.sh

BuildRequires:  gstreamer1-devel >= %{version}
BuildRequires:  gstreamer1-plugins-base-devel >= %{version}

BuildRequires:  meson
BuildRequires:  ninja
BuildRequires:  check
BuildRequires:  gettext-devel
BuildRequires:  PyXML
BuildRequires:  libXt-devel
BuildRequires:  gtk-doc

BuildRequires:  bzip2-devel
BuildRequires:  exempi-devel
BuildRequires:  gsm-devel
BuildRequires:  openjpeg2-devel
BuildRequires:  opus-devel
Buildrequires:  bluez-libs-devel
## Plugin not ported
#BuildRequires:  ladspa-devel
BuildRequires:  libdvdnav-devel
BuildRequires:  libexif-devel
BuildRequires:  libmpcdec-devel
BuildRequires:  liboil-devel
BuildRequires:  librsvg2-devel
BuildRequires:  libsndfile-devel
BuildRequires:  libvpx-devel
BuildRequires:  mesa-libGLU-devel
BuildRequires:  openssl-devel
BuildRequires:  orc-devel
BuildRequires:  wavpack-devel
BuildRequires:  soundtouch-devel
BuildRequires:  wayland-devel
BuildRequires:  wayland-protocols-devel
BuildRequires:  libgudev-devel
BuildRequires:  libusb1-devel
BuildRequires:  gtk3-devel
BuildRequires:  libwebp-devel
BuildRequires:  lcms2-devel
BuildRequires:  libsrtp-devel

BuildRequires:  chrpath

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

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


%package devel
Summary:        Development files for the GStreamer media framework "bad" plug-ins
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       gstreamer1-plugins-base-devel


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

This package contains the development files for the plug-ins that
aren't tested well enough, or the code is not of good enough quality.


%debug_package


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


%build
%meson \
    -D package-name="Vine Linux GStreamer-plugins-bad package" \
    -D package-origin="http://vinelinux.org" \
    -D tests=disabled \
    -D fbdev=disabled -D decklink=disabled \
    -D assrender=disabled -D bs2b=disabled \
    -D chromaprint=disabled -D d3dvideosink=disabled \
    -D directsound=disabled \
    -D fluidsynth=disabled -D openexr=disabled \
    -D curl=disabled -D curl-ssh2=disabled \
    -D ttml=disabled -D kate=disabled \
    -D modplug=disabled \
    -D openal=disabled \
    -D opencv=disabled \
    -D wildmidi=disabled -D zbar=disabled \
    -D gme=disabled -D lv2=disabled \
    -D webrtc=disabled -D aom=disabled \
    -D teletext=disabled -D srt=disabled \
    -D openmpt=disabled -D microdns=disabled \
    -D ladspa=disabled \
    -D doc=disabled -D magicleap=disabled -D msdk=disabled \
    -D dts=disabled -D faac=disabled -D faad=disabled \
    -D mpeg2enc=disabled -D mplex=disabled \
    -D neon=disabled -D rtmp=disabled \
    -D flite=disabled -D sbc=disabled -D opencv=disabled \
    -D spandsp=disabled -D va=disabled \
    -D voamrwbenc=disabled \
    -D x265=disabled \
    -D dvbsuboverlay=disabled -D dvdspu=disabled -D siren=disabled \
    -D opensles=disabled -D tinyalsa=disabled \
    -D wasapi=disabled -D wasapi2=disabled -D avtp=disabled \
    -D dc1394=disabled -D directfb=disabled -D iqa=disabled \
    -D libde265=disabled -D openni2=disabled \
    -D musepack=disabled \
    -D svthevcenc=disabled -D voaacenc=disabled \
    -D zxing=disabled -D wpe=disabled -D x11=disabled \
    -D ldac=disabled \
    -D qroverlay=disabled \
    -D openh264=disabled -D gs=disabled -D isac=disabled \
    -D onnx=disabled -D openaptx=disabled -Dgpl=enabled \
    -D amfcodec=disabled -D directshow=disabled -D qsv=disabled \
    -D vulkan=disabled \
    -D fdkaac=disabled \
    -D webrtcdsp=disabled \
    %{nil}

%meson_build


%install
%meson_install

# Register as an AppStream component to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p %{buildroot}%{_datadir}/metainfo
cat > %{buildroot}%{_datadir}/metainfo/gstreamer-bad-free.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2013 Richard Hughes <richard@hughsie.com> -->
<component type="codec">
  <id>gstreamer-bad-free</id>
  <metadata_license>CC0-1.0</metadata_license>
  <name>GStreamer Multimedia Codecs - Extra</name>
  <summary>Multimedia playback for AIFF, DVB, GSM, MIDI, MXF and Opus</summary>
  <description>
    <p>
      This addon includes several additional codecs that are missing
      something - perhaps a good code review, some documentation, a set of
      tests, a real live maintainer, or some actual wide use.
      However, they might be good enough to play your media files.
    </p>
    <p>
      These codecs can be used to encode and decode media files where the
      format is not patent encumbered.
    </p>
    <p>
      A codec decodes audio and video for for playback or editing and is also
      used for transmission or storage.
      Different codecs are used in video-conferencing, streaming media and
      video editing applications.
    </p>
  </description>
  <keywords>
    <keyword>AIFF</keyword>
    <keyword>DVB</keyword>
    <keyword>GSM</keyword>
    <keyword>MIDI</keyword>
    <keyword>MXF</keyword>
    <keyword>Opus</keyword>
  </keywords>
  <url type="homepage">http://gstreamer.freedesktop.org/</url>
  <url type="bugtracker">https://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer</url>
  <url type="help">http://gstreamer.freedesktop.org/documentation/</url>
  <url type="donation">http://www.gnome.org/friends/</url>
  <update_contact><!-- upstream-contact_at_email.com --></update_contact>
</component>
EOF

%find_lang gst-plugins-bad-%{majorminor}

# unpackaged files
rm %{buildroot}%{_bindir}/playout


%files -f gst-plugins-bad-%{majorminor}.lang
%license COPYING
%doc AUTHORS NEWS README.md README.static-linking RELEASE REQUIREMENTS

%{_datadir}/metainfo/*.appdata.xml
%{_bindir}/gst-transcoder-%{majorminor}

# presets
%dir %{_datadir}/gstreamer-%{majorminor}/presets/
%{_datadir}/gstreamer-%{majorminor}/presets/*.prs
%{_datadir}/gstreamer-%{majorminor}/encoding-profiles/device/*.gep
%{_datadir}/gstreamer-%{majorminor}/encoding-profiles/file-extension/*.gep
%{_datadir}/gstreamer-%{majorminor}/encoding-profiles/online-services/*.gep

%{_libdir}/libgst*-%{majorminor}.so.*

# Plugins
%{_libdir}/gstreamer-%{majorminor}/*.so
%exclude %{_libdir}/libgstadaptivedemux-%{majorminor}.so
%exclude %{_libdir}/libgstbasecamerabinsrc-%{majorminor}.so
%exclude %{_libdir}/libgstbadaudio-%{majorminor}.so
%exclude %{_libdir}/libgstcuda-%{majorminor}.so
%exclude %{_libdir}/libgstcodecparsers-%{majorminor}.so
%exclude %{_libdir}/libgstcodecs-%{majorminor}.so
%exclude %{_libdir}/libgstinsertbin-%{majorminor}.so
%exclude %{_libdir}/libgstisoff-%{majorminor}.so
%exclude %{_libdir}/libgstmpegts-%{majorminor}.so
%exclude %{_libdir}/libgstplay-%{majorminor}.so
%exclude %{_libdir}/libgstplayer-%{majorminor}.so
%exclude %{_libdir}/libgstphotography-%{majorminor}.so
%exclude %{_libdir}/libgstsctp-%{majorminor}.so
%exclude %{_libdir}/libgsttranscoder-%{majorminor}.so
%exclude %{_libdir}/libgsturidownloader-%{majorminor}.so
%exclude %{_libdir}/libgstwebrtc-%{majorminor}.so
%exclude %{_libdir}/libgstwayland-%{majorminor}.so

%{_libdir}/girepository-1.0/*Gst*-%{majorminor}.typelib


%files devel
%{_datadir}/gir-1.0/*Gst*-%{majorminor}.gir

# pkg-config files
%{_libdir}/pkgconfig/gstreamer-*.pc

%{_libdir}/libgstadaptivedemux-%{majorminor}.so
%{_libdir}/libgstbasecamerabinsrc-%{majorminor}.so
%{_libdir}/libgstbadaudio-%{majorminor}.so
%{_libdir}/libgstcuda-%{majorminor}.so
%{_libdir}/libgstcodecparsers-%{majorminor}.so
%{_libdir}/libgstcodecs-%{majorminor}.so
%{_libdir}/libgstinsertbin-%{majorminor}.so
%{_libdir}/libgstisoff-%{majorminor}.so
%{_libdir}/libgstmpegts-%{majorminor}.so
%{_libdir}/libgstplay-%{majorminor}.so
%{_libdir}/libgstplayer-%{majorminor}.so
%{_libdir}/libgstphotography-%{majorminor}.so
%{_libdir}/libgstsctp-%{majorminor}.so
%{_libdir}/libgsttranscoder-%{majorminor}.so
%{_libdir}/libgsturidownloader-%{majorminor}.so
%{_libdir}/libgstwebrtc-%{majorminor}.so
%{_libdir}/libgstwayland-%{majorminor}.so

%{_includedir}/gstreamer-%{majorminor}/gst/*


%changelog
* Mon Oct 02 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.22.6-1
- new upstream release.

* Sun Jun 23 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.16.0-1
- new upstream release.

* Mon Nov 05 2018 Toshiaki Ara <ara_t@384.jp> 1.12.4-2
- rebuild with openssl-1.1.1

* Thu Feb 22 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.12.4-1
- new upstream release.

* Fri Jul 15 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8.2-1
- new upstream release

* Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.4-3
- rebuild with gcc-5.4.0

* Thu May 05 2016 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.6.4-2
- rebuilt with soundtouch-1.9.2

* Wed May 04 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.4-1
- new upstream release

* Sun Jan 24 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.3-1
- new upstream release

* Sat Dec 19 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.2-1
- new upstream release

* Sat Oct 31 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.1-1
- new upstream release
- update Source1 (gst-p-bad-cleanup.sh)

* Sun Mar 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.5-1
- new upstream release

* Sat Nov 22 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.4.4-2
- added Group tag

* Tue Nov 18 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.4-1
- new upstream release

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.3-1
- new upstream release

* 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

* Sat Oct 26 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
- update Source1 (gst-p-bad-cleanup.sh)

* 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.2-1
- new upstream release

* Mon Oct 08 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.1-1
- new upstream release

* Fri Sep 28 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.0-1
- initial build for Vine Linux


* Fri Sep 14 2012 Brian Pepple <bpepple@fedoraproject.org> - 0.11.94-1
- Update to 0.11.94.

* Sat Aug 18 2012 Brian Pepple <bpepple@fedoraproject.org> - 0.11.93-2
- Fix permission on tarball clean-up script.
- Re-enable soundtouch-devel.
- Add COPYING.LIB to package.
- Use %%global instead of %%define.

* Wed Aug 15 2012 Brian Pepple <bpepple@fedoraproject.org> - 0.11.93-1
- Update to 0.11.93.

* Fri Jul 20 2012 Brian Pepple <bpepple@fedoraproject.org> - 0.11.92-1
- Initial Fedora spec file.
