# Enable Python dependency generation %{?python_enable_dependency_generator} # Services used for GCE %global gce_services google-accounts-daemon.service google-clock-skew-daemon.service google-instance-setup.service google-network-daemon.service google-shutdown-scripts.service google-startup-scripts.service Name: google-compute-engine Version: 2.8.2 Release: 2%{?dist} Summary: Google Compute Engine guest environment. License: ASL 2.0 URL: https://github.com/GoogleCloudPlatform/compute-image-packages Source0: %{name}-%{version}.tar.gz # Add Fedora support Patch0: google-compute-engine-2.8.2-add-fedora-support.patch # Ensure network is configured before cloud-init runs Patch1: google-compute-engine-2.8.2-run-before-cloudinit.patch BuildArch: noarch BuildRequires: python3-boto BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: systemd Requires: curl Requires: %{name}-oslogin Requires: ntp Requires: python3-%{name} = %{version}-%{release} Requires: rsyslog Requires: systemd Obsoletes: google-compute-engine-init Obsoletes: google-config Obsoletes: google-startup-scripts Conflicts: google-compute-engine-init Conflicts: google-config Conflicts: google-startup-scripts %description This package contains scripts, configuration, and init files for features specific to the Google Compute Engine cloud environment. %files %attr(0755,root,root) %{_sysconfdir}/dhcp/dhclient.d/google_hostname.sh %{_unitdir}/*.service %{_presetdir}/90-google-compute-engine.preset %config %{_sysconfdir}/modprobe.d/gce-blacklist.conf %config %{_sysconfdir}/rsyslog.d/90-google.conf %{_sysctldir}/11-gce-network-security.conf %{_udevrulesdir}/*.rules %attr(0755,root,root) %{_bindir}/* %preun %systemd_preun %{gce_services} %post # Remove old services. if [ -f %{_unitdir}/google-ip-forwarding-daemon.service ]; then systemctl stop --no-block google-ip-forwarding-daemon systemctl disable google-ip-forwarding-daemon.service fi if [ -f %{_unitdir}/google-network-setup.service ]; then systemctl stop --no-block google-network-setup systemctl disable google-network-setup.service fi if [ $1 -eq 2 ]; then # New service might not be enabled during upgrade. systemctl enable google-network-daemon.service fi %systemd_post %{gce_services} %postun # On upgrade run instance setup again to handle any new configs and restart daemons. if [ $1 -eq 2 ]; then %{_bindir}/google_instance_setup fi %systemd_postun_with_restart %{gce_services} # ------------------------------------------------------------------- %package -n python3-%{name} Summary: Google Compute Engine Python 3 library %{?python_provide:%python_provide python3-%{name}} %description -n python3-%{name} Google Compute Engine python library for Python 3.x. %files -n python3-%{name} %{python3_sitelib}/* # ------------------------------------------------------------------- %prep %autosetup -p1 %build %py3_build %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sysconfdir}/dhcp mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d mkdir -p %{buildroot}%{_sysconfdir}/rsyslog.d mkdir -p %{buildroot}%{_sysctldir} mkdir -p %{buildroot}%{_udevrulesdir} cp google_config/modprobe/gce-blacklist.conf %{buildroot}%{_sysconfdir}/modprobe.d/ cp google_config/rsyslog/90-google.conf %{buildroot}%{_sysconfdir}/rsyslog.d/ cp google_config/sysctl/11-gce-network-security.conf %{buildroot}%{_sysctldir} cp google_config/udev/*.rules %{buildroot}%{_udevrulesdir} %py3_install mkdir -p %{buildroot}%{_sysconfdir}/dhcp/dhclient.d mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_presetdir} cp google_compute_engine_init/systemd/*.service %{buildroot}%{_unitdir} cp google_compute_engine_init/systemd/90-google-compute-engine.preset %{buildroot}%{_presetdir}/90-google-compute-engine.preset cp google_config/bin/google_set_hostname %{buildroot}%{_bindir} cp google_config/dhcp/google_hostname.sh %{buildroot}%{_sysconfdir}/dhcp/dhclient.d/google_hostname.sh %changelog * Mon May 28 10:16:47 EDT 2018 Neal Gompa - Initial packaging for Fedora