Several improvments for double listed files.

This commit is contained in:
2019-02-22 11:36:09 +01:00
parent 852e7fc7c1
commit cc974c8379

View File

@@ -6,6 +6,7 @@
%define shortname polemarch %define shortname polemarch
%define namebase polemarch %define namebase polemarch
%define user polemarch %define user polemarch
%define datad poledata
%define version 1.1.0 %define version 1.1.0
%define release 0 %define release 0
%define __prelink_undo_cmd %{nil} %define __prelink_undo_cmd %{nil}
@@ -14,7 +15,6 @@
# Globals # Globals
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Tags
Name: %{name} Name: %{name}
Version: %{version} Version: %{version}
Release: %{release}%{?dist} Release: %{release}%{?dist}
@@ -45,23 +45,20 @@ Requires: python3-redis, python3-django-redis, redis
Polemarch is service for orchestration infrastructure by ansible. Polemarch is service for orchestration infrastructure by ansible.
Simply WEB gui for orchestration infrastructure by ansible playbooks. Simply WEB gui for orchestration infrastructure by ansible playbooks.
%prep
# Blocks %setup -q -n %name-%version
%files %patch0 -b python3-patch
%defattr(-,%{user},%{user},-)
%dir /opt/polemarch
%{_sysconfdir}/%{namebase}
%{_var}/log/%{namebase}
%{_rundir}/%{namebase}
%{_var}/lock/%{namebase}
%attr(755,root,root) %{_sysconfdir}/systemd/system/%{shortname}.service
%attr(755,root,root) %{_sysconfdir}/tmpfiles.d/%{namebase}.conf
%config(noreplace) %{_sysconfdir}/%{namebase}/settings.ini
%install %install
make BUILD_DIR=%{buildroot} make BUILD_DIR=%{buildroot}
install %{S:1} %{buildroot}%{_sysconfdir}/%{namebase}/settings.ini install %{S:1} %{buildroot}%{_sysconfdir}/%{namebase}/settings.ini
# fix for python3 redis access:
bash %{S:2} bash %{S:2}
# fix for fedora rundir config:
mv %{buildroot}/var/run %{buildroot}/
# create additional directories:
install -d %{buildroot}/%{_var}/log/%{name}
install -d %{buildroot}/opt/%{datad}
%pre %pre
getent group %{user} >/dev/null || \ getent group %{user} >/dev/null || \
@@ -84,9 +81,22 @@ fi
%postun %postun
%systemd_postun_with_restart %{name}.service %systemd_postun_with_restart %{name}.service
%prep %files
%setup -q -n %name-%version %defattr(-,%{user},%{user},-)
%patch0 -b python3-patch %dir %attr(-,%{user},%{user}) /opt/%{namebase}
%dir %attr(-,%{user},%{user}) /opt/%{datad}
%dir %attr(-,%{user},%{user}) %{_var}/log/%{namebase}
%attr(-,%{user},%{user}) /opt/%{namebase}/bin/*
%attr(-,%{user},%{user}) /opt/%{namebase}/include/*
%attr(-,%{user},%{user}) /opt/%{namebase}/lib/*
/opt/%{namebase}/lib64
%dir %{_sysconfdir}/%{namebase}
%{_var}/log/%{namebase}
%{_rundir}/%{namebase}
%{_var}/lock/%{namebase}
%attr(755,%{user},%{user}) %{_sysconfdir}/systemd/system/%{shortname}.service
%attr(755,root,root) %{_sysconfdir}/tmpfiles.d/%{namebase}.conf
%config(noreplace) %{_sysconfdir}/%{namebase}/settings.ini
%clean %clean
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}