File scrcpy.spec of Package scrcpy

#
# spec file for package scrcpy
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 LISA GmbH, Bingen, 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/
#

%define SERVER_JAR scrcpy-server

Name:           scrcpy
Version:        1.16
Release:        0
Summary:        Display and control your Android device
License:        Apache-2.0
Group:          Productivity/Networking/Other
URL:            https://github.com/Genymobile/%{name}
# fake: we fetch git master from %%{url} by (disabled) service
Source:         %{name}-%{version}.tar.xz
Source1:        README.SUSE
# build from git with android sdk installed
Source2:        %{SERVER_JAR}
BuildRequires:  meson
BuildRequires:  java-1_8_0-openjdk-devel
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(sdl2)
Requires:       android-tools

%description
scrcpy provides display and control of Android devices connected on USB (or
over TCP/IP). It does not require any root access.

%prep
%setup -q
cp -p %{SOURCE1} README.SUSE
cp -p %{SOURCE2} %{SERVER_JAR}

%build
%meson --buildtype release \
    -Db_lto=true \
    -Dprebuilt_server=%{SERVER_JAR}
%meson_build

%install
%meson_install

%files
%license LICENSE
%doc *.md README.SUSE
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/%{name}-server

openSUSE Build Service is sponsored by