Build ceilometer 2015.1.0 (stable/kilo)
[openstack-build/ceilometer-build.git] / rpm / SPECS / openstack-ceilometer.spec
index a0f0bd36e8918d519aac461537b8f58f6b59bb06..89f23cf70a946ac9377104e0f78bc4e43ac86e63 100644 (file)
@@ -3,7 +3,7 @@
 %global pypi_name ceilometer
 
 Name:             openstack-ceilometer
-Version:          2014.2.b1
+Version:          2015.1.0
 Release:          2%{?dist}
 Summary:          OpenStack measurement collection service
 
@@ -13,8 +13,9 @@ URL:              https://wiki.openstack.org/wiki/Ceilometer
 Source0:          http://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
 Source1:          %{pypi_name}-dist.conf
 Source2:          %{pypi_name}.logrotate
-Source3:          %{pypi_name}.conf.sample
+Source3:          ceilometer-rootwrap-sudoers
 
+%if 0%{?rhel} && 0%{?rhel} <= 6
 Source10:         %{name}-api.init
 Source100:        %{name}-api.upstart
 Source11:         %{name}-collector.init
@@ -29,6 +30,21 @@ Source15:         %{name}-alarm-evaluator.init
 Source150:        %{name}-alarm-evaluator.upstart
 Source16:         %{name}-notification.init
 Source160:        %{name}-notification.upstart
+Source17:         %{name}-ipmi.init
+Source170:        %{name}-ipmi.upstart
+Source18:         %{name}-polling.init
+Source180:        %{name}-polling.upstart
+%else
+Source10:         %{name}-api.service
+Source11:         %{name}-collector.service
+Source12:         %{name}-compute.service
+Source13:         %{name}-central.service
+Source14:         %{name}-alarm-notifier.service
+Source15:         %{name}-alarm-evaluator.service
+Source16:         %{name}-notification.service
+Source17:         %{name}-ipmi.service
+Source18:         %{name}-polling.service
+%endif
 
 #
 # patches_base=2014.1.1
@@ -38,16 +54,24 @@ BuildArch:        noarch
 BuildRequires:    intltool
 BuildRequires:    python-sphinx10
 BuildRequires:    python-setuptools
-BuildRequires:    python-pbr
+BuildRequires:    python-pbr >= 0.10
 BuildRequires:    python-d2to1
 BuildRequires:    python2-devel
-
 BuildRequires:    openstack-utils
 
+# These are required to generate ceilometer configuration file
+BuildRequires:    python-tox
+BuildRequires:    python-oslo-db >= 1.7.0
+BuildRequires:    python-oslo-messaging >= 1.8.0
+BuildRequires:    python-keystonemiddleware >= 1.5.0
+
 # These are required to build due to the requirements check added
-BuildRequires:    python-sqlalchemy
-BuildRequires:    python-webob1.2
+BuildRequires:    python-sqlalchemy >= 0.9.7
+BuildRequires:    python-webob >= 1.2.3
 
+%if ! (0%{?rhel} && 0%{?rhel} <= 6)
+BuildRequires: systemd-units
+%endif
 
 %description
 OpenStack ceilometer provides services to measure and
@@ -58,60 +82,53 @@ collect metrics from OpenStack components.
 Summary:          OpenStack ceilometer python libraries
 Group:            Applications/System
 
-Requires:         python-qpid
-Requires:         python-kombu
-
-Requires:         python-babel
-Requires:         python-eventlet >= 0.13.0
+Requires:         python-alembic >= 0.7.2
+Requires:         python-ceilometerclient >= 1.0.13
+Requires:         python-croniter >= 0.3.4
+Requires:         python-eventlet >= 0.16.1
+Requires:         python-flask >= 0.10
+Requires:         python-glanceclient >= 1:0.15.0
 Requires:         python-iso8601 >= 0.1.9
+Requires:         python-jsonpath-rw >= 1.2.0
+Requires:         python-jsonschema >= 2.0.0
+Requires:         python-kafka >= 0.9.2
+Requires:         python-keystoneclient >= 1.1.0
+Requires:         python-keystonemiddleware >= 1.5.0
 Requires:         python-lxml >= 2.3
-Requires:         python-anyjson >= 0.3.3
-Requires:         python-jsonpath-rw >= 1.2.0, python-jsonpath-rw < 2.0
-Requires:         python-stevedore >= 0.14
+Requires:         python-migrate >= 0.9.5
 Requires:         python-msgpack >= 0.4.0
