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.
 
 
 
 
 
 

165 lines
5.5 KiB

##
## bs.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 2000-2005 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 version
%define V_major 0.99
%define V_patch b2
# package information
Name: bs
Summary: Big Sister
URL: http://bigsister.graeff.com/
Vendor: Thomas Aeby
Packager: The OpenPKG Project
Distribution: OpenPKG
Class: JUNK
Group: Network
License: GNU
Version: %{V_major}%{V_patch}
Release: 20040403
# list of sources
Source0: http://osdn.dl.sourceforge.net/sourceforge/bigsister/big-sister-%{version}.tar.gz
Source1: rc.bs
Source2: bsapache.conf
Source3: bsapachectl
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, perl
PreReq: OpenPKG, openpkg >= 20040130, perl, apache
AutoReq: no
AutoReqProv: no
%description
Big Sister is a clone of Sean MacGuire's Big Brother. Its primary
functions are: monitor networked systems; provide a simple view
of the current network status; generate alarms on status changes;
generate a history of status changes; interoperate with other Big
Sister instances or foreign network monitors.
%track
prog bs = {
version = %{version}
url = http://prdownloads.sourceforge.net/bigsister/
regex = big-sister-(__VER__)\.tar\.gz
}
%prep
%setup -q
%build
%install
rm -rf $RPM_BUILD_ROOT
# patch sources
%{l_shtool} subst \
-e '33s# *-I\([^ |]*\)#\\nuse lib q{\1};#g' \
Makefile
%{l_shtool} subst \
-e 's;chmod;true;' \
-e 's;chown;true;' \
install.sh
%{l_shtool} subst \
-e 's;main::root/adm/;main::root/var/;' \
common.pm
# create installation hierarchie
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/share/bs/cgi \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
$RPM_BUILD_ROOT%{l_prefix}/var/bs \
$RPM_BUILD_ROOT%{l_prefix}/libexec/bs/www/skins
# install skins manually
(cd skins && %{l_tar} cf - *) |\
(cd $RPM_BUILD_ROOT%{l_prefix}/libexec/bs/www/skins && %{l_tar} xf -) || exit $?
find $RPM_BUILD_ROOT%{l_prefix}/libexec/bs/www/skins -type d -exec chmod 755 {} \;
find $RPM_BUILD_ROOT%{l_prefix}/libexec/bs/www/skins -type f -exec chmod 644 {} \;
# perform standard installation procedure
./configure \
--prefix=%{l_prefix}/libexec/bs
%{l_make} %{l_mflags} install \
DESTDIR=$RPM_BUILD_ROOT \
PERL=%{l_prefix}/bin/perl \
CGIPATH=/bs-cgi \
WEBROOT=%{l_prefix}/share/bs \
EXEC=%{l_prefix}/libexec/bs \
USER=%{l_rusr}
# move var to var
rmdir $RPM_BUILD_ROOT%{l_prefix}/libexec/bs/var || true
ln -s %{l_prefix}/var/bs $RPM_BUILD_ROOT%{l_prefix}/libexec/bs/var
# we are not on win32, so remove eventlog
rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/bs/uxmon/Config/eventlog
rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/bs/uxmon/Config/logfile
# install rc file
%{l_shtool} install -c -m 755 %{l_value -s -a} \
-e 's;@l_bsdir@;%{l_prefix}/libexec/bs;g' \
%{SOURCE rc.bs} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
# install apachectl wrapper
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/libexec/bs/tools
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE bsapachectl} \
$RPM_BUILD_ROOT%{l_prefix}/libexec/bs/tools/
# install apache config
l_hostname=`%{l_shtool} echo -e %h`
l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
%{l_shtool} install -c -m 755 %{l_value -s -a} \
-e 's;@l_hostname@;${l_hostname};g' \
-e 's;@l_domainame@;${l_domainname};g' \
%{SOURCE bsapache.conf} \
$RPM_BUILD_ROOT%{l_prefix}/libexec/bs/etc/
# install apache data
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/var/bs/run
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/var/bs/log
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
'%attr(0755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bs'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT
%preun
if [ $1 -eq 0 ]; then
$RPM_INSTALL_PREFIX/etc/rc bs stop
rm -f $RPM_INSTALL_PREFIX/var/bs/log/*
rm -f $RPM_INSTALL_PREFIX/var/bs/run/*
fi