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.
 
 
 
 
 
 

142 lines
5.3 KiB

##
## ripe-dbase.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.
##
# FIXME: rse: run-command script must be debugged
# FIXME: rse: mysql database initialization must be debugged
# FIXME: rse: whois database data initial loading from RIPE NCC ftp service snapshots?
# FIXME: rse: whois database data periodic updating from RIPE NCC
# package information
Name: ripe-dbase
Summary: RIPE NCC Whois Server
URL: http://www.ripe.net/ripencc/pub-services/db/
Vendor: RIPE NCC
Packager: The OpenPKG Project
Distribution: OpenPKG [JUNK]
Group: Database
License: RIPE NCC
Version: 3.2.0
Release: 20031205
# list of sources
Source0: ftp://ftp.ripe.net/ripe/dbase/software/ripe-dbase-%{version}.tar.gz
Source1: ripe-dbase-setup.sh
Source2: rc.ripe-dbase
Patch0: ripe-dbase.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20030103, make, gcc
PreReq: OpenPKG, openpkg >= 20030103
BuildPreReq: gnupg, glib, glib::with_threads = yes, mysql
BuildPreReq: libxml, libxslt, imap, zlib, openssl
PreReq: gnupg, glib, glib::with_threads = yes, mysql
PreReq: libxml, libxslt, imap, zlib, openssl
AutoReq: no
AutoReqProv: no
%description
RIPE-dbase is the official RIPE NCC's Whois Database Server software.
The RIPE Whois Database contains information about IP address space
allocations and assignments, routing policies, and reverse delegations
in the RIPE NCC Service region.
%prep
%setup -q
%patch -p0
%build
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
LIBS="-lssl -lcrypto" \
./configure \
--prefix=%{l_prefix} \
--with-glibconfig=%{l_prefix}/bin/glib-config \
--with-mysql=%{l_prefix} \
--with-mysqlinc=%{l_prefix}/include/mysql \
--with-mysqllib=%{l_prefix}/lib/mysql \
--with-mysqlbin=%{l_prefix}/bin \
--with-xsltconfig=%{l_prefix}/bin/xslt-config \
--with-xmlconfig=%{l_prefix}/bin/xml2-config \
--with-cclientinc=%{l_prefix}/include/imap \
--with-cclientlib=%{l_prefix}/lib \
--with-gpgcmd=%{l_prefix}/bin/gpg
%{l_make} %{l_mflags}
%install
rm -rf $RPM_BUILD_ROOT
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/sbin \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
%{l_shtool} subst \
-e "s;^\\([^=]* *= *\\)%{l_prefix};\\1$RPM_BUILD_ROOT%{l_prefix};" \
Makefile
%{l_shtool} subst \
-e 's;^\(err_log=.*/\)bin\(/.*\);\1var/ripe-dbase/log\2;' \
utils/whoisd_start
%{l_make} %{l_mflags} install INSTALL="%{l_shtool} install -c"
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE rc.ripe-dbase} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE ripe-dbase-setup.sh} \
$RPM_BUILD_ROOT%{l_prefix}/sbin/ripe-dbase-setup
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ $1 -eq 1 ]; then
# display final hints on initial installation
( echo "1. To complete this installation of the RIPE Whois server,"
echo " please start MySQL and initialize the database like this:"
echo " \$ $RPM_INSTALL_PREFIX/etc/rc mysql start"
echo " \$ $RPM_INSTALL_PREFIX/sbin/ripe-dbase-setup"
echo ""
echo "2. After initializing the database, start the server by running"
echo " \$ $RPM_INSTALL_PREFIX/etc/rc ripe-dbase start"
) | %{l_rpmtool} msg -b -t notice
fi
if [ $1 -eq 2 ]; then
# after upgrade, restart service
eval `%{l_rc} ripe-dbase status 2>/dev/null`
[ ".$ripe-dbase_active" = .yes ] && %{l_rc} ripe-dbase restart
fi
exit 0
%preun
if [ $1 -eq 0 ]; then
# before erase, stop service and remove log files
%{l_rc} ripe-dbase stop 2>/dev/null
rm -f $RPM_INSTALL_PREFIX/var/ripe-dbase/log/* >/dev/null 2>&1 || true
fi
exit 0