+Requires:         python-neutronclient >= 2.3.11
+Requires:         python-novaclient >= 1:2.22.0
+Requires:         python-oslo-concurrency >= 1.8.0
+Requires:         python-oslo-config >= 1:1.9.3
+Requires:         python-oslo-context >= 0.2.0
+Requires:         python-oslo-db >= 1.7.0
+Requires:         python-oslo-i18n >= 1.5.0
+Requires:         python-oslo-messaging >= 1.8.0
+Requires:         python-oslo-middleware >= 1.0.0
+Requires:         python-oslo-policy >= 0.3.1
+Requires:         python-oslo-rootwrap >= 1.6.0
+Requires:         python-oslo-serialization >= 1.4.0
+Requires:         python-oslo.utils >= 1.4.0
+Requires:         python-paste-deploy >= 1.5.0
+Requires:         python-pbr >= 0.10
+Requires:         python-pecan >= 0.8.0
 Requires:         python-posix_ipc
-Requires:         python-six >= 1.7.0
-Requires:         PyYAML
-
-Requires:         python-argparse
-Requires:         python-croniter >= 0.3.4
-Requires:         python-happybase >= 0.5, python-happybase < 0.7, python-happybase > 0.7
-Requires:         python-jsonschema >= 2.0.0, python-jsonschema < 3.0.0
-Requires:         python-lockfile >= 0.8
-Requires:         python-netaddr >= 0.7.6
-Requires:         python-pbr >= 0.6, python-pbr < 0.7, python-pbr > 0.7, python-pbr < 1.0
-Requires:         python-requests >= 1.1
-
-Requires:         python-sqlalchemy >= 0.8.4, python-sqlalchemy < 0.95, python-sqlalchemy > 0.9.5, python-sqlalchemy <= 0.9.99
-Requires:         python-alembic >= 0.6.4
-Requires:         python-migrate >= 0.9.1
-
+Requires:         python-pymongo >= 2.6.3
+Requires:         python-pysnmp >= 4.2.1
+Requires:         pytz >= 2013.6
+Requires:         python-qpid
+Requires:         python-requests >= 2.2.0
+Requires:         python-retrying >= 1.2.3
+Requires:         python-six >= 1.9.0
+Requires:         python-sqlalchemy >= 0.9.7
+Requires:         python-stevedore >= 1.3.0
+Requires:         python-swiftclient >= 2.2.0
+Requires:         python-tooz >= 0.13.1
+Requires:         python-werkzeug >= 0.7
 Requires:         python-webob >= 1.2.3
-
-Requires:         python-oslo-config >= 1:1.2.1
-Requires:         python-oslo-vmware >= 0.4
-Requires:         python-oslo-messaging >= 1.3.0
-
-Requires:         pysnmp > 4.2.1, pysnmp < 5.0.0
-Requires:         pytz
-Requires:         python-croniter
-
-Requires:         python-keystonemiddleware >= 1.0.0
-Requires:         python-paste-deploy >= 1.5.0
-
-# These were only added as global dependencies
-# at the end of the Icehouse cycle with the change
-# to cli.py referenced from in http://pad.lv/1317210
-Requires:         python-pymongo
-Requires:         python-flask
-Requires:         python-pecan >= 0.5.0
-Requires:         python-wsme >= 0.6
-Requires:         python-novaclient >= 2.17.0
-Requires:         python-keystoneclient >= 0.9.0
-Requires:         python-glanceclient >= 0.13.1
-Requires:         python-swiftclient >= 2.0.2
-Requires:         python-ceilometerclient >= 1.0.6
-Requires:         libvirt-python
+Requires:         python-wsme >= 0.8
+Requires:         PyYAML >= 3.1.0
 
 %description -n   python-ceilometer
 OpenStack ceilometer provides services to measure and
@@ -127,13 +144,17 @@ Group:            Applications/System
 Requires:         python-ceilometer = %{version}-%{release}
 Requires:         openstack-utils
 
+%if 0%{?rhel} && 0%{?rhel} <= 6
 Requires(post):   chkconfig
 Requires(postun): initscripts
 Requires(preun):  chkconfig
+%else
+Requires(post):   systemd-units
+Requires(preun):  systemd-units
+Requires(postun): systemd-units
+%endif
 Requires(pre):    shadow-utils
 
-
-
 %description common
 OpenStack ceilometer provides services to measure and
 collect metrics from OpenStack components.
