#1 Use symlinks in /usr/share/ansible/roles/
Merged 9 months ago by mikedep333. Opened 9 months ago by till.
rpms/ till/linux-system-roles symlinks  into  master

file modified
+81 -72

@@ -5,15 +5,20 @@ 

  %endif

  Summary: Set of interfaces for unified system management

  Version: 1.0

- Release: 7%{?dist}

+ Release: 8%{?dist}

  

  #Group: Development/Libraries

  License: GPLv3+ and MIT and BSD

- %if 0%{?rhel}

+ %global installbase %{_datadir}/linux-system-roles

+ %global _pkglicensedir %{_licensedir}/%{name}

  %global rolealtprefix linux-system-roles.

- %endif

+ %global roleprefix %{nil}

+ %global rolealtrelpath ../../linux-system-roles/

+ %if 0%{?rhel}

  %global roleprefix %{name}.

- %global _pkglicensedir %{_licensedir}/%{name}

+ %global installbase %{_datadir}/ansible/roles

+ %global rolealtrelpath %{nil}

+ %endif

  

  # For each role, call either decommit() or deftag(). The other macros

  # (%%id and %%shortid) can be then used in the same way in both cases.

@@ -64,7 +69,7 @@ 

  # which is the standard for Ansible docs.

  Source8: md2html.sh

  

- %if "%{roleprefix}" != "linux-system-roles."

+ %if "%{?roleprefix:x}" == "rhel-system-roles."

  Patch1: rhel-system-roles-%{rolename1}-prefix.diff

  Patch2: rhel-system-roles-%{rolename2}-prefix.diff

  Patch3: rhel-system-roles-%{rolename3}-prefix.diff

@@ -104,22 +109,22 @@ 

  #kdump patches here if necessary

  cd ..

  cd %{rolename1}-%{id1}

- %if "%{roleprefix}" != "linux-system-roles."

+ %if "%{?roleprefix:x}" == "rhel-system-roles."

  %patch1 -p1

  %endif

  cd ..

  cd %{rolename2}-%{id2}

- %if "%{roleprefix}" != "linux-system-roles."

+ %if "%{?roleprefix:x}" == "rhel-system-roles."

  %patch2 -p1

  %endif

  cd ..

  cd %{rolename3}-%{id3}

- %if "%{roleprefix}" != "linux-system-roles."

+ %if "%{?roleprefix:x}" == "rhel-system-roles."

  %patch3 -p1

  %endif

  cd ..

  cd %{rolename5}-%{id5}

- %if "%{roleprefix}" != "linux-system-roles."

+ %if "%{?roleprefix:x}" == "rhel-system-roles."

  %patch5 -p1

  %endif

  %patch52 -p1

@@ -134,20 +139,21 @@ 

  %{rolename5}-%{id5}/README.md

  

  %install

+ mkdir -p $RPM_BUILD_ROOT%{installbase}

  mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles

  

- cp -pR %{rolename0}-%{id0}      $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename0}

- cp -pR %{rolename1}-%{id1}      $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename1}

- cp -pR %{rolename2}-%{id2}      $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename2}

- cp -pR %{rolename3}-%{id3}      $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename3}

- cp -pR %{rolename5}-%{id5}      $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename5}

+ cp -pR %{rolename0}-%{id0}      $RPM_BUILD_ROOT%{installbase}/%{roleprefix}%{rolename0}

+ cp -pR %{rolename1}-%{id1}      $RPM_BUILD_ROOT%{installbase}/%{roleprefix}%{rolename1}

+ cp -pR %{rolename2}-%{id2}      $RPM_BUILD_ROOT%{installbase}/%{roleprefix}%{rolename2}

+ cp -pR %{rolename3}-%{id3}      $RPM_BUILD_ROOT%{installbase}/%{roleprefix}%{rolename3}

+ cp -pR %{rolename5}-%{id5}      $RPM_BUILD_ROOT%{installbase}/%{roleprefix}%{rolename5}

  

  %if 0%{?rolealtprefix:1}

- ln -s    %{roleprefix}%{rolename0}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename0}

- ln -s    %{roleprefix}%{rolename1}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename1}

- ln -s    %{roleprefix}%{rolename2}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename2}

- ln -s    %{roleprefix}%{rolename3}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename3}

- ln -s    %{roleprefix}%{rolename5}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename5}

