Merged from SVN repos fedora and centos
This commit is contained in:
82
fedora/SPECS/istatserver.spec
Normal file
82
fedora/SPECS/istatserver.spec
Normal file
@@ -0,0 +1,82 @@
|
||||
%define iuser istat
|
||||
%define igroup istat
|
||||
Name: istatserver
|
||||
Version: 3.0
|
||||
Release: 2%{?dist}
|
||||
Summary: iStat Server for Linux
|
||||
|
||||
Group: Applications/System
|
||||
License: As it is
|
||||
URL: https://bjango.com/help/istat3/linuxpackages/
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Source1: %{name}.service
|
||||
|
||||
BuildRequires: automake libxml2-devel libxml2-devel sqlite-devel
|
||||
|
||||
%description
|
||||
iStat Server is a system monitoring daemon that is used in conjunction
|
||||
with iStat for iOS and iStat for macOS to remotely monitor computers.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
|
||||
%build
|
||||
./autogen
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
%make_install
|
||||
# install the service file:
|
||||
%__install -d %{buildroot}%{_unitdir}
|
||||
%__install -D %{S:1} %{buildroot}%{_unitdir}/%{name}.service
|
||||
%__install -d %{buildroot}%{_var}/%{_rundir}/%{name}
|
||||
|
||||
%clean
|
||||
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}/*
|
||||
[ "${RPM_BUILD_DIR}" != "/" ] && rm -rf ${RPM_BUILD_DIR}/*
|
||||
|
||||
%pre
|
||||
if [ $1 -eq 1 ]; then
|
||||
grep -q %{igroup} /etc/group || \
|
||||
/usr/sbin/groupadd %{igroup}
|
||||
grep -q %{iuser} /etc/passwd || \
|
||||
/usr/sbin/useradd -g %{igroup} -s /sbin/nologin %{iuser}
|
||||
/bin/true
|
||||
fi
|
||||
|
||||
%post
|
||||
%systemd_post %{name}.service
|
||||
|
||||
%preun
|
||||
%systemd_preun %{name}.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart %{name}.service
|
||||
if [ $1 -eq 0 ]; then
|
||||
grep -q %{iuser} /etc/passwd && \
|
||||
/usr/sbin/userdel %{iuser}
|
||||
grep -q %{igroup} /etc/group && \
|
||||
/usr/sbin/groupdel %{igroup}
|
||||
/bin/true
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(0644,root,root,0755)
|
||||
%doc README COPYING
|
||||
%dir %attr(0775,%{iuser},%{igroup}) %{_sysconfdir}/%{name}
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/%{name}*
|
||||
%attr(0755,root,root) %{_bindir}/%{name}
|
||||
%{_mandir}/man1/%{name}*
|
||||
%{_mandir}/man5/%{name}*
|
||||
%dir %attr(0770,%{iuser},%{igroup}) %{_var}/%{_rundir}/%{name}
|
||||
%{_unitdir}/%{name}.service
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Oct 26 2016 Daniel Steiner <elpito@bluewin.ch>
|
||||
- First build for Fedora 25.
|
||||
Reference in New Issue
Block a user