Преглед изворни кода

Clean up and simplify openshift-ansible.spec

Scott Dodson пре 6 година
родитељ
комит
941b661315
1 измењених фајлова са 6 додато и 106 уклоњено
  1. 6 106
      openshift-ansible.spec

+ 6 - 106
openshift-ansible.spec

@@ -4,7 +4,7 @@
 %global commit c64d09e528ca433832c6b6e6f5c7734a9cc8ee6f
 }
 # This is inserted to prevent RPM from requiring "/usr/bin/ansible-playbook"
-# The ansible-playbook requirement will be ansibled by the explicit
+# The ansible-playbook requirement will be provided by the explicit
 #  "Requires: ansible" directive
 %global __requires_exclude ^/usr/bin/ansible-playbook$
 
@@ -21,19 +21,13 @@ Requires:      ansible >= 2.7.8
 Requires:      python2
 Requires:      python-six
 Requires:      tar
-Requires:      %{name}-docs = %{version}-%{release}
-Requires:      %{name}-playbooks = %{version}-%{release}
-Requires:      %{name}-roles = %{version}-%{release}
-Obsoletes:     atomic-openshift-utils <= 3.10
-Requires:      libselinux-python
-Requires:      pyOpenSSL
+Obsoletes:     %{name}-docs <= 4.0
+Obsoletes:     %{name}-playbooks <= 4.0
+Obsoletes:     %{name}-roles <= 4.0
 Requires:      python2-openshift
 
 %description
-Openshift and Atomic Enterprise Ansible
-
-This repo contains Ansible code and playbooks
-for Openshift and Atomic Enterprise.
+OpenShift RHEL Worker Management Ansible Playbooks
 
 %prep
 %setup -q
@@ -47,30 +41,13 @@ mkdir -p %{buildroot}%{_datadir}/ansible/%{name}/inventory
 cp -rp inventory/dynamic %{buildroot}%{_datadir}/ansible/%{name}/inventory
 cp ansible.cfg %{buildroot}%{_datadir}/ansible/%{name}/ansible.cfg
 
-# openshift-ansible-bin install
-mkdir -p %{buildroot}%{_bindir}
-mkdir -p %{buildroot}%{python_sitelib}/openshift_ansible
-mkdir -p %{buildroot}/etc/bash_completion.d
-mkdir -p %{buildroot}/etc/openshift_ansible
-# Fix links
-rm -f %{buildroot}%{python_sitelib}/openshift_ansible/aws
-rm -f %{buildroot}%{python_sitelib}/openshift_ansible/gce
-
-# openshift-ansible-docs install
 # Install example inventory into docs/examples
 mkdir -p docs/example-inventories
 cp inventory/hosts.* inventory/README.md docs/example-inventories/
 
-# openshift-ansible-playbooks install
 cp -rp playbooks %{buildroot}%{_datadir}/ansible/%{name}/
-cp -rp test %{buildroot}%{_datadir}/ansible/%{name}/
-
-# BZ1330091
-find -L %{buildroot}%{_datadir}/ansible/%{name}/playbooks -name lookup_plugins -type l -delete
-find -L %{buildroot}%{_datadir}/ansible/%{name}/playbooks -name filter_plugins -type l -delete
-
-# openshift-ansible-roles install
 cp -rp roles %{buildroot}%{_datadir}/ansible/%{name}/
+cp -rp test %{buildroot}%{_datadir}/ansible/%{name}/
 
 # Base openshift-ansible files
 %files
@@ -79,95 +56,16 @@ cp -rp roles %{buildroot}%{_datadir}/ansible/%{name}/
 %dir %{_datadir}/ansible/%{name}
 %{_datadir}/ansible/%{name}/inventory
 %{_datadir}/ansible/%{name}/ansible.cfg
-
-# ----------------------------------------------------------------------------------
-# openshift-ansible-docs subpackage
-# ----------------------------------------------------------------------------------
-%package docs
-Summary:       Openshift and Atomic Enterprise Ansible documents
-Requires:      %{name} = %{version}-%{release}
-BuildArch:     noarch
-
-%description docs
-%{summary}.
-
-%files docs
 %doc  docs
-
-# ----------------------------------------------------------------------------------
-# openshift-ansible-playbooks subpackage
-# ----------------------------------------------------------------------------------
-%package playbooks
-Summary:       Openshift and Atomic Enterprise Ansible Playbooks
-Requires:      %{name} = %{version}-%{release}
-Requires:      %{name}-roles = %{version}-%{release}
-BuildArch:     noarch
-
-%description playbooks
-%{summary}.
-
-%files playbooks
 %{_datadir}/ansible/%{name}/playbooks
-
-# Along the history of openshift-ansible, some playbook directories had to be
-# moved and were replaced with symlinks for backwards compatibility.
-# RPM doesn't handle this so we have to do some pre-transaction magic.
-# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement
-%pretrans playbooks -p <lua>
-dirs_to_sym = {
-    "/usr/share/ansible/openshift-ansible/playbooks/common/openshift-master/library",
-    "/usr/share/ansible/openshift-ansible/playbooks/certificate_expiry"
-}
-for i,path in ipairs(dirs_to_sym) do
-  st = posix.stat(path)
-  if st and st.type == "directory" then
-    status = os.rename(path, path .. ".rpmmoved")
-    if not status then
-      suffix = 0
-      while not status do
-        suffix = suffix + 1
-        status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
-      end
-      os.rename(path, path .. ".rpmmoved")
-    end
-  end
-end
-
-%package roles
-# ----------------------------------------------------------------------------------
-# openshift-ansible-roles subpackage
-# ----------------------------------------------------------------------------------
-Summary:       Openshift and Atomic Enterprise Ansible roles
-Requires:      %{name} = %{version}-%{release}
-Obsoletes:      %{name}-lookup-plugins
-Obsoletes:      %{name}-filter-plugins
-Obsoletes:      %{name}-callback-plugins
-BuildArch:     noarch
-
-%description roles
-%{summary}.
-
-%files roles
 %{_datadir}/ansible/%{name}/roles
 
-%pretrans roles
-#RHBZ https://bugzilla.redhat.com/show_bug.cgi?id=1626048
-#roles/openshift_examples/latest used to be a symlink, now its a dir
-# workaround for RPM bug https://bugzilla.redhat.com/show_bug.cgi?id=975909
-if [ -d %{_datadir}/ansible/%{name}/roles/openshift_examples/files/examples ]; then
-  find %{_datadir}/ansible/%{name}/roles/openshift_examples/files/examples -name latest -type l -delete
-fi
-
 # ----------------------------------------------------------------------------------
 # openshift-ansible-tests subpackage
 # ----------------------------------------------------------------------------------
 %package test
 Summary:       Openshift and Atomic Enterprise Ansible Test Playbooks
 Requires:      %{name} = %{version}-%{release}
-Requires:      %{name}-roles = %{version}-%{release}
-Requires:      %{name}-playbooks = %{version}-%{release}
 Requires:      python-boto3
 Requires:      openssh-clients
 BuildArch:     noarch