# openser.spec for openpkg # package version %define V_full 0.9.5 %define V_comp %nil # package information Name: openser Summary: OpenSIP Express Router, very fast and flexible SIP Proxy URL: http://openser.org/ Vendor: OpenSER.org Packager: Michele Favara Pedarsi Class: PLUS Group: VOIP License: GPL Version: 0.9.5 Release: 2.4.0 # package options %option with_mysql no %option with_postgress no %option with_jabber no %option with_cpl no #%option with_radius no %option with_pa no # list of sources Source0: http://openser.org/pub/openser/stable/%{name}-%{version}_src.tar.gz Source1: rc.openser # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} Conflicts: openser < %{version} BuildPreReq: OpenPKG, openpkg >= 2.4.0, make >= 3.79, gcc >= 3.4.4, flex, bison PreReq: OpenPKG, openpkg >= 2.4.0 %if "%{with_mysql}" == "yes" BuildPreReq: zlib, mysql PreReq: mysql %endif %if "%{with_jabber}" == "yes" BuildPreReq: expat PreReq: expat %endif AutoReq: no AutoReqProv: no Provides: openser = %{version}-%{release} %description OpenSER or Open SIP Express Router is a very fast and flexible SIP (RFC3621) proxy server. Written entirely in C, openser can handle thousands calls per second even on low-budget hardware. A C Shell like scripting language provides full control over the server's behaviour. It's modular architecture allows only required functionality to be loaded. Currently the following modules are available: digest authentication, CPL scripts, instant messaging, MySQL support, a presence agent, radius authentication, record routing, an SMS gateway, a jabber gateway, a transaction module, registrar and user location. MYSQL OPTION. The openser-mysql package contains MySQL database connectivity that you need to use digest authentication module or persistent user location entries. JABBER OPTION. The openser-jabber package contains a sip to jabber message translator. CPL OPTION. The openser-cpl package contains a SIP CPL interpreter engine. #RADIUS OPTION. The openser-radius package contains modules for radius authentication, group # membership and uri checking. %track prog openser = { version = %{version} url = http://openser.org/pub/openser/%{version}/src/ regex = openser-(__VER__)_src\.tar\.gz } # some defines needed for options %define EXCLUDED_MODULES mysql jabber cpl-c avp_radius auth_radius group_radius uri_radius postgress pa %define MYSQL_MODULES mysql %define JABBER_MODULES jabber %define CPL_MODULES cpl-c %define RADIUS_MODULES avp_radius auth_radius group_radius uri_radius %define RADIUS_MOD_PATH modules/avp_radius modules/auth_radius modules/group_radius modules/uri_radius %prep %setup -q %build %{l_make} %{l_mflags} all skip_modules="%EXCLUDED_MODULES" cfg-target=%{_sysconfdir}/openser/ %if "%{with_mysql}" == "yes" %{l_make} %{l_mflags} modules modules="modules/%MYSQL_MODULES" cfg-target=%{_sysconfdir}/openser/ %endif %if "%{with_jabber}" == "yes" %{l_make} %{l_mflags} modules modules="modules/%JABBER_MODULES" cfg-target=%{_sysconfdir}/openser/ %endif %if "%{with_cpl}" == "yes" %{l_make} %{l_mflags} modules modules="modules/%CPL_MODULES" cfg-target=%{_sysconfdir}/openser/ %endif # %if "%{with_radius}" == "yes" # %{l_make} %{l_mflags} modules modules="%RADIUS_MOD_PATH" cfg-target=%{_sysconfdir}/openser/ # %endif %install rm -rf $RPM_BUILD_ROOT %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT %{l_make} %{l_mflags} install skip_modules="%EXCLUDED_MODULES" \ basedir=$RPM_BUILD_ROOT \ prefix=%{_prefix} \ cfg-prefix=$RPM_BUILD_ROOT%{l_prefix} \ cfg-target=%{_sysconfdir}/openser/ %if "%{with_mysql}" == "yes" %{l_make} %{l_mflags} install-modules modules="modules/%MYSQL_MODULES" \ basedir=$RPM_BUILD_ROOT \ prefix=%{_prefix} \ cfg-prefix=$RPM_BUILD_ROOTT%{l_prefix} \ cfg-target=%{_sysconfdir}/openser/ %endif %if "%{with_jabber}" == "yes" %{l_make} %{l_mflags} install-modules modules="modules/%JABBER_MODULES" \ basedir=$RPM_BUILD_ROOT \ prefix=%{_prefix} \ cfg-prefix=$RPM_BUILD_ROOTT%{l_prefix} \ cfg-target=%{_sysconfdir}/openser/ %endif %if "%{with_jabber}" == "yes" %{l_make} %{l_mflags} install-doc modules="modules/%JABBER_MODULES" \ basedir=$RPM_BUILD_ROOT \ prefix=%{_prefix} \ cfg-prefix=$RPM_BUILD_ROOT%{l_prefix} \ cfg-target=%{_sysconfdir}/openser/ %endif %if "%{with_cpl}" == "yes" %{l_make} %{l_mflags} install-modules modules="modules/%CPL_MODULES" \ basedir=$RPM_BUILD_ROOT \ prefix=%{_prefix} \ cfg-prefix=$RPM_BUILD_ROOT%{l_prefix} \ cfg-target=%{_sysconfdir}/openser/ %endif %if "%{with_cpl}" == "yes" %{l_make} %{l_mflags} install-doc modules="modules/%CPL_MODULES" \ basedir=$RPM_BUILD_ROOT \ prefix=%{_prefix} \ cfg-prefix=$RPM_BUILD_ROOT%{l_prefix} \ cfg-target=%{_sysconfdir}/openser/ %endif #%{l_make} %{l_mflags} install-modules modules="%RADIUS_MOD_PATH" \ # basedir=$RPM_BUILD_ROOT \ # prefix=%{_prefix} \ # cfg-prefix=$RPM_BUILD_ROOT%{l_prefix} \ # cfg-target=%{_sysconfdir}/openser/ #%{l_make} %{l_mflags} install-doc modules="%RADIUS_MOD_PATH" \ # basedir=$RPM_BUILD_ROOT \ # prefix=%{_prefix} \ # cfg-prefix=$RPM_BUILD_ROOT%{l_prefix} \ # cfg-target=%{_sysconfdir}/openser/ %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/var/openser %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE rc.openser} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} %files -f files %clean rm -rf $RPM_BUILD_ROOT %post echo "Package OpenSER installed, BUT: use at your own risk, I'm not responsable." %preun #if [ $1 = 0 ]; then # TODO: stop service # TODO: remove from rc.local #fi