File flexlm.spec of Package flexlm

#
# spec file for package flexlm
#
# Copyright (c) 2019, 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 http://bugs.opensuse.org/
#


Name:           flexlm
Version:        11.14.1.3
Release:        0
Summary:        FLEXnet License Manager
License:        NonFree
Group:          System/Daemons
URL:            https://knowledge.autodesk.com/customer-service/network-license-administration
Source0:        https://knowledge.autodesk.com/sites/default/files/file_downloads/nlm%{version}_ipv4_ipv6_linux64.tar.gz
Source1:        lmgrd.service
BuildRequires:  bsdtar
ExclusiveArch:  x86_64

%description
FLEXnet License Manager (lmgrd + lmutil).

%prep
%setup -q -c flexlm
bsdtar xvf nlm%{version}_ipv4_ipv6_linux64.rpm

%build

%pre
%service_add_pre lmgrd.service

%post
%service_add_post lmgrd.service
%fillup_only

%preun
%service_del_preun lmgrd.service

%postun
%service_del_postun lmgrd.service

%install
# lmutil
install -D -m 0755 ./opt/flexnetserver/lmutil %{buildroot}%{_bindir}/lmutil
utils=(lmborrow lmdiag lmdown lmhostid lminstall lmnewlog lmpath
       lmremove lmreread lmswitchr lmstat lmswitch lmver lmvminfo)
for bin in ${utils[@]}; do
  ln -s lmutil %{buildroot}%{_bindir}/$bin
done
# lmgrd
install -D -m 0755 ./opt/flexnetserver/lmgrd %{buildroot}%{_bindir}/lmgrd
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/lmgrd.service
install -d %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rclmgrd

%files
%{_bindir}/lmutil
%{_bindir}/lmborrow
%{_bindir}/lmdiag
%{_bindir}/lmdown
%{_bindir}/lmhostid
%{_bindir}/lminstall
%{_bindir}/lmnewlog
%{_bindir}/lmpath
%{_bindir}/lmremove
%{_bindir}/lmreread
%{_bindir}/lmstat
%{_bindir}/lmswitch
%{_bindir}/lmswitchr
%{_bindir}/lmver
%{_bindir}/lmvminfo
# lmgrd
%{_bindir}/lmgrd
%{_unitdir}/lmgrd.service
%{_sbindir}/rclmgrd

%changelog
openSUSE Build Service is sponsored by