## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 3;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by rust2rpm 24
%bcond_without check

%global crate gst-plugin-reqwest

Name:           rust-gst-plugin-reqwest
Version:        0.10.4
Release:        %autorelease
Summary:        GStreamer reqwest HTTP Source Plugin

License:        MIT OR Apache-2.0
URL:            https://crates.io/crates/gst-plugin-reqwest
Source:         %{crates_source}

BuildRequires:  rust-packaging >= 21

%global _description %{expand:
GStreamer reqwest HTTP Source Plugin.}

%description %{_description}

%package     -n gstreamer1-plugin-reqwest
Summary:        %{summary}

# (Apache-2.0 OR MIT) AND BSD-3-Clause
# 0BSD OR MIT OR Apache-2.0
# Apache-2.0
# Apache-2.0 OR BSL-1.0
# Apache-2.0 OR MIT
# MIT
# MIT OR Apache-2.0
# MIT OR Apache-2.0 OR Zlib
# MIT OR Zlib OR Apache-2.0
# Unlicense OR MIT
# Zlib OR Apache-2.0 OR MIT
License:        Apache-2.0 AND BSD-3-Clause AND MIT AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown

# additionally provide the upstream name
Provides:       %{crate} = %{version}-%{release}

%description -n gstreamer1-plugin-reqwest %{_description}

%files       -n gstreamer1-plugin-reqwest
%license LICENSE-APACHE
%license LICENSE-MIT
%license LICENSE.dependencies
%{_libdir}/gstreamer-1.0/libgstreqwest.so

%package        devel
Summary:        %{summary}
BuildArch:      noarch

%description    devel %{_description}

This package contains library source intended for building other packages which
use the "%{crate}" crate.

%files          devel
%license %{crate_instdir}/LICENSE-APACHE
%license %{crate_instdir}/LICENSE-MIT
%{crate_instdir}/

%package     -n %{name}+default-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+default-devel %{_description}

This package contains library source intended for building other packages which
use the "default" feature of the "%{crate}" crate.

%files       -n %{name}+default-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+capi-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+capi-devel %{_description}

This package contains library source intended for building other packages which
use the "capi" feature of the "%{crate}" crate.

%files       -n %{name}+capi-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+doc-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+doc-devel %{_description}

This package contains library source intended for building other packages which
use the "doc" feature of the "%{crate}" crate.

%files       -n %{name}+doc-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+static-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+static-devel %{_description}

This package contains library source intended for building other packages which
use the "static" feature of the "%{crate}" crate.

%files       -n %{name}+static-devel
%ghost %{crate_instdir}/Cargo.toml

%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
%cargo_prep

%generate_buildrequires
%cargo_generate_buildrequires
echo 'cargo-c'

%build
%cargo_build
%__cargo cbuild --release \
    --destdir=%{buildroot} \
    --prefix=%{_prefix} \
    --libdir=%{_libdir} \
    --includedir=%{_includedir} \
    --pkgconfigdir=%{_libdir}/pkgconfig
# write license summary and breakdown
%cargo_license_summary
%{cargo_license} > LICENSE.dependencies

%install
%cargo_install
%__cargo cinstall --release \
    --destdir=%{buildroot} \
    --prefix=%{_prefix} \
    --libdir=%{_libdir} \
    --includedir=%{_includedir} \
    --pkgconfigdir=%{_libdir}/pkgconfig
# remove statically linked library
rm -v %{buildroot}/%{_libdir}/gstreamer-1.0/libgstreqwest.a
# remove unnecessary pkgconfig file
rm -v %{buildroot}/%{_libdir}/pkgconfig/gstreqwest.pc

%if %{with check}
%check
%cargo_test
%endif

%changelog
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Wed May 03 2023 Fabio Valentini <decathorpe@gmail.com> - 0.10.4-2
- Rebuild with h2 >= v0.3.18 and tokio >= v1.24.2
  (RUSTSEC-2023-{0005,0034})

* Wed Apr 19 2023 Fabio Valentini <decathorpe@gmail.com> - 0.10.4-1
- Initial import (#2179161)