Name: @PACKAGE@ Version: @VERSION@ Release: %{buildno} Summary: Common Code for sipX servers License: Pingtel Commercial License Group: Development/Libraries Vendor: Pingtel Corp. Packager: Pingtel Url: http://www.pingtel.com Source: %name-%version.tar.gz Requires: rpm %if %{_vendor} == suse Requires: xerces-c >= 2.6.0 %endif %if %{_vendor} == redhat Requires: xerces-c >= 2.6.0 Requires: rpm-libs %endif Requires: sipxportlib >= 3.11 Requires: sipxtacklib >= 3.11 Requires: unixODBC >= 2.2 Requires: ruby Requires: patch # bind-utils required for dig Requires: bind-utils Requires: %{name}-doc 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 This project is used to hold code used in common by a number of the sipX family servers. It is not intended to be useful as a standalone project. %if %{_vendor} == suse %debug_package %endif # Install header files %package devel Requires: %name %if %{_vendor} == suse Requires: xerces-c-devel >= 2.6.0 %endif %if %{_vendor} == redhat Requires: xerces-c-devel >= 2.6.0 %endif Requires: sipxportlib-devel >= 3.11 Requires: sipxtacklib-devel >= 3.11 Requires: unixODBC-devel >= 2.2 Group: Development/Libraries Vendor: SIPfoundry Summary: Header files for %name %description devel This package contains the neccessary header files and static libraries helpful to build projects using the sipXcommserverLib library %package doc Group: Development/Libraries Vendor: SIPfoundry Summary: Common document files for sipXecs %description doc This package contains common files for sipXecs documentation %prep %setup -q %build %configure @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} tar --directory ${RPM_BUILD_ROOT} \ -czf %{upgrade_archive_root}/%{this_archive} \ etc %clean rm -rf $RPM_BUILD_ROOT %pre # If needed, change open source daemon user name to @SIPXPBXUSER@. # The open source names that have been used are 'sipx' and 'sipxpbx'. for openname in sipx sipxpbx; do if [ "@SIPXPBXUSER@" != "${openname}" ] && ! id -u "@SIPXPBXUSER@" > /dev/null 2>&1 && id -u ${openname} > /dev/null 2>&1 then /usr/sbin/usermod -l @SIPXPBXUSER@ ${openname} fi done # If there is no daemon user, create it. # Red Hat's useradd command adds the group automatically, # but SUSE does not. # The -f option means to create the group only if it does not already exist. /usr/sbin/groupadd -f @SIPXPBXGROUP@ if ! id -u @SIPXPBXUSER@ > /dev/null 2>&1 ; then /usr/sbin/useradd \ -c "sipX service daemon" \ -d %{_sysconfdir}/sipxpbx \ -s /bin/bash \ -g @SIPXPBXGROUP@ \ @SIPXPBXUSER@ > /dev/null 2>&1 fi # record the old version sipx-upgrade -p sipxcommserverlib -c %post sipx-upgrade -p sipxcommserverlib -u --bdir %{_bindir} --ddir %{_datadir} --cdir %{_sysconfdir} --sdir %{_localstatedir} --ldir %{_libexecdir} rm -rf %{_sysconfdir}/sipxpbx/process.d %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} # On an HA Slave system the pkg-upgrade of config.defs will fail, since it will have been modified # by the install wizard. Could also happen on other systems where config.defs was modified. This # will simply make sure config.defs have the new watchdog XMLRPC server port item, without which # the new watchdog will not start. grep WATCHDOG_SERVER_XMLRPC_PORT %{_sysconfdir}/sipxpbx/config.defs > /dev/null if [ $? != "0" ]; then echo "" >> %{_sysconfdir}/sipxpbx/config.defs echo "WATCHDOG_SERVER_XMLRPC_PORT=8092" >> %{_sysconfdir}/sipxpbx/config.defs echo "" >> %{_sysconfdir}/sipxpbx/config.defs fi %files %defattr(644,root,root,755) %doc CONTRIBUTORS README NEWS TODO ChangeLog %name.configlog %attr(755,root,root) %{_bindir}/configpp %attr(755,root,root) %{_bindir}/config-defs %attr(755,root,root) %{_bindir}/get_def_addr %attr(755,root,root) %{_bindir}/%name-config %attr(4755,root,root) %{_bindir}/sipx-sudo-restore %attr(755,root,root) %{_bindir}/pkg-upgrade %attr(755,root,root) %{_bindir}/configmerge %attr(755,root,root) %{_bindir}/configquery %attr(755,root,root) %{_bindir}/xsdvalid %attr(755,root,root) %{_bindir}/sipx-validate-xml %attr(755,root,root) %{_bindir}/sipx-dns %attr(755,root,root) %{_bindir}/pgpatch.sh %attr(755,root,root) %{_bindir}/ssl-cert/gen-ssl-keys.sh %attr(755,root,root) %{_bindir}/ssl-cert/install-cert.sh %attr(755,root,root) %{_bindir}/ssl-cert/check-cert.sh %attr(755,root,root) %{_bindir}/ssl-cert/ca_rehash %attr(755,root,root) %{_libdir}/libsipXcommserver.la %attr(755,root,root) %{_libdir}/libsipXcommserver.so* %attr(755,root,root) %{_libexecdir}/sipXecs/sipx-utils.sh %attr(4750,root,@SIPXPBXGROUP@) %{_libexecdir}/sipXecs/sipxpackage %attr(4750,root,@SIPXPBXGROUP@) %{_libexecdir}/sipXecs/sipx-sudo-timezone %attr(4750,root,@SIPXPBXGROUP@) %{_libexecdir}/sipXecs/sipx-sudo-date %attr(755,root,root) %{_libexecdir}/sipXecs/setup.d/sipx-change-date-init %attr(755,root,root) %{_libexecdir}/sipXecs/setup.d/sipx-change-timezone-init %attr(755,root,root) %{_libexecdir}/sipXecs/setup.d/sipxpackage-init %{_datadir}/sipxecs/schema/xml.xsd %{_datadir}/sipxecs/schema/authrules.xsd %{_datadir}/sipxecs/schema/registration.xsd %{_datadir}/sipxecs/schema/urlmap.xsd %config(noreplace) %attr(644,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_sysconfdir}/sipxpbx/config.defs %attr(755,root,root) %{_sysconfdir}/sipxpbx/config.defs.map # These should match sipXlib.m4 or at least sent # to configure script %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_sysconfdir}/sipxpbx %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_sysconfdir}/sipxpbx/ssl %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_sysconfdir}/sipxpbx/ssl/authorities %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_datadir}/sipxecs %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_localstatedir}/log/sipxpbx %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_localstatedir}/run/sipxpbx %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_localstatedir}/sipxdata %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_localstatedir}/sipxdata/tmp %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_localstatedir}/sipxdata/sipdb %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_libexecdir}/sipXecs %dir %attr(755,@SIPXPBXUSER@,@SIPXPBXGROUP@) %{_libexecdir}/sipXecs/setup.d %{upgrade_archive_dir}/%{this_archive} %{upgrade_archive_dir}/%{name}-previous.tgz %files devel %defattr(644,root,root,755) %{_libdir}/libsipXcommserver.a %{_libdir}/libsipXcommserverTest.la %{_libdir}/libsipXcommserverTest.a %docdir %{_datadir}/doc/sipxecs/%name %{_datadir}/doc/sipxecs/%name %{_includedir}/configrpc/* %{_includedir}/digitmaps/* %{_includedir}/fastdb/* %{_includedir}/filereader/* %{_includedir}/odbc/* %{_includedir}/persist/* %{_includedir}/sipdb/* %{_includedir}/alarm/* %{_includedir}/sipXecsService/* %{_includedir}/testlib/* %files doc %docdir %{_datadir}/doc/sipxecs %{_datadir}/doc/sipxecs