@@ -148,9 +169,9 @@ Group:            Applications/System
 
 Requires:         %{name}-common = %{version}-%{release}
 
-Requires:         python-novaclient >= 2.17.0
-Requires:         python-keystoneclient >= 0.9.0
 Requires:         libvirt-python
+Requires:         python-keystoneclient >= 1.1.0
+Requires:         python-novaclient >= 2.22.0
 
 %description compute
 OpenStack ceilometer provides services to measure and
@@ -166,10 +187,10 @@ Group:            Applications/System
 
 Requires:         %{name}-common = %{version}-%{release}
 
-Requires:         python-novaclient >= 2.17.0
-Requires:         python-keystoneclient >= 0.9.0
-Requires:         python-glanceclient >= 0.13.1
-Requires:         python-swiftclient >= 2.0.2
+Requires:         python-glanceclient >= 0.15.0
+Requires:         python-keystoneclient >= 1.1.0
+Requires:         python-novaclient >= 2.22.0
+Requires:         python-swiftclient >= 2.2.0
 
 %description central
 OpenStack ceilometer provides services to measure and
@@ -186,9 +207,8 @@ Requires:         %{name}-common = %{version}-%{release}
 
 # For compat with older provisioning tools.
 # Remove when all reference the notification package explicitly
-Requires:         %{name}-notification
-
-Requires:         python-pymongo
+Requires:         %{name}-notification = %{version}-%{release}
+Requires:         python-pymongo >= 2.6.3
 
 %description collector
 OpenStack ceilometer provides services to measure and
@@ -219,9 +239,12 @@ Group:            Applications/System
 
 Requires:         %{name}-common = %{version}-%{release}
 
-Requires:         python-pymongo
-Requires:         python-flask
-Requires:         python-pecan >= 0.4.5
+Requires:         python-flask >= 0.10
+Requires:         python-keystonemiddleware >= 1.5.0
+Requires:         python-oslo-db >= 1.7.0
+Requires:         python-paste-deploy >= 1.5.0
+Requires:         python-pecan >= 0.8.0
+Requires:         python-pymongo >= 2.6.3
 Requires:         python-wsme >= 0.6
 
 %description api
@@ -236,7 +259,7 @@ Summary:          OpenStack ceilometer alarm services
 Group:            Applications/System
 
 Requires:         %{name}-common = %{version}-%{release}
-Requires:         python-ceilometerclient >= 1.0.6
+Requires:         python-ceilometerclient >= 1.0.13
 
 %description alarm
 OpenStack ceilometer provides services to measure and
@@ -246,17 +269,63 @@ This package contains the ceilometer alarm notification
 and evaluation services.
 
 
+%package ipmi
+Summary:          OpenStack ceilometer ipmi agent
+Group:            Applications/System
+
+Requires:         %{name}-common = %{version}-%{release}
+
+Requires:         ipmitool
+Requires:         python-keystoneclient >= 1.1.0
+Requires:         python-neutronclient >= 2.3.11
+Requires:         python-novaclient >= 2.22.0
+Requires:         python-oslo-rootwrap >= 1.6.0
+Requires:         python-tooz >= 0.13.1
+
+%description ipmi
+OpenStack ceilometer provides services to measure and
+collect metrics from OpenStack components.
+
+This package contains the ipmi agent to be run on OpenStack
+nodes from which IPMI sensor data is to be collected directly,
+by-passing Ironic's management of baremetal.
+
+
+%package polling
+Summary:          OpenStack ceilometer polling agent
+Group:            Applications/System
+
+Requires:         %{name}-common = %{version}-%{release}
+
+Requires:         libvirt-python
+Requires:         python-glanceclient >= 0.15.0
+Requires:         python-keystoneclient >= 1.1.0
+Requires:         python-novaclient >= 2.22.0
+Requires:         python-swiftclient >= 2.2.0
+
+%description polling
+Ceilometer aims to deliver a unique point of contact for billing systems to
+aquire all counters they need to establish customer billing, across all
+current and future OpenStack components. The delivery of counters must
+be tracable and auditable, the counters must be easily extensible to support
+new projects, and agents doing data collections should be
+independent of the overall system.
+
+This package contains the polling service.
+
+
 %if 0%{?with_doc}
 %package doc
 Summary:          Documentation for OpenStack ceilometer
 Group:            Documentation
 
 # Required to build module documents