+ ln -s    %{rolealtrelpath}%{roleprefix}%{rolename0}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename0}

+ ln -s    %{rolealtrelpath}%{roleprefix}%{rolename1}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename1}

+ ln -s    %{rolealtrelpath}%{roleprefix}%{rolename2}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename2}

+ ln -s    %{rolealtrelpath}%{roleprefix}%{rolename3}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename3}

+ ln -s    %{rolealtrelpath}%{roleprefix}%{rolename5}   $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename5}

  %endif

  

  mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/kdump

@@ -159,66 +165,65 @@ 

  mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/network

  mkdir -p $RPM_BUILD_ROOT%{_pkglicensedir}

  

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kdump/README.md \

-     $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kdump/README.html \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}kdump/README.md \

+     $RPM_BUILD_ROOT%{installbase}/%{roleprefix}kdump/README.html \

      $RPM_BUILD_ROOT%{_pkgdocdir}/kdump

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kdump/COPYING \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}kdump/COPYING \

      $RPM_BUILD_ROOT%{_pkglicensedir}/kdump.COPYING

  

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}postfix/README.md \

-     $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}postfix/README.html \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}postfix/README.md \

+     $RPM_BUILD_ROOT%{installbase}/%{roleprefix}postfix/README.html \

      $RPM_BUILD_ROOT%{_pkgdocdir}/postfix

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}postfix/COPYING \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}postfix/COPYING \

      $RPM_BUILD_ROOT%{_pkglicensedir}/postfix.COPYING

  

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}selinux/README.md \

-     $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}selinux/README.html \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}selinux/README.md \

+     $RPM_BUILD_ROOT%{installbase}/%{roleprefix}selinux/README.html \

      $RPM_BUILD_ROOT%{_pkgdocdir}/selinux

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}selinux/COPYING \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}selinux/COPYING \

      $RPM_BUILD_ROOT%{_pkglicensedir}/selinux.COPYING

- mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}selinux/selinux-playbook.yml \

+ mv $RPM_BUILD_ROOT%{installbase}/%{roleprefix}selinux/selinux-playbook.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/selinux/example-selinux-playbook.yml

  

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}timesync/README.md \

-     $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}timesync/README.html \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}timesync/README.md \

+     $RPM_BUILD_ROOT%{installbase}/%{roleprefix}timesync/README.html \

      $RPM_BUILD_ROOT%{_pkgdocdir}/timesync

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}timesync/COPYING \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}timesync/COPYING \

      $RPM_BUILD_ROOT%{_pkglicensedir}/timesync.COPYING

  

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/README.md \

-     $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/README.html \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/README.md \

+     $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/README.html \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/LICENSE \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/LICENSE \

      $RPM_BUILD_ROOT%{_pkglicensedir}/network.LICENSE

- mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/bond-with-vlan.yml \

+ mv $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/bond-with-vlan.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-bond-with-vlan-playbook.yml

- mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/bridge-with-vlan.yml \

+ mv $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/bridge-with-vlan.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-bridge-with-vlan-playbook.yml

- mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/eth-simple-auto.yml \

+ mv $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/eth-simple-auto.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth-simple-auto-playbook.yml

- mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/eth-with-vlan.yml \

+ mv $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/eth-with-vlan.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth-with-vlan-playbook.yml

- mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/infiniband.yml \

+ mv $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/infiniband.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-infiniband-playbook.yml

- mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/macvlan.yml \

+ mv $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/macvlan.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-macvlan-playbook.yml

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/remove-profile.yml \

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/remove-profile.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-remove-profile-playbook.yml

- rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/remove-profile.yml

- cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/down-profile.yml \

+ rm $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/remove-profile.yml

+ cp -p $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/down-profile.yml \

      $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-down-profile-playbook.yml

- rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/down-profile.yml

- mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/inventory \

+ rm $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/down-profile.yml

+ mv $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/inventory \

     $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-inventory

  

- rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/.gitignore

- rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/tests/.gitignore

- rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/roles

- rmdir $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples

+ rm $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/.gitignore

+ rm $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/tests/.gitignore

+ rm $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples/roles

+ rmdir $RPM_BUILD_ROOT%{installbase}/%{roleprefix}network/examples

  

  %files

- %dir %{_datadir}/ansible

- %dir %{_datadir}/ansible/roles

