File untrunc.spec of Package untrunc

#
# spec file for package untrunc
#
# Copyright (c) 2021-2023, Martin Hauke <mardnh@gmx.de>
#
# 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 https://bugs.opensuse.org/
#

%bcond_with gui
#
Name:           untrunc
Version:        0~git20230223.acdc7ca
Release:        0
Summary:        Restore a damaged (truncated) mp4, m4v, mov, 3gp video
License:        GPL-2.0-or-later
Group:          Productivity/Multimedia/Video/Editors and Convertors
URL:            https://github.com/oneineight/untrunc/
#Git-Clone:     https://github.com/oneineight/untrunc.git
Source:         %{name}-%{version}.tar.xz
BuildRequires:  gcc-c++
%if 0%{with gui}
BuildRequires:  libui-devel
%endif
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)

%description
Restore a damaged (truncated) mp4, m4v, mov, 3gp video.

%prep
%setup -q

%build
export CXXFLAGS="%{optflags} $(pkg-config --cflags libavcodec libavformat) $(pkg-config --libs libavcodec libavformat)"
%make_build VER=%{version}
%if 0%{with gui}
%make_build untrunc-gui VER=%{version}
%endif

%install
install -D -m0755 untrunc %{buildroot}/%{_bindir}/untrunc
%if 0%{with gui}
install -D -m0755 untrunc-gui %{buildroot}/%{_bindir}/untrunc-gui
%endif

%files
%license COPYING
%doc README.md
%{_bindir}/untrunc
%if %{with gui}
%{_bindir}/untrunc-gui
%endif

%changelog
openSUSE Build Service is sponsored by