-BuildRequires:    python-eventlet
-BuildRequires:    python-sqlalchemy0.7
-BuildRequires:    python-webob
+BuildRequires:    python-eventlet >= 0.16.1
+BuildRequires:    python-sqlalchemy >= 0.9.7
+BuildRequires:    python-webob >= 1.2.3
 # while not strictly required, quiets the build down when building docs.
-BuildRequires:    python-migrate, python-iso8601
+BuildRequires:    python-migrate >= 0.9.5
+BuildRequires:    python-iso8601 >= 0.1.9
 
 %description      doc
 OpenStack ceilometer provides services to measure and
@@ -298,21 +367,34 @@ rm -fr build/html/.doctrees build/html/.buildinfo
 
 popd
 
+# Genenrate ceilometer.conf.sample
+oslo-config-generator --output-file etc/ceilometer/ceilometer.conf.sample \
+             --namespace ceilometer \
+             --namespace oslo.db \
+             --namespace oslo.messaging \
+             --namespace keystonemiddleware.auth_token
+
 # Setup directories
 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
-install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
+install -d -m 775 %{buildroot}%{_localstatedir}/log/ceilometer
 
 # Install config files
 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
+install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer/rootwrap.d
+install -d -m 755 %{buildroot}%{_sysconfdir}/sudoers.d
 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
-install -p -D -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
+install -p -D -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers.d/ceilometer
+install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
 install -p -D -m 640 etc/ceilometer/event_definitions.yaml %{buildroot}%{_sysconfdir}/ceilometer/event_definitions.yaml
 install -p -D -m 640 etc/ceilometer/api_paste.ini %{buildroot}%{_sysconfdir}/ceilometer/api_paste.ini
+install -p -D -m 640 etc/ceilometer/rootwrap.conf %{buildroot}%{_sysconfdir}/ceilometer/rootwrap.conf
+install -p -D -m 640 etc/ceilometer/rootwrap.d/ipmi.filters %{buildroot}/%{_sysconfdir}/ceilometer/rootwrap.d/ipmi.filters
 
 # Install initscripts for services
+%if 0%{?rhel} && 0%{?rhel} <= 6
 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
@@ -320,6 +402,8 @@ install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
+install -p -D -m 755 %{SOURCE17} %{buildroot}%{_initrddir}/%{name}-ipmi
+install -p -D -m 755 %{SOURCE18} %{buildroot}%{_initrddir}/%{name}-polling
 
 # Install upstart jobs examples
 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
@@ -330,12 +414,27 @@ install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
+install -p -m 644 %{SOURCE170} %{buildroot}%{_datadir}/ceilometer/
+install -p -m 644 %{SOURCE180} %{buildroot}%{_datadir}/ceilometer/
+%else
+install -p -D -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/%{name}-api.service
+install -p -D -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}-collector.service
+install -p -D -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/%{name}-compute.service
+install -p -D -m 644 %{SOURCE13} %{buildroot}%{_unitdir}/%{name}-central.service
+install -p -D -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/%{name}-alarm-notifier.service
+install -p -D -m 644 %{SOURCE15} %{buildroot}%{_unitdir}/%{name}-alarm-evaluator.service
+install -p -D -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/%{name}-notification.service
+install -p -D -m 644 %{SOURCE17} %{buildroot}%{_unitdir}/%{name}-ipmi.service
+install -p -D -m 644 %{SOURCE18} %{buildroot}%{_unitdir}/%{name}-polling.service
+%endif
 
 # Install logrotate
 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
 
+%if 0%{?rhel} && 0%{?rhel} <= 6
 # Install pid directory
 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
+%endif
 
 # Remove unneeded in production stuff
 rm -f %{buildroot}%{_bindir}/ceilometer-debug
@@ -353,140 +452,281 @@ fi
 exit 0
 
 %post compute
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 1 ] ; then
     # Initial installation
     /sbin/chkconfig --add %{name}-compute
 fi
+%else
+%systemd_post %{name}-compute.service
+%endif
 
 %post collector
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 1 ] ; then
     # Initial installation
     /sbin/chkconfig --add %{name}-collector
 fi
+%else
+%systemd_post %{name}-collector.service
+%endif
 
 %post notification
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 1 ] ; then
     # Initial installation
     /sbin/chkconfig --add %{name}-notification
 fi
+%else
+%systemd_post %{name}-notification.service
+%endif
 
 %post api
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 1 ] ; then
     # Initial installation
     /sbin/chkconfig --add %{name}-api
 fi
