File sipxcommons.spec of Package sipxcommons

%define release_prefix .b1274a6
#!BuildIgnore: post-build-checks
# see http://lizards.opensuse.org/2008/09/08/opensuse-build-service-build-checks/
Name: sipxcommons
Version: 0.0.4.5.1
Release: 1

Summary: Common server side Java packages and supporting third-parth JAR's for sipX
License: LGPL
Group: Productivity/Telephony/SIP/Servers
Vendor: SIPfoundry
Url: http://www.sipfoundry.org/sipXcommons
BuildRequires: java-devel >= 1.6
BuildRequires: ant-commons-logging
BuildRequires: ant-junit
BuildRequires: ant-nodeps
BuildRequires: automake
%if %{_vendor} == redhat
BuildRequires: shadow-utils
%endif
%if %{_vendor} == suse
BuildRequires: pwdutils
%endif
BuildRequires: zip
BuildRequires: asciidoc
%if %{_vendor} == suse
BuildRequires: docbook-xsl-stylesheets
%else
BuildRequires: docbook-style-xsl
%endif

Source: %name-%version.tar.gz

%if %{_vendor} == suse
Requires: pwdutils
%else
Requires: shadow-utils
%endif

%if %{?use_ibm_jvm}0
Requires: java-ibm >= 1.6
Requires: java-ibm-unrestricted
%else
Requires: java >= 1.6
%endif

%if %{_vendor} == suse
Requires: openssl >= 0.9.8
%endif

Prefix: %_prefix
BuildRoot: %{_tmppath}/%name-%version-root

%description
Common server side Java packages and supporting third-parth JAR's for sipX

%prep
%setup -q
# suse and obs build system
mv %{_builddir}/%name-%version/%name-rpmlintrc %{_sourcedir}

%build
%configure  --with-distdir=/home/dhubler/work/sipxecs-main/sipx/BUILD.main/dist SIPX_BUILD_LABEL=open
cp config.log %name.configlog
make all

%install

export NO_BRP_CHECK_BYTECODE_VERSION=true

rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# If needed, change open source daemon user name to sipxchange.
# The open source names that have been used are 'sipx' and 'sipxpbx'.
for openname in sipx sipxpbx; do
  if [ "sipxchange" != "${openname}" ] &&
     ! id -u "sipxchange" > /dev/null 2>&1 &&
     id -u ${openname} > /dev/null 2>&1
  then
     /usr/sbin/usermod -l sipxchange ${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.
%if %{_vendor} == suse
%else
/usr/sbin/groupadd -f sipxchange
%endif
if ! id -u sipxchange > /dev/null 2>&1 ; then
   /usr/sbin/useradd \
       -c "sipX service daemon" \
       -d %{_sysconfdir}/sipxpbx \
       -s /bin/bash \
       -g sipxchange \
       sipxchange > /dev/null 2>&1
fi

%post

%files
%defattr(644,root,root,755)
%dir %attr(755,sipxchange,sipxchange) %{_datadir}/java/sipXecs
%attr(755,sipxchange,sipxchange) %{_datadir}/java/sipXecs/sipXcommons

%changelog

openSUSE Build Service is sponsored by