Name: @PACKAGE@ Version: @VERSION@ Release: %{buildno} Summary: sipXecs process supervisor License: Pingtel Commercial License Group: Productivity/Telephony/SIP/Servers Vendor: Pingtel Corp. Packager: Pingtel Url: http://www.pingtel.com Source: %name-%version.tar.gz %if %{_vendor} == redhat Requires: chkconfig %endif Requires: sipxcommserverlib >= 3.11 # by requiring sipxpbx, that will be upgraded first so it won't object to this overriding files Requires: sipxpbx >= @VERSION@ # sending email - an smtp listener must be running on localhost %if %{_vendor} == redhat Requires: smtpdaemon %endif %if %{_vendor} == suse Requires: postfix %endif Prefix: %_prefix BuildRoot: %{_tmppath}/%name-%version-root # should match sipXlib.m4:SIPX_VARDIR/upgrade %define upgrade_archive_dir %{_localstatedir}/sipxdata/upgrade %define this_archive %{name}-%{version}-%{release}.tgz %description The sipXecs project is a comprehansive small/medium scale Enterprise SIP PBX. This component manages sipXecs processes and acts as the configuration agent for a remote management application. %if %{_vendor} == suse %debug_package %endif %package devel Requires: %name Group: Development/Libraries Vendor: SIPfoundry Summary: Internal documentation for %name Requires: sipxcommserverlib-devel >= 3.11 %description devel Internal class documentation for the sipXsupervisor classes %prep %setup -q %build %configure --enable-rpmbuild @CONFIGURE_OPTIONS@ cp config.log %name.configlog make %install # makeinstall RPM macro doesn't leverage DESTDIR but instead overrides # libdir, bindir, etc just for make install. This not copesetic w/how # our makefiles are built, they'd rather preserve libdir, and use # DESTDIR when copying/moving/creating files. The approach we're taking # is quite standard, so it's surprising RPM's makeinstall macro is # the way it is. rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install %define upgrade_archive_root ${RPM_BUILD_ROOT}%{upgrade_archive_dir} mkdir -p %{upgrade_archive_root} # Make a 'current' tar file of etc for upgrade tar --directory ${RPM_BUILD_ROOT} \ -czf %{upgrade_archive_root}/%{this_archive} \ etc %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc CONTRIBUTORS README NEWS TODO ChangeLog %name.configlog %attr(755,root,root) %{_bindir}/sipxsupervisor %attr(755,root,root) %{_bindir}/sipxsupervisor.sh %attr(755,root,root) %{_bindir}/%name-config # The configuration directory needs to be writeable because # config files are generated from templates via config.defs %config(noreplace) %attr(644,root,@SIPXPBXGROUP@) %{_sysconfdir}/sipxpbx/alarms/sipXalarms-config.xml %config(noreplace) %attr(644,root,@SIPXPBXGROUP@) %{_datadir}/sipxecs/alarms/alarm-strings.xml %config(noreplace) %attr(644,root,@SIPXPBXGROUP@) %{_datadir}/sipxecs/alarms/sipXalarms-strings.xml %attr(755,root,root) %{_datadir}/sipxecs/schema/sipXecs-process.xsd %attr(755,root,root) %{_datadir}/sipxecs/schema/alarm.xsd %dir %attr(775,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_localstatedir}/sipxdata/process-state %dir %attr(775,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_localstatedir}/sipxdata/process-cfgver %{upgrade_archive_dir}/%{this_archive} %files devel %defattr(644,root,root,755) %docdir %{_datadir}/doc/sipxecs/%name %{_datadir}/doc/sipxecs/%name %pre %post rm -f %{_localstatedir}/sipxdata/tmp/processAlias.dat rm -f %{_localstatedir}/sipxdata/tmp/locked.lck %define current_archive %{upgrade_archive_dir}/%{name}-current.tgz %define previous_archive %{upgrade_archive_dir}/%{name}-previous.tgz if [ -f %{current_archive} ]; then mv %{current_archive} %{previous_archive} fi mv %{upgrade_archive_dir}/%{this_archive} %{current_archive} pkg-upgrade --previous %{previous_archive} --current %{current_archive}