File miraclecast.spec of Package miraclecast

#
# spec file for package miraclecast
#
# Copyright (c) 2021 SUSE LLC
#
# 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/
#


# program name
%define progname miracle

# options
%define with_checks no

Name:           miraclecast
Summary:        A wifi-display/miracast implementation
License:        LGPL-2.1-only AND GPL-2.0-only AND GPL-2.0-or-later
Group:          Productivity/Multimedia/Other
Version:        1.0+git20210103
Release:        0
URL:            https://github.com/albfan/%{name}
Source0:        %{name}-%{version}.tar.xz
Source1:        %{name}-rpmlintrc
BuildRequires:  automake
%if %{with_checks} == yes
BuildRequires:  check-devel
%endif
BuildRequires:  glib2-devel
BuildRequires:  libtool
BuildRequires:  libudev-devel
BuildRequires:  readline-devel
BuildRequires:  systemd-devel

# set binary names
%define daemon_name %{progname}d
%define dhcp_name %{progname}-dhcp
%define gst_name %{progname}-gst
%define omx_name %{progname}-omxplayer
%define sink_ctl_name %{progname}-sinkctl
%define uibc_ctl_name %{progname}-uibcctl
%define wifi_ctl_name %{progname}-wifictl
%define wifi_daemon_name %{progname}-wifid

%description
The MiracleCast project provides software to connect external monitors to your system via Wi-Fi. It is compatible to the Wifi-Display specification also known as Miracast. MiracleCast implements the Display-Source as well as Display-Sink side.

The Display-Source side allows you to connect external displays to your system and stream local content to the device. A lot of effort is put into making this as easy as connecting external displays via HDMI.

On the other hand, the Display-Sink side allows you to create wifi-capable external displays yourself. You can use it on your embedded devices or even on full desktops to allow other systems to use your device as external display.

%prep
%setup -q
%{__mkdir_p} contrib
%{__cp} -pt contrib res/gstplayer res/uibc-viewer res/*.sh res/wpa.conf

%build
./autogen.sh
%configure --docdir=%{_defaultdocdir}/%{name} --enable-silent-rules --disable-static
%make_build
%{__strip} -s src/%{daemon_name}
%{__strip} -s src/ctl/%{sink_ctl_name}
%{__strip} -s src/ctl/%{wifi_ctl_name}
%{__strip} -s src/dhcp/%{dhcp_name}
%{__strip} -s src/uibc/%{uibc_ctl_name}
%{__strip} -s src/wifi/%{wifi_daemon_name}

%install
%if 0%{?suse_version} && 0%{?suse_version} >= 1500
%make_install
%else
%{__make} %{?_smp_mflags} install DESTDIR=%{buildroot}
%endif
%{__rm} %{buildroot}%{_bindir}/gstplayer
%{__rm} %{buildroot}%{_bindir}/uibc-viewer

%if %{with_checks} == yes
%check
%{__make} %{?_smp_mflags} check
%endif

%files
%defattr(-,root,root)
%attr(755,root,root) %{_bindir}/%{daemon_name}
%attr(755,root,root) %{_bindir}/%{dhcp_name}
%attr(755,root,root) %{_bindir}/%{gst_name}
%attr(755,root,root) %{_bindir}/%{omx_name}
%attr(755,root,root) %{_bindir}/%{sink_ctl_name}
%attr(755,root,root) %{_bindir}/%{uibc_ctl_name}
%attr(755,root,root) %{_bindir}/%{wifi_ctl_name}
%attr(755,root,root) %{_bindir}/%{wifi_daemon_name}
%{_datadir}/bash-completion/completions/%{sink_ctl_name}
%{_datadir}/bash-completion/completions/%{wifi_ctl_name}
%{_datadir}/bash-completion/completions/%{wifi_daemon_name}
%dir %{_sysconfdir}/dbus-1
%dir %{_sysconfdir}/dbus-1/system.d
%config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.%{progname}.conf
%doc NEWS README.md contrib
%license COPYING LICENSE_*

%changelog
openSUSE Build Service is sponsored by