You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

158 lines
5.5 KiB

##
## spread.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: spread
Summary: Group Communication Toolkit
URL: http://www.spread.org/
Vendor: Spread Concepts LLC & CNDS
Packager: The OpenPKG Project
Distribution: OpenPKG [PLUS]
Group: Network
License: BSD-style
Version: 3.17.1
Release: 20030916
# package options
%option with_perl no
# list of sources
Source0: http://www.cnds.jhu.edu/download/download_spread.cgi::/spread-src-%{version}.tar.gz
Source1: rc.spread
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20020206, perl, gcc, flex, bison, sed
PreReq: OpenPKG, openpkg >= 20020206
AutoReq: no
AutoReqProv: no
%description
Spread is a group communication system that provides a number of
messaging services to applications. These services can then be used
by applications to make it easy to write full-featured reliable
groupware, distributed servers, client-server applications, chat and
news services, and many other networked enabled tools.
%prep
%setup -q -n spread-src-%{version}
%{l_shtool} subst \
-e "s;.*\(DaemonUser\).*;\1 = %{l_rusr};" \
-e "s;.*\(DaemonGroup\).*;\1 = %{l_mgrp};" \
-e "s;.*\(RuntimeDir\).*;\1 = %{l_prefix}/var/spread;" \
-e "s;^[ \t]*localhost[ \t]*127.0.0.1;\t`%{l_shtool} echo -e %h%d`;" \
sample.spread.conf
%{l_shtool} subst \
-e "s;/etc\(/spread.access_ip\);%{l_prefix}/etc/spread\1;g" \
auth-ip.c
%build
%{l_shtool} subst -e "s;if test ! -d \$piddir;if false;" configure
%{l_shtool} subst \
-e "s;/usr/bin/perl;%{l_prefix}/bin/perl;g" \
buildtools/fixpaths \
buildtools/mdoc2man.pl
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
PERL="%{l_prefix}/bin/perl" \
./configure \
--prefix=%{l_prefix} \
--sysconfdir=%{l_prefix}/etc/spread \
--with-pid-dir=%{l_prefix}/var/spread \
--with-mantype=man \
--disable-shared
%{l_make} %{l_mflags -O}
%install
rm -rf $RPM_BUILD_ROOT
%if "%{with_perl}" == "yes"
( cd perl/Spread
%{l_prefix}/bin/perl-openpkg prolog
%{l_prefix}/bin/perl-openpkg install
%{l_prefix}/bin/perl-openpkg epilog
) || exit $?
%endif
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/spread
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.so* >/dev/null 2>&1 || true
# install the IP address acl
%{l_shtool} install -c -m 644 \
sample.spread.access_ip \
$RPM_BUILD_ROOT%{l_prefix}/etc/spread/spread.access_ip
# install the run command file
%{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.spread} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
%if "%{with_perl}" == "yes"
eval `%{l_prefix}/bin/perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
"%config %attr(644) %{l_prefix}/etc/spread/*" \
"%not %dir %{l_prefix}/lib/perl" \
"%not %dir %{l_prefix}/lib/perl/*" \
"%not %dir $installarchlib" \
"%not %dir $installprivlib" \
"%not %dir $installsitearch" \
"%not %dir $installsitelib" \
"%not %dir $installarchlib/auto" \
"%not %dir $installprivlib/auto" \
"%not %dir $installsitearch/auto" \
"%not %dir $installsitelib/auto"
%else
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%endif
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT
%pre
# before upgrade, save status and stop service
[ $1 -eq 2 ] || exit 0
eval `%{l_rc} spread status 2>/dev/null | tee %{l_tmpfile}`
%{l_rc} spread stop 2>/dev/null
exit 0
%post
if [ $1 -eq 2 ]; then
# after upgrade, restore status
eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
[ ".$spread_active" = .yes ] && %{l_rc} spread start
fi
exit 0
%preun
# before erase, stop service and remove log files
[ $1 -eq 0 ] || exit 0
%{l_rc} spread stop 2>/dev/null
rm -f $RPM_INSTALL_PREFIX/var/cvsd/*.log* >/dev/null 2>&1 || true
exit 0