+ %dir %{installbase}

  %if 0%{?rolealtprefix:1}

  %{_datadir}/ansible/roles/%{rolealtprefix}kdump

  %{_datadir}/ansible/roles/%{rolealtprefix}postfix

@@ -226,36 +231,40 @@ 

  %{_datadir}/ansible/roles/%{rolealtprefix}timesync

  %{_datadir}/ansible/roles/%{rolealtprefix}network

  %endif

- %{_datadir}/ansible/roles/%{roleprefix}kdump

- %{_datadir}/ansible/roles/%{roleprefix}postfix

- %{_datadir}/ansible/roles/%{roleprefix}selinux

- %{_datadir}/ansible/roles/%{roleprefix}timesync

- %{_datadir}/ansible/roles/%{roleprefix}network

+ %{installbase}/%{roleprefix}kdump

+ %{installbase}/%{roleprefix}postfix

+ %{installbase}/%{roleprefix}selinux

+ %{installbase}/%{roleprefix}timesync

+ %{installbase}/%{roleprefix}network

  %{_pkgdocdir}/*/example-*-playbook.yml

  %{_pkgdocdir}/network/example-inventory

  %{_pkgdocdir}/timesync/example-multiple-ntp-servers.yml

  %{_pkgdocdir}/timesync/example-single-pool.yml

  %{_pkgdocdir}/*/README.md

  %{_pkgdocdir}/*/README.html

- %doc %{_datadir}/ansible/roles/%{roleprefix}kdump/README.md

- %doc %{_datadir}/ansible/roles/%{roleprefix}postfix/README.md

- %doc %{_datadir}/ansible/roles/%{roleprefix}selinux/README.md

- %doc %{_datadir}/ansible/roles/%{roleprefix}timesync/README.md

- %doc %{_datadir}/ansible/roles/%{roleprefix}network/README.md

- %doc %{_datadir}/ansible/roles/%{roleprefix}kdump/README.html

- %doc %{_datadir}/ansible/roles/%{roleprefix}postfix/README.html

- %doc %{_datadir}/ansible/roles/%{roleprefix}selinux/README.html

- %doc %{_datadir}/ansible/roles/%{roleprefix}timesync/README.html

- %doc %{_datadir}/ansible/roles/%{roleprefix}network/README.html

+ %doc %{installbase}/%{roleprefix}kdump/README.md

+ %doc %{installbase}/%{roleprefix}postfix/README.md

+ %doc %{installbase}/%{roleprefix}selinux/README.md

+ %doc %{installbase}/%{roleprefix}timesync/README.md

+ %doc %{installbase}/%{roleprefix}network/README.md

+ %doc %{installbase}/%{roleprefix}kdump/README.html

+ %doc %{installbase}/%{roleprefix}postfix/README.html

+ %doc %{installbase}/%{roleprefix}selinux/README.html

+ %doc %{installbase}/%{roleprefix}timesync/README.html

+ %doc %{installbase}/%{roleprefix}network/README.html

  

  %license %{_pkglicensedir}/*

- %license %{_datadir}/ansible/roles/%{roleprefix}kdump/COPYING

- %license %{_datadir}/ansible/roles/%{roleprefix}postfix/COPYING

- %license %{_datadir}/ansible/roles/%{roleprefix}selinux/COPYING

- %license %{_datadir}/ansible/roles/%{roleprefix}timesync/COPYING

- %license %{_datadir}/ansible/roles/%{roleprefix}network/LICENSE

+ %license %{installbase}/%{roleprefix}kdump/COPYING

+ %license %{installbase}/%{roleprefix}postfix/COPYING

+ %license %{installbase}/%{roleprefix}selinux/COPYING

+ %license %{installbase}/%{roleprefix}timesync/COPYING

+ %license %{installbase}/%{roleprefix}network/LICENSE

  

  %changelog

+ * Wed Dec 05 2018 Till Maas <opensource@till.name> - 1.0-8

+ - Install roles at /usr/share/linux-system-roles, use symlinks in

+   /usr/share/ansible/roles/ to allow using alternatives

+ 

  * Wed Nov 14 2018 Mike DePaulo <mikedep333@gmail.com> - 1.0-7

  - spec file improvement: Remove unnecessary %%doc for files under _pkgdocdor

  - Install license files under /usr/share/licenses instead of /usr/share/doc

Pull-Request has been merged by mikedep333

9 months ago