File sipxcommons.spec of Package sipxcommons

Name:    sipxcommons
Version: 4.2.1
Release: %{buildno}

Summary:  Common server side Java packages and third-party JAR's for sipXecs IP PBX from SIPfoundry
License:  LGPL
Group:    Productivity/Telephony/SIP/Servers
Vendor:   SIPfoundry
Packager: SIPfoundry <sipx-dev@list.sipfoundry.org>
Url:      http://www.sipfoundry.org

BuildRequires: ant-commons-logging
BuildRequires: ant-junit
BuildRequires: ant-nodeps
BuildRequires: automake
BuildRequires: java-devel >= 1.6
%if %{_vendor} == redhat
BuildRequires: shadow-utils
%endif
%if %{_vendor} == suse
BuildRequires: pwdutils
%endif
BuildRequires: zip
BuildRequires: asciidoc

%if %{_vendor} == redhat
BuildRequires: docbook-style-xsl
%endif

%if %{_vendor} == suse
BuildRequires: docbook-xsl-stylesheets
%endif

Source: %name-%version.tar.gz
Source1:  %{name}-%{version}-rpmlintrc

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

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

%if %{_vendor} == suse
%ifarch ppc ppc64
Requires: openssl >= 0.9.8k
%else
Requires: openssl >= 0.9.8
%endif
%endif

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

%description
This package is part of the sipXecs Enterprise Unified Communications Solution (IP PBX) from SIPfoundry
(http://www.sipfoundry.org). Install the toplevel RPM called 'sipxecs' to install the entire system.
After installation run the script 'sipxecs-setup' to initialize.

sipXcommons includes common server side Java packages and supporting third-parth JAR's for sipXecs.

%prep
%setup -q

%build
%configure  --with-distdir=/home/sipxbuild/src/main/RPMBUILD/../dist
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.
/usr/sbin/groupadd -f sipxchange || :
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
openSUSE Build Service is sponsored by