# Google does not properly version the sources, this commit is the "tag-release" of this package %global srcname compute-image-packages %global commit c3ad62ccd8b318938a3e2e374562454532497fd3 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: google-compute-engine-oslogin Version: 1.3.1 Release: 1%{?dist} Summary: OS Login Functionality for Google Compute Engine License: ASL 2.0 URL: https://github.com/GoogleCloudPlatform/%{srcname} Source0: %{url}/archive/%{commit}/%{srcname}-%{shortcommit}.tar.gz BuildRequires: gcc-c++ BuildRequires: make BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(json-c) BuildRequires: pam-devel BuildRequires: selinux-policy, selinux-policy-devel Requires(post): selinux-policy-base >= %{_selinux_policy_version} Requires(post): policycoreutils Requires(post): policycoreutils-python-utils Requires(pre): libselinux-utils Requires(post): libselinux-utils %description This package contains several libraries and changes to enable OS Login functionality for Google Compute Engine. %prep %autosetup -n %{srcname}-%{commit} %build pushd google_compute_engine_oslogin # Hack to make compile flags work with horrid Makefile export CC="gcc %{optflags}" export CXX="g++ %{optflags}" %make_build LIBS="-lcurl -ljson-c" popd %install pushd google_compute_engine_oslogin # DIST refers to the distribution base for the SELinux module. The EL7 one should be good enough. :) %make_install NSS_INSTALL_PATH=%{_libdir} PAM_INSTALL_PATH=%{_libdir}/security INSTALL_SELINUX=true DIST=".el7" popd # Compress the policy module bzip2 -9 %{buildroot}%{_datadir}/selinux/packages/oslogin.pp # Change all the libraries to be executable chmod +x %{buildroot}%{_libdir}/*.so* chmod +x %{buildroot}%{_libdir}/security/*.so* %files %license LICENSE %doc google_compute_engine_oslogin/README.md %{_libdir}/libnss_cache_oslogin.so.* %{_libdir}/libnss_oslogin.so.* %{_libdir}/libnss_cache_%{name}-%{version}.so %{_libdir}/libnss_%{name}-%{version}.so %{_libdir}/security/pam_oslogin_admin.so %{_libdir}/security/pam_oslogin_login.so %{_bindir}/google_authorized_keys %{_bindir}/google_oslogin_control %{_bindir}/google_oslogin_nss_cache %{_datadir}/selinux/packages/oslogin.pp.bz2 %post %selinux_modules_install %{_datadir}/selinux/packages/oslogin.pp.bz2 %postun %selinux_modules_uninstall oslogin %changelog * Tue Oct 30 2018 Neal Gompa - 1.3.1-1 - Initial packaging for Fedora