File google-guest-oslogin.spec of Package google-guest-oslogin.20918

# spec file for package google-guest-oslogin
# 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

Name:           google-guest-oslogin
Version:        20210728.00
Release:        0
Summary:        Google Cloud Guest OS Login
License:        Apache-2.0
Group:          System/Daemons
Source0:        %{name}-%{version}.tar.gz
Requires:       openssh
Requires:       pam
Requires(post): glibc
%if 0%{?suse_version} && 0%{?suse_version} <= 1315
BuildRequires:  boost-devel
BuildRequires:  gcc-c++
BuildRequires:  libcurl-devel
BuildRequires:  libjson-c-devel
BuildRequires:  make
BuildRequires:  pam-devel
BuildRequires:  systemd-rpm-macros
Requires:       google-guest-configs
Provides:       google-compute-engine-oslogin = %{version}
Obsoletes:      google-compute-engine-oslogin < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Google Cloud Guest OS Login

%setup -q -n guest-oslogin-%{version}

%if 0%{?suse_version} && 0%{?suse_version} > 1315
make %{?_smp_mflags} VERSION=%{version}
make %{?_smp_mflags} LDLIBS='-lcurl -ljson-c -lboost_regex' VERSION=%{version}

make install DESTDIR=%{buildroot} LIBDIR=/%{_libdir} PAMDIR=/%{_lib}/security SYSTEMDDIR=%{_unitdir} PRESETDIR=%{_presetdir} VERSION=%{version}
mkdir -p %{buildroot}%{_sbindir}
for srv_name in %{buildroot}%{_unitdir}/*.service; do rc_name=$(basename -s '.service' $srv_name); ln -s service %{buildroot}%{_sbindir}/rc$rc_name; done

%service_add_pre google-oslogin-cache.service

%service_del_preun google-oslogin-cache.service

%service_add_post google-oslogin-cache.service

%service_del_postun google-oslogin-cache.service

%license LICENSE
%attr(0755,root,root) %{_bindir}/google_oslogin_control
%attr(0755,root,root) %{_bindir}/google_authorized_keys
%attr(0755,root,root) %{_bindir}/google_oslogin_nss_cache

openSUSE Build Service is sponsored by