File linux-wifi-hotspot.spec of Package linux-wifi-hotspot

#
# spec file for package linux-wifi-hotspot
#
# Copyright (c) 2021 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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/
#

Name:           linux-wifi-hotspot
Version:        v4.4.0+13
Release:        0
License:        BSD-2-Clause
Summary:        Feature-rich wifi hotspot creator
Group:          System/GUI/Other
URL:            https://github.com/lakinduakash/linux-wifi-hotspot
Source0:        %{name}-%{version}.tar.xz
Source99:       linux-wifi-hotspot-rpmlintrc
BuildRequires:  ImageMagick
BuildRequires:  fdupes
#Prefer:  libicu-devel
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  systemd
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libqrencode)
BuildRequires:  pkgconfig(polkit-agent-1)
%if 0%{?suse_version} < 1600
BuildRequires:  icu.691-devel
%endif
Requires:       hostapd
%systemd_requires

%description
Share your wifi like in Windows - Use wifi and enable hotspot at the same time.

%package bash-completion
Summary:        Bash completion for linux-wifi-hotspot
Group:          System/Shells
Requires:       %{name} = %{version}-%{release}
Supplements:    (%{name}:bash-completion)
BuildArch:      noarch

%description bash-completion
Bash command line completion support for linux-wifi-hotspot.

%prep
%autosetup -p1
#Fix wrong-icon-size - wihotspot.png expected: 64x64 actual: 128x128
convert -resize 64x64 src/desktop/icons/hotspot@64.png src/desktop/icons/hotspot@64.png

%build
make %{?_smp_mflags}

%install
%make_install
#Fix suse-missing-rclink warning
mkdir -p %{buildroot}%{_sbindir}
pushd %{buildroot}%{_sbindir}
ln -s service rccreate_ap
#Remove doc file as we use %%doc macro.
rm -rf %{buildroot}/%{_datadir}/doc/create_ap
%suse_update_desktop_file wihotspot
%fdupes -s %{buildroot}

%pre
%service_add_pre create_ap.service

%post
%service_add_post create_ap.service

%preun
%service_del_preun create_ap.service

%postun
%service_del_postun create_ap.service

%files
%license LICENSE
%doc README.md debian/changelog
%config %{_sysconfdir}/create_ap.conf
%{_bindir}/create_ap
%{_bindir}/wihotspot
%{_bindir}/wihotspot-gui
%{_sbindir}/rccreate_ap
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/pixmaps/wihotspot.png
%{_datadir}/applications/wihotspot.desktop
%{_unitdir}/create_ap.service
%{_datadir}/polkit-1/actions/org.opensuse.policykit.wihotspot.policy
%{_datadir}/polkit-1/rules.d/90-org.opensuse.policykit.wihotspot.rules

%files bash-completion
%{_datadir}/bash-completion/completions/create_ap

%changelog
openSUSE Build Service is sponsored by