LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File sipx-openfire.spec.old of Package sipx-openfire (Project home:sipfoundry:test)

Summary: Openfire XMPP Server
Name: sipx-openfire
Version: 3.6.4
Release: 2
BuildRoot: %{_builddir}/%{name}-root
Source0: sipx-openfire-%version.tar.gz
Group: Applications/Communications
Vendor: Jive Software
Packager: SIPfoundry (http://www.sipfoundry.org)
License: GPL
AutoReqProv: no
URL: http://www.igniterealtime.org/

%if %{_vendor} == redhat
BuildRequires: shadow-utils
%endif
%if %{_vendor} == suse
BuildRequires: pwdutils
%endif
BuildRequires: unzip
BuildRequires: java-devel >= 1.6

# unpack200 used during install comes with java-devel package
Requires: java-devel >= 1.6

Obsoletes: openfire

%define prefix /opt
%define homedir %{prefix}/%{name}

%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.

Openfire is a leading Open Source, cross-platform IM server based on the
XMPP (Jabber) protocol. It has great performance, is easy to setup and use,
and delivers an innovative feature set.

Requires: java >= 1.6
Requires: /usr/sbin/update-alternatives

Obsoletes: openfire

%prep
%setup -qcn %name-%version

%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p -m 755 $RPM_BUILD_ROOT%{prefix}
tar -xzf openfire_3_6_4.tar.gz -C $RPM_BUILD_ROOT%{prefix}
mv $RPM_BUILD_ROOT%{prefix}/openfire $RPM_BUILD_ROOT%{homedir}

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# 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
# Unpack any packed jar files.
for packed_jar in /opt/%{name}/lib/*.jar.pack; do \
	jar=${packed_jar%.pack}; \
	unpack200 -r $packed_jar $jar; \
	chown sipxchange:sipxchange $jar; \
done;

%files
%attr(775,sipxchange,sipxchange) %dir %{homedir}
%attr(-,sipxchange,sipxchange) %{homedir}/*
%dir %attr(755,sipxchange,sipxchange) %{homedir}/.install4j
%attr(-,sipxchange,sipxchange) %{homedir}/.install4j/*