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 namebase polemarch
%define user polemarch
%define datad poledata
%define version 1.1.0
%define release 0
%define __prelink_undo_cmd %{nil}
@@ -14,7 +15,6 @@
# Globals
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Tags
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
@@ -45,23 +45,20 @@ Requires: python3-redis, python3-django-redis, redis
Polemarch is service for orchestration infrastructure by ansible.
Simply WEB gui for orchestration infrastructure by ansible playbooks.
# Blocks
%files
%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
%prep
%setup -q -n %name-%version
%patch0 -b python3-patch
%install
make BUILD_DIR=%{buildroot}
install %{S:1} %{buildroot}%{_sysconfdir}/%{namebase}/settings.ini
# fix for python3 redis access:
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
getent group %{user} >/dev/null || \
@@ -84,9 +81,22 @@ fi
%postun
%systemd_postun_with_restart %{name}.service
%prep
%setup -q -n %name-%version
%patch0 -b python3-patch
%files
%defattr(-,%{user},%{user},-)
%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
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}