Name:    awsvpnclient
Version: 3.12.2
Release: 1%{dist}
License: Apache
Summary: AWS VPN client for Linux
URL:     https://aws.amazon.com/ru/vpn/client-vpn-download/
# No sources provoded by Amazon, so we'll use .deb package
Source0: https://d20adtppz83p9s.cloudfront.net/GTK/latest/awsvpnclient_amd64.deb

BuildRequires: binutils
%systemd_requires

%description
%{summary}.

%prep
mkdir -p %{name}-%{version}
cd %{name}-%{version}

ar x %{SOURCE0}
tar -xf data.tar.xz


%build

%install
cd %{_builddir}/%{name}-%{version}
mkdir -p %{buildroot}
mv {opt,usr} %{buildroot}/
mkdir -p %{buildroot}%{_unitdir}
mv etc/systemd/system/awsvpnclient.service %{buildroot}%{_unitdir}/awsvpnclient.service
mkdir -p %{buildroot}%{_localstatedir}/log/aws-vpn-client

%post
%systemd_post awsvpnclient.service

%preun
%systemd_preun awsvpnclient.service

%files
/opt/awsvpnclient
%{_localstatedir}/log/aws-vpn-client
%{_unitdir}/awsvpnclient.service
%{_docdir}/awsvpnclient/copyright
%{_datadir}/applications/awsvpnclient.desktop
%{_datadir}/pixmaps/acvc-64.png