+%else
+%systemd_post %{name}-api.service
+%endif
 
 %post central
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 1 ] ; then
     # Initial installation
     /sbin/chkconfig --add %{name}-central
 fi
+%else
+%systemd_post %{name}-central.service
+%endif
+
 
 %post alarm
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 1 ] ; then
     # Initial installation
     for svc in alarm-notifier alarm-evaluator; do
         /sbin/chkconfig --add %{name}-${svc}
     done
 fi
+%else
+%systemd_post %{name}-alarm-notifier.service %{name}-alarm-evaluator.service
+%endif
+
+%post ipmi
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -eq 1 ] ; then
+    # Initial installation
+    /sbin/chkconfig --add %{name}-ipmi
+fi
+%else
+%systemd_post %{name}-alarm-ipmi.service
+%endif
+
+%post polling
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -eq 1 ] ; then
+    # Initial installation
+    /sbin/chkconfig --add %{name}-polling
+fi
+%else
+%systemd_post %{name}-polling.service
+%endif
 
 %preun compute
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 0 ] ; then
     for svc in compute; do
         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
         /sbin/chkconfig --del %{name}-${svc}
     done
 fi
+%else
+%systemd_preun %{name}-compute.service
+%endif
 
 %preun collector
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 0 ] ; then
     for svc in collector; do
         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
         /sbin/chkconfig --del %{name}-${svc}
     done
 fi
+%else
+%systemd_preun %{name}-collector.service
+%endif
 
 %preun notification
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 0 ] ; then
     for svc in notification; do
         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
         /sbin/chkconfig --del %{name}-${svc}
     done
 fi
+%else
+%systemd_preun %{name}-notification.service
+%endif
 
 %preun api
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 0 ] ; then
     for svc in api; do
         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
         /sbin/chkconfig --del %{name}-${svc}
     done
 fi
+%else
+%systemd_preun %{name}-api.service
+%endif
 
 %preun central
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 0 ] ; then
     for svc in central; do
         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
         /sbin/chkconfig --del %{name}-${svc}
     done
 fi
+%else
+%systemd_preun %{name}-central.service
+%endif
+
 
 %preun alarm
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -eq 0 ] ; then
     for svc in alarm-notifier alarm-evaluator; do
         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
         /sbin/chkconfig --del %{name}-${svc}
     done
 fi
+%else
+%systemd_preun %{name}-alarm-notifier.service %{name}-alarm-evaluator.service
+%endif
+
+%preun ipmi
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -eq 0 ] ; then
+    for svc in ipmi; do
+        /sbin/service %{name}-${svc} stop > /dev/null 2>&1
+        /sbin/chkconfig --del %{name}-${svc}
+    done
+fi
+%else
+%systemd_preun %{name}-ipmi.service
+%endif
+
+%preun polling
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -eq 0 ] ; then
+    for svc in polling; do
+        /sbin/service %{name}-${svc} stop > /dev/null 2>&1
+        /sbin/chkconfig --del %{name}-${svc}
+    done
+fi
+%else
+%systemd_preun %{name}-polling.service
+%endif
 
 %postun compute
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
     for svc in compute; do
         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
     done
 fi
+%else
+%systemd_postun_with_restart %{name}-compute.service
+%endif
 
 %postun collector
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
     for svc in collector; do
         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
     done
 fi
+%else
+%systemd_postun_with_restart %{name}-collector.service
+%endif
 
 %postun notification
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
     for svc in notification; do
         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
     done
 fi
+%else
+%systemd_postun_with_restart %{name}-notification.service
+%endif
 
 %postun api
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
     for svc in api; do
         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
     done
 fi
+%else
+%systemd_postun_with_restart %{name}-api.service
+%endif
 
 %postun central
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
     for svc in central; do
         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
     done
 fi
+%else
+%systemd_postun_with_restart %{name}-central.service
+%endif
+
 
 %postun alarm
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%if 0%{?rhel} && 0%{?rhel} <= 6
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
     for svc in alarm-notifier alarm-evaluator; do
         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
     done
 fi
+%else
+%systemd_postun_with_restart %{name}-alarm-notifier.service %{name}-alarm-evaluator.service
+%endif
 
