Fix : fix hot module under windows test. (at leat I hope...)
[shinken.git] / for_packages / shinken.spec
blob43920eeb0e025b09800c59e6f69a00e0f4055a32
1 # release number:
2 %define rel %(date '+%Y%m%d%H%M')
4 Summary: Nagios(R) compatible monitoring tool
5 Name: shinken
6 Version: 0.2
7 Release: %{rel}
8 Source0: http://ftp.monitoring-fr.org/JEAN/shinken-%{version}.tgz
9 Source1: %{name}-configs.tar.bz2
10 License: AGPL
11 Group: Applications/System
12 URL: http://www.shinken-monitoring.org/
13 Requires: python26, python26-pyro < 4.0, chkconfig
14 BuildRequires: python26
15 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
16 BuildArch: noarch
19 # Shinken process user and group
20 %define shinken_user shinken
21 %define shinken_group shinken
23 # Default SysV service
24 %define sysv_service shinken-all
26 # Shinken requires python 2.6
27 %global __python /usr/bin/python26
29 %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
33 %description
34 Shinken is a new, Nagios(R) compatible monitoring tool, written in Python. The main goal of Shinken is to allow users to have a fully flexible architecture for their monitoring system that can easily scale to large environments.
36 Shinken is backwards-compatible with the Nagios(R) configuration standard and plugins.
37 Shinken also provides interfaces with NDODB and Merlin database, Livestatus connector
38 Shinken does not include any human interfaces.
40 Nagios is a registered trademark owned by Nagios Enterprises.
42 %description -l fr
43 Shinken est un nouvel outil de supervision compatible avec Nagios(R) et écrit en Python. L'objectif de Shinken de vous permettre de construire une architecture de supervision flexible et capable de s'adapter de large environnements.
45 Shinken est compatible avec les fichiers de configuration de Nagios(R) ainsi que les plugins.
46 Shinken fournit les connecteurs pour les bases NDODB et Merlin, ainsi qu'une interface Livestatus.
47 Shinken ne fourni pas d'interfaces graphiques.
49 Nagios est une marque déposée de Nagios Enterprises.
51 %prep
53 #%setup -n %{name}-%{version}
54 %setup -q -n %{name}
57 %setup -q -n %{name}
58 %{__tar} xjf %{SOURCE1}
60 %build
62 # Force python 2.6
63 %{__sed} -i 's/\/env python$/\/env python26/' bin/*.py
65 # build .pyc files
66 %{__python} -m compileall bin shinken
68 %install
69 [ -d %{buildroot} -a "%{buildroot}" != "" ] && %{__rm} -rf %{buildroot}
71 # Exec
72 %{__install} -d -m0755 %{buildroot}%{_sbindir}
73 %{__install} -p -m0755 bin/shinken-*.py{,c} %{buildroot}%{_sbindir}
75 # libs
76 %{__install} -d -m0755 %{buildroot}%{python_sitelib}/shinken
77 %{__install} -p -m0644 shinken/*.py{,c} %{buildroot}%{python_sitelib}/shinken
80 # configs files
81 %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/
82 %{__install} -p -m0755 configs/*.ini %{buildroot}%{_sysconfdir}/%{name}/
83 %{__install} -p -m0644 etc/shinken-specific.cfg %{buildroot}%{_sysconfdir}/%{name}/
85 # SysV init
86 %{__install} -d -m0755 %{buildroot}%{_initrddir}
87 %{__install} -p -m0755 bin/init.d/shinken-* %{buildroot}%{_initrddir}/
89 # Log dir
90 %{__install} -d -m0775 %{buildroot}%{_localstatedir}/log/%{name}/
92 # pid files
93 %{__install} -d -m0775 %{buildroot}%{_localstatedir}/run/%{name}/
95 # workdir
96 %{__install} -d -m0775 %{buildroot}%{_localstatedir}/lib/%{name}/
99 %clean
100 [ -d %{buildroot} -a "%{buildroot}" != "" ] && %{__rm} -rf %{buildroot}
103 #====[ pre installation scripts:
104 %pre
105 # Add user/group:
106 echo Adding %{shinken_user} user ...
107 /usr/sbin/useradd -M -o -r -d %{_localstatedir}/log/%{name} -s /sbin/nologin -c "Shinken user" %{shinken_user} > /dev/null 2>&1 || :
110 #====[ post installation scripts:
111 %post
112 # Add initscript to system V start :
113 /sbin/chkconfig --add %{sysv_service}
114 /sbin/chkconfig %{sysv_service} on
117 #====[ pre uninstall scripts
118 %preun
119 if [ $1 -eq 0 ]; then
120 # Stop and remove initscript :
121 /sbin/service %{sysv_service} stop &>/dev/null || :
122 /sbin/chkconfig --del %{sysv_service}
125 %postun
127 %files
128 %defattr(-,root,root)
129 %doc README COPYING Changelog FROM_NAGIOS_TO_SHINKEN THANKS db doc
131 %{_initrddir}/shinken-*
132 %{_sbindir}/shinken-*
133 %{python_sitelib}/shinken
135 %config(noreplace) %{_sysconfdir}/%{name}/*.ini
136 %config(noreplace) %{_sysconfdir}/%{name}/*.cfg
139 %attr(-,%{shinken_user} ,%{shinken_group}) %dir %{_localstatedir}/log/%{name}
140 %attr(-,%{shinken_user} ,%{shinken_group}) %dir %{_localstatedir}/lib/%{name}
141 %attr(-,%{shinken_user} ,%{shinken_group}) %dir %{_localstatedir}/run/%{name}
143 %changelog
144 * Thu Aug 5 2010 Stéphane Urbanovski <s.urbanovski@ac-nancy-metz.fr> - 0.2
145 - Initial package