+%postun ipmi
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    for svc in ipmi; do
+        /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
+    done
+fi
+%else
+%systemd_postun_with_restart %{name}-ipmi.service
+%endif
+
+%postun polling
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    for svc in polling; do
+        /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
+    done
+fi
+%else
+%systemd_postun_with_restart %{name}-polling.service
+%endif
 
 %files common
 %doc LICENSE
@@ -499,8 +739,10 @@ fi
 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/event_definitions.yaml
 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
 
-%dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
+%dir %attr(0775, ceilometer, ceilometer) %{_localstatedir}/log/ceilometer
+%if 0%{?rhel} && 0%{?rhel} <= 6
 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
+%endif
 
 %{_bindir}/ceilometer-dbsync
 %{_bindir}/ceilometer-expirer
@@ -525,44 +767,104 @@ fi
 
 %files compute
 %{_bindir}/ceilometer-agent-compute
+%if 0%{?rhel} && 0%{?rhel} <= 6
 %{_initrddir}/%{name}-compute
 %{_datarootdir}/ceilometer/%{name}-compute.upstart
+%else
+%{_unitdir}/%{name}-compute.service
+%endif
 
 
 %files collector
 %{_bindir}/ceilometer-collector*
+%if 0%{?rhel} && 0%{?rhel} <= 6
 %{_initrddir}/%{name}-collector
 %{_datarootdir}/ceilometer/%{name}-collector.upstart
+%else
+%{_unitdir}/%{name}-collector.service
+%endif
 
 
 %files notification
 %{_bindir}/ceilometer-agent-notification
+%if 0%{?rhel} && 0%{?rhel} <= 6
 %{_initrddir}/%{name}-notification
 %{_datarootdir}/ceilometer/%{name}-notification.upstart
+%else
+%{_unitdir}/%{name}-notification.service
+%endif
 
 
 %files api
 %{_bindir}/ceilometer-api
+%if 0%{?rhel} && 0%{?rhel} <= 6
 %{_initrddir}/%{name}-api
 %{_datarootdir}/ceilometer/%{name}-api.upstart
+%else
+%{_unitdir}/%{name}-api.service
+%endif
 
 
 %files central
 %{_bindir}/ceilometer-agent-central
+%if 0%{?rhel} && 0%{?rhel} <= 6
 %{_initrddir}/%{name}-central
 %{_datarootdir}/ceilometer/%{name}-central.upstart
+%else
+%{_unitdir}/%{name}-central.service
+%endif
+
+
+%files ipmi
+%config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/rootwrap.conf
+%config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/rootwrap.d/ipmi.filters
+%{_bindir}/ceilometer-rootwrap
+%{_bindir}/ceilometer-agent-ipmi
+%{_sysconfdir}/sudoers.d/ceilometer
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{_initrddir}/%{name}-ipmi
+%{_datarootdir}/ceilometer/%{name}-ipmi.upstart
+%else
+%{_unitdir}/%{name}-ipmi.service
+%endif
+
+
+%files polling
+%{_bindir}/ceilometer-polling
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{_initrddir}/%{name}-polling
+%{_datarootdir}/ceilometer/%{name}-polling.upstart
+%else
+%{_unitdir}/%{name}-polling.service
+%endif
 
 
 %files alarm
 %{_bindir}/ceilometer-alarm-notifier
 %{_bindir}/ceilometer-alarm-evaluator
+%if 0%{?rhel} && 0%{?rhel} <= 6
 %{_initrddir}/%{name}-alarm-notifier
 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
 %{_initrddir}/%{name}-alarm-evaluator
 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
+%else
+%{_unitdir}/%{name}-alarm-notifier.service
+%{_unitdir}/%{name}-alarm-evaluator.service
+%endif
 
 
 %changelog
+* Fri Jan 23 2015 Ivan Berezovskiy <iberezovskiy@mirantis.com> - 2015.1.0
+- Create own package for polling agent
+- Update requirements and version to 2015.1.0
+
+* Wed Jan 21 2015 Ivan Berezovskiy <iberezovskiy@mirantis.com> - 2015.1.0b1
+- Update version to 2015.1.0b1
+
+* Wed Nov 19 2014 Daniil Trishkin <dtrishkin@mirantis.com> - 2014.2
+- Update to upstream 2014.2
+- Update requirements
+
 * Fri Jul 4 2014 Ivan Berezovskiy <iberezovskiy@mirantis.com> - 2014.2.b1
 - Update to upstream 2014.2.b1
 - Update requirements
@@ -649,3 +951,4 @@ fi
 
 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3
 - Initial package
+