14 changed files with 0 additions and 5489 deletions
@ -1,25 +0,0 @@
|
||||
## |
||||
## asused.conf |
||||
## |
||||
|
||||
# |
||||
# Registry ID |
||||
# (see http://www.ripe.net/membership/indices/) |
||||
# |
||||
|
||||
# Cable & Wireless Germany |
||||
REGID = de.ecrc |
||||
|
||||
# |
||||
# Address Allocations |
||||
# (see ftp://ftp.ripe.net/pub/stats/ripencc/membership/alloclist.txt) |
||||
# |
||||
|
||||
# Cable & Wireless Germany |
||||
ALLOC = 62.208/16 |
||||
ALLOC = 194.112.64/20 |
||||
ALLOC = 194.112.80/20 |
||||
ALLOC = 194.112.96/19 |
||||
ALLOC = 194.221/16 |
||||
ALLOC = 195.27/16 |
||||
|
||||
@ -1,120 +0,0 @@
|
||||
## |
||||
## ripe-asused.spec -- OpenPKG RPM Package Specification |
||||
## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
||||
## |
||||
## 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. |
||||
## |
||||
|
||||
# versions of individual parts |
||||
%define V_perl 5.8.3 |
||||
%define V_asused 3.72 |
||||
%define V_netwhois 2.0001 |
||||
|
||||
# package information |
||||
Name: ripe-asused |
||||
Summary: RIPE NCC Autonomous Systems Query |
||||
URL: http://www.ripe.net/ripencc/pub-services/db/ |
||||
Vendor: RIPE NCC |
||||
Packager: OpenPKG Foundation e.V. |
||||
Distribution: OpenPKG Community |
||||
Class: PLUS |
||||
Group: Mapping |
||||
License: RIPE NCC |
||||
Version: %{V_asused} |
||||
Release: 20120424 |
||||
|
||||
# list of sources |
||||
Source0: ftp://ftp.ripe.net/tools/asused-%{V_asused}.tar.gz |
||||
Source1: http://www.cpan.org/modules/by-module/Net/Net-Whois-RIPE-%{V_netwhois}.tar.gz |
||||
Source2: asused.conf |
||||
|
||||
# build information |
||||
BuildPreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126 |
||||
PreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl} |
||||
|
||||
%description |
||||
Asused is a perl based toolset for ISP IP administrators to check |
||||
various aspects of IP allocations and assigments of Autonomous |
||||
Systems (AS) as stored in the RIPE NCC database. |
||||
|
||||
Perl modules for use with RIPE and WHOIS servers: |
||||
- RipeWhois::FormatMode (1.03) |
||||
- RipeWhois::RipeWhois (1.03) |
||||
- Whois::Whois (1.04) |
||||
|
||||
%track |
||||
prog ripe-asused:asused = { |
||||
version = %{V_asused} |
||||
url = ftp://ftp.ripe.net/tools/ |
||||
regex = asused-(__VER__)\.tar\.gz |
||||
} |
||||
prog ripe-asused:netwhois = { |
||||
version = %{V_netwhois} |
||||
url = http://www.cpan.org/modules/by-module/Net/ |
||||
regex = Net-Whois-RIPE-(__VER__)\.tar\.gz |
||||
} |
||||
|
||||
%prep |
||||
%setup -q -c |
||||
%setup -q -T -D -a 0 |
||||
%setup -q -T -D -a 1 |
||||
|
||||
%build |
||||
|
||||
%install |
||||
|
||||
# routine perl module handling |
||||
%{l_prefix}/bin/perl-openpkg prepare |
||||
%{l_prefix}/bin/perl-openpkg -d %{SOURCE0} configure build install |
||||
%{l_prefix}/bin/perl-openpkg -d %{SOURCE1} configure build install |
||||
|
||||
# install manual page |
||||
eval `%{l_prefix}/bin/perl -V:installarchlib -V:installprivlib -V:installvendorarch -V:installvendorlib` |
||||
%{l_prefix}/bin/pod2man $RPM_BUILD_ROOT$installvendorlib/asused.pod >asused.1 |
||||
rm -f $RPM_BUILD_ROOT$installvendorlib/asused.pod |
||||
%{l_shtool} mkdir -f -p -m 755 \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/man/man1 |
||||
%{l_shtool} install -c -m 644 \ |
||||
asused.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ |
||||
|
||||
# post-adjust installation files |
||||
%{l_shtool} subst \ |
||||
-e "s;-Iblib/lib;;" \ |
||||
-e "s;'asused.conf';'%{l_prefix}/etc/ripe-asused/asused.conf';" \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/bin/asused |
||||
|
||||
# install default configuration |
||||
%{l_shtool} mkdir -f -p -m 755 \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/ripe-asused |
||||
%{l_shtool} install -c -m 644 \ |
||||
%{SOURCE asused.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/ripe-asused/ |
||||
|
||||
# post-processing of installation tree |
||||
rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3 |
||||
%{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup |
||||
|
||||
# determine installation files |
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
||||
%{l_files_std} `cat perl-openpkg-files` \ |
||||
'%config %{l_prefix}/etc/ripe-asused/*' |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
|
||||
@ -1,41 +0,0 @@
|
||||
#!@l_prefix@/bin/openpkg rc |
||||
## |
||||
## rc.ripe-dbase -- Run-Commands |
||||
## |
||||
|
||||
%config |
||||
ripe_dbase_enable="$openpkg_rc_def" |
||||
ripe_dbase_cfgfile="@l_prefix@/etc/ripe-dbase/rip.config.sample" |
||||
|
||||
%common |
||||
ripe_dbase_pidfile="@l_prefix@/var/ripe-dbase/whois_rip.pid" |
||||
ripe_dbase_signal () { |
||||
[ -f $ripe_dbase_pidfile ] && kill -$1 `cat $ripe_dbase_pidfile` |
||||
} |
||||
|
||||
%status -u @l_susr@ -o |
||||
ripe_dbase_usable="unknown" |
||||
ripe_dbase_active="no" |
||||
rcService ripe-dbase enable yes && \ |
||||
ripe_dbase_signal 0 && ripe_dbase_active="yes" |
||||
echo "ripe_dbase_enable=\"$ripe_dbase_enable\"" |
||||
echo "ripe_dbase_usable=\"$ripe_dbase_usable\"" |
||||
echo "ripe_dbase_active=\"$ripe_dbase_active\"" |
||||
|
||||
%start -u @l_susr@ |
||||
rcService ripe-dbase enable yes || exit 0 |
||||
rcService ripe-dbase active yes && exit 0 |
||||
nohup @l_prefix@/bin/whois_rip -p ${ripe_dbase_pidfile} \ |
||||
-c ${ripe_dbase_cfgfile} & |
||||
|
||||
%stop -u @l_susr@ |
||||
rcService ripe-dbase enable yes || exit 0 |
||||
rcService ripe-dbase active no && exit 0 |
||||
ripe_dbase_signal TERM |
||||
sleep 8 |
||||
|
||||
%restart -u @l_susr@ |
||||
rcService ripe-dbase enable yes || exit 0 |
||||
rcService ripe-dbase active no && exit 0 |
||||
rc ripe-dbase stop start |
||||
|
||||
@ -1,51 +0,0 @@
|
||||
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc |
||||
## |
||||
## rc.ripe-dbase -- Run-Commands |
||||
## |
||||
|
||||
%config |
||||
ripe_dbase_enable="$openpkg_rc_def" |
||||
ripe_dbase_cfgfile="@l_prefix@/etc/ripe-dbase/rip.config.sample" |
||||
|
||||
%common |
||||
ripe_dbase_pidfile="@l_prefix@/var/ripe-dbase/whois_rip.pid" |
||||
ripe_dbase_signal () { |
||||
[ -f $ripe_dbase_pidfile ] && kill -$1 `cat $ripe_dbase_pidfile` |
||||
} |
||||
|
||||
%status -u @l_susr@ -o |
||||
ripe_dbase_usable="unknown" |
||||
ripe_dbase_active="no" |
||||
rcService ripe-dbase enable yes && \ |
||||
ripe_dbase_signal 0 && ripe_dbase_active="yes" |
||||
echo "ripe_dbase_enable=\"$ripe_dbase_enable\"" |
||||
echo "ripe_dbase_usable=\"$ripe_dbase_usable\"" |
||||
echo "ripe_dbase_active=\"$ripe_dbase_active\"" |
||||
|
||||
%start -u @l_susr@ |
||||
# main server |
||||
rcService ripe-dbase enable yes || exit 0 |
||||
rcService ripe-dbase active yes && exit 0 |
||||
nohup @l_prefix@/bin/whois_rip -p ${ripe_dbase_pidfile} \ |
||||
-c ${ripe_dbase_cfgfile} & |
||||
# filter server |
||||
rcService ripe-filter enable yes || exit 0 |
||||
rcService ripe-filter active yes && exit 0 |
||||
rc ripe-filter start |
||||
|
||||
%stop -u @l_susr@ |
||||
# main server |
||||
rcService ripe-dbase enable yes || exit 0 |
||||
rcService ripe-dbase active no && exit 0 |
||||
ripe_dbase_signal TERM |
||||
sleep 6 |
||||
# filter server |
||||
rcService ripe-filter enable yes || exit 0 |
||||
rcService ripe-filter active no && exit 0 |
||||
rc ripe-filter stop |
||||
|
||||
%restart -u @l_susr@ |
||||
rcService ripe-dbase enable yes || exit 0 |
||||
rcService ripe-dbase active no && exit 0 |
||||
rc ripe-dbase stop start |
||||
|
||||
@ -1,72 +0,0 @@
|
||||
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc |
||||
## |
||||
## rc.ripe-filter -- Run-Commands |
||||
## |
||||
|
||||
%config |
||||
ripe_filter_enable="$openpkg_rc_def" |
||||
ripe_filter_out_prolog="true" |
||||
ripe_filter_out_epilog="true" |
||||
ripe_filter_out_numfiles="10" |
||||
ripe_filter_out_minsize="1M" |
||||
ripe_filter_out_complevel="9" |
||||
ripe_filter_err_prolog="true" |
||||
ripe_filter_err_epilog="true" |
||||
ripe_filter_err_numfiles="10" |
||||
ripe_filter_err_minsize="1M" |
||||
ripe_filter_err_complevel="9" |
||||
|
||||
%common |
||||
ripe_filter_pidfile="@l_prefix@/var/ripe-dbase/whois_filt.pid" |
||||
ripe_filter_signal () { |
||||
[ -f $ripe_filter_pidfile ] && kill -$1 `cat $ripe_filter_pidfile` |
||||
} |
||||
|
||||
%status -u @l_susr@ -o |
||||
ripe_filter_usable="unknown" |
||||
ripe_filter_active="no" |
||||
rcService ripe-filter enable yes && \ |
||||
ripe_filter_signal 0 && ripe_filter_active="yes" |
||||
echo "ripe_filter_enable=\"$ripe_filter_enable\"" |
||||
echo "ripe_filter_usable=\"$ripe_filter_usable\"" |
||||
echo "ripe_filter_active=\"$ripe_filter_active\"" |
||||
|
||||
%start -u @l_susr@ |
||||
rcService ripe-filter enable yes || exit 0 |
||||
rcService ripe-filter active yes && exit 0 |
||||
@l_prefix@/bin/whois_filt \ |
||||
1>>@l_prefix@/var/ripe-dbase/log/filtout.log \ |
||||
2>>@l_prefix@/var/ripe-dbase/log/filterr.log & |
||||
|
||||
%stop -u @l_susr@ |
||||
rcService ripe-filter enable yes || exit 0 |
||||
rcService ripe-filter active no && exit 0 |
||||
ripe_filter_signal TERM |
||||
rm -f ${ripe_filter_pidfile} |
||||
sleep 2 |
||||
|
||||
%restart -u @l_susr@ |
||||
rcService ripe-filter enable yes || exit 0 |
||||
rcService ripe-filter active no && exit 0 |
||||
rc ripe-filter stop start |
||||
|
||||
%daily -u @l_susr@ |
||||
rcService ripe-filter enable yes || exit 0 |
||||
|
||||
%daily -u @l_susr@ |
||||
rcService ripe-filter enable yes || exit 0 |
||||
|
||||
# rotate logfiles |
||||
shtool rotate -f \ |
||||
-n ${ripe_filter_out_numfiles} -s ${ripe_filter_out_minsize} -d \ |
||||
-z ${ripe_filter_out_complevel} -m 644 -o @l_susr@ -g @l_sgrp@ \ |
||||
-P "${ripe_filter_out_prolog}" \ |
||||
-E "${ripe_filter_out_epilog}; rc ripe_dbase restart" \ |
||||
@l_prefix@/var/ripe-dbase/log/filtout.log |
||||
shtool rotate -f \ |
||||
-n ${ripe_filter_err_numfiles} -s ${ripe_filter_err_minsize} -d \ |
||||
-z ${ripe_filter_err_complevel} -m 644 -o @l_susr@ -g @l_sgrp@ \ |
||||
-P "${ripe_filter_err_prolog}" \ |
||||
-E "${ripe_filter_err_epilog}; rc ripe_dbase restart" \ |
||||
@l_prefix@/var/ripe-dbase/log/filterr.log |
||||
|
||||
@ -1,85 +0,0 @@
|
||||
#!/bin/sh |
||||
## |
||||
## ripedb-setup |
||||
## |
||||
|
||||
# determine MySQL root password |
||||
password=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\ |
||||
sed -e 's;^password[^=]*= *;;' -e 's; *$;;'` |
||||
|
||||
@l_prefix@/bin/mysql --user=root --password=$password RIPEDB <<EOF |
||||
CREATE TABLE reg_id ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
reg_id varchar(30) NOT NULL, |
||||
reg_window varchar(3) NOT NULL, |
||||
PRIMARY KEY (object_id) |
||||
); |
||||
CREATE TABLE reg_ref ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
reg_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
object_type tinyint(3) unsigned DEFAULT '0' NOT NULL, |
||||
PRIMARY KEY (object_id,reg_id) |
||||
); |
||||
CREATE TABLE as_ref ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
as_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
object_type tinyint(3) unsigned DEFAULT '0' NOT NULL, |
||||
PRIMARY KEY (object_id,as_id) |
||||
); |
||||
CREATE TABLE pop ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
pop varchar(80) NOT NULL, |
||||
remedyref varchar(80) NOT NULL, |
||||
PRIMARY KEY (object_id) |
||||
); |
||||
CREATE TABLE pop_ref ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
pop_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
object_type tinyint(3) unsigned DEFAULT '0' NOT NULL, |
||||
PRIMARY KEY (object_id,pop_id) |
||||
); |
||||
CREATE TABLE ticket ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
ticket varchar(80) NOT NULL, |
||||
netname varchar(80) NOT NULL, |
||||
PRIMARY KEY (object_id) |
||||
); |
||||
CREATE TABLE purpose ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
purpose varchar(80) NOT NULL, |
||||
remedyref varchar(80) NOT NULL, |
||||
PRIMARY KEY (object_id) |
||||
); |
||||
CREATE TABLE purp_ref ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
purp_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
object_type tinyint(3) unsigned DEFAULT '0' NOT NULL, |
||||
PRIMARY KEY (object_id,purp_id) |
||||
); |
||||
CREATE TABLE range ( |
||||
thread_id int(11) DEFAULT '0' NOT NULL, |
||||
object_id int(10) unsigned DEFAULT '0' NOT NULL, |
||||
begin_in int(10) unsigned DEFAULT '0' NOT NULL, |
||||
end_in int(10) unsigned DEFAULT '0' NOT NULL, |
||||
netname varchar(80) NOT NULL default '', |
||||
PRIMARY KEY (object_id) |
||||
); |
||||
alter table range add index (netname(8)); |
||||
alter table range add index begin_in (begin_in); |
||||
alter table range add index end_in (end_in); |
||||
alter table range add index (thread_id); |
||||
INSERT INTO object_order VALUES (18,24); |
||||
INSERT INTO object_order VALUES (19,25); |
||||
INSERT INTO object_order VALUES (20,26); |
||||
INSERT INTO object_order VALUES (21,27); |
||||
INSERT INTO object_order VALUES (22,28); |
||||
EOF |
||||
|
||||
@ -1,28 +0,0 @@
|
||||
#!/bin/sh |
||||
## |
||||
## ripedb-setup |
||||
## |
||||
|
||||
# determine MySQL administrator username/password |
||||
username=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\ |
||||
sed -e 's;^user[^=]*= *;;' -e 's; *$;;'` |
||||
password=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\ |
||||
sed -e 's;^password[^=]*= *;;' -e 's; *$;;'` |
||||
|
||||
# create a MySQL username/password for RIPEDB and RIPADMIN |
||||
@l_prefix@/bin/mysql --user=$username --password=$password mysql <<EOF |
||||
GRANT ALL ON RIPEDB.* TO ripe@localhost IDENTIFIED BY 'RIPEDB'; |
||||
GRANT ALL ON RIPADMIN.* TO ripe@localhost IDENTIFIED BY 'RIPADMIN'; |
||||
FLUSH PRIVILEGES; |
||||
EOF |
||||
|
||||
# create the default RIPEDB database schema |
||||
@l_prefix@/bin/mysqladmin --user=$username --password=$password create RIPEDB |
||||
@l_prefix@/bin/mysql --user=$username --password=$password RIPEDB <@l_prefix@/libexec/ripe-dbase/SQL/create.tables.sql |
||||
@l_prefix@/bin/mysql --user=$username --password=$password RIPEDB <@l_prefix@/libexec/ripe-dbase/SQL/main.index.1 |
||||
@l_prefix@/bin/mysql --user=$username --password=$password RIPEDB <@l_prefix@/libexec/ripe-dbase/SQL/aux.index.2 |
||||
@l_prefix@/bin/mysql --user=$username --password=$password RIPEDB <@l_prefix@/libexec/ripe-dbase/SQL/leaf.index.2 |
||||
|
||||
# create the default RIPADMIN database schema |
||||
@l_prefix@/bin/mysql --user=$username --password=$password <@l_prefix@/libexec/ripe-dbase/SQL/create.RIPADMIN.sql |
||||
|
||||
@ -1,179 +0,0 @@
|
||||
Index: modules/sk/sk_socket.c
|
||||
diff -Nau modules/sk/sk_socket.c.orig modules/sk/sk_socket.c
|
||||
--- modules/sk/sk_socket.c.orig Thu Jul 3 09:55:41 2003
|
||||
+++ modules/sk/sk_socket.c Tue Dec 9 15:51:05 2003
|
||||
@@ -65,7 +65,9 @@
|
||||
|
||||
#ifdef __linux__
|
||||
if(getservbyname_r(service, proto, &result, buffer, sizeof(buffer), &serv) < 0) serv = NULL;
|
||||
-#else
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ serv = getservbyname(service, proto);
|
||||
+#else
|
||||
serv = getservbyname_r(service, proto, &result, buffer, sizeof(buffer));
|
||||
#endif
|
||||
|
||||
@@ -261,6 +263,9 @@
|
||||
#ifdef __linux__
|
||||
er = (gethostbyname_r(hostname, &result, aliasbuf,
|
||||
sizeof(aliasbuf), &hp, &error) < 0 );
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ hp = gethostbyname(hostname);
|
||||
+ er = ( hp == NULL );
|
||||
#else /* default is Solaris implementation */
|
||||
hp = gethostbyname_r(hostname, &result, aliasbuf,
|
||||
sizeof(aliasbuf), &error);
|
||||
Index: modules/ud/ud_main.c
|
||||
diff -Nau modules/ud/ud_main.c.orig modules/ud/ud_main.c
|
||||
--- modules/ud/ud_main.c.orig Thu Jul 3 09:55:49 2003
|
||||
+++ modules/ud/ud_main.c Tue Dec 9 15:51:05 2003
|
||||
@@ -120,6 +120,8 @@
|
||||
}
|
||||
#ifdef __linux__
|
||||
if(gethostbyname_r(nrtm->server, &result, host_info, sizeof(host_info), &hptr, &error)<0) hptr=NULL;
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ hptr=gethostbyname(nrtm->server);
|
||||
#else/* default is Solaris implementation */
|
||||
hptr=gethostbyname_r(nrtm->server, &result, host_info, sizeof(host_info), &error);
|
||||
#endif
|
||||
Index: modules/qi/query_instructions.h
|
||||
diff -Nau modules/qi/query_instructions.h.orig modules/qi/query_instructions.h
|
||||
--- modules/qi/query_instructions.h.orig 2005-01-05 13:34:01 +0100
|
||||
+++ modules/qi/query_instructions.h 2005-01-05 13:34:21 +0100
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
|
||||
|
||||
-#define Q_REC "INSERT INTO %s SELECT pe_ro_id FROM %s IDS STRAIGHT_JOIN %s WHERE object_id = IDS.id"
|
||||
+#define Q_REC "INSERT IGNORE INTO %s SELECT pe_ro_id FROM %s IDS STRAIGHT_JOIN %s WHERE object_id = IDS.id"
|
||||
|
||||
#if 0
|
||||
#define Q_NO_OBJECTS "SELECT object_id, sequence_id, object FROM last WHERE object_id = 0"
|
||||
Index: Makefile.site.in
|
||||
diff -Nau Makefile.site.in.orig Makefile.site.in
|
||||
--- Makefile.site.in.orig Wed Jul 30 10:17:29 2003
|
||||
+++ Makefile.site.in Tue Dec 9 15:51:05 2003
|
||||
@@ -67,5 +67,5 @@
|
||||
|
||||
CFLAGS = @LDFLAGS@ @CFLAGS@ -g $(INCLUDES) $(DEFINES) @XMLCFLAGS@ @XSLTCFLAGS@
|
||||
LFLAGS = @LDFLAGS@ @CFLAGS@ -g -L$(RIPLIBDIR) -L$(MYSQLLIBDIR)
|
||||
-LIBS = `$(GLIBCONF) --libs gthread` -lmysqlclient_r -lm $(ACLIBS) $(CCLIENTLIBDIR)/c-client.a @XMLLIBS@ @XSLTLIBS@
|
||||
+LIBS = `$(GLIBCONF) --libs gthread` -lmysqlclient_r -lm $(ACLIBS) $(CCLIENTLIBDIR)/libimap.a -lssl -lcrypto @XMLLIBS@ @XSLTLIBS@
|
||||
|
||||
Index: configure
|
||||
diff -Nau configure.orig configure
|
||||
--- configure.orig Tue Jul 29 11:45:09 2003
|
||||
+++ configure Tue Dec 9 15:51:05 2003
|
||||
@@ -1311,20 +1311,20 @@
|
||||
|
||||
topdir=$prefix
|
||||
bindir=${topdir}/bin
|
||||
-confdir=${topdir}/conf
|
||||
-scriptdir=${topdir}/scripts
|
||||
-utildir=${topdir}/utils
|
||||
-docdir=${topdir}/doc
|
||||
-vardir=${topdir}/var
|
||||
+confdir=${topdir}/etc/ripe-dbase
|
||||
+scriptdir=${topdir}/libexec/ripe-dbase
|
||||
+utildir=${topdir}/libexec/ripe-dbase
|
||||
+docdir=${topdir}/share/ripe-dbase
|
||||
+vardir=${topdir}/var/ripe-dbase
|
||||
tmpdir=${vardir}/tmp
|
||||
-lockdir=${vardir}/lock
|
||||
+lockdir=${vardir}/run
|
||||
|
||||
-libdir=${topdir}/lib/gnudl
|
||||
+libdir=${topdir}/lib/ripe-dbase
|
||||
mandir=${topdir}/man/man1
|
||||
|
||||
#######
|
||||
# Log infrastructure
|
||||
-logdir=${topdir}/log
|
||||
+logdir=${topdir}/var/ripe-dbase/log
|
||||
qrylog=${logdir}/qry
|
||||
dbuperr=${logdir}/dbuperr
|
||||
allriperr=${logdir}/riperr
|
||||
@@ -1490,9 +1490,9 @@
|
||||
mysqllibdir=$mysql/lib
|
||||
fi;
|
||||
|
||||
-as_ac_File=`echo "ac_cv_file_$mysqllibdir/libmysqlclient_r.so" | $as_tr_sh`
|
||||
-echo "$as_me:$LINENO: checking for $mysqllibdir/libmysqlclient_r.so" >&5
|
||||
-echo $ECHO_N "checking for $mysqllibdir/libmysqlclient_r.so... $ECHO_C" >&6
|
||||
+as_ac_File=`echo "ac_cv_file_$mysqllibdir/libmysqlclient_r.a" | $as_tr_sh`
|
||||
+echo "$as_me:$LINENO: checking for $mysqllibdir/libmysqlclient_r.a" >&5
|
||||
+echo $ECHO_N "checking for $mysqllibdir/libmysqlclient_r.a $ECHO_C" >&6
|
||||
if eval "test \"\${$as_ac_File+set}\" = set"; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
@@ -1500,7 +1500,7 @@
|
||||
{ { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
|
||||
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
-if test -r "$mysqllibdir/libmysqlclient_r.so"; then
|
||||
+if test -r "$mysqllibdir/libmysqlclient_r.a"; then
|
||||
eval "$as_ac_File=yes"
|
||||
else
|
||||
eval "$as_ac_File=no"
|
||||
@@ -1511,7 +1511,7 @@
|
||||
if test `eval echo '${'$as_ac_File'}'` = yes; then
|
||||
:
|
||||
else
|
||||
- echo "MySQL library directory does not contain libmysqlclient_r.so !";
|
||||
+ echo "MySQL library directory does not contain libmysqlclient_r.a !";
|
||||
echo "Please specify a suitable MySQL library directory: --with-mysqllib=DIR"; exit 1
|
||||
fi
|
||||
|
||||
@@ -1705,9 +1705,9 @@
|
||||
fi
|
||||
|
||||
|
||||
-as_ac_File=`echo "ac_cv_file_$cclientlib/c-client.a" | $as_tr_sh`
|
||||
-echo "$as_me:$LINENO: checking for $cclientlib/c-client.a" >&5
|
||||
-echo $ECHO_N "checking for $cclientlib/c-client.a... $ECHO_C" >&6
|
||||
+as_ac_File=`echo "ac_cv_file_$cclientlib/libimap" | $as_tr_sh`
|
||||
+echo "$as_me:$LINENO: checking for $cclientlib/libimap.a" >&5
|
||||
+echo $ECHO_N "checking for $cclientlib/libimap.a... $ECHO_C" >&6
|
||||
if eval "test \"\${$as_ac_File+set}\" = set"; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
@@ -1715,7 +1715,7 @@
|
||||
{ { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
|
||||
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
-if test -r "$cclientlib/c-client.a"; then
|
||||
+if test -r "$cclientlib/libimap.a"; then
|
||||
eval "$as_ac_File=yes"
|
||||
else
|
||||
eval "$as_ac_File=no"
|
||||
@@ -1726,7 +1726,7 @@
|
||||
if test `eval echo '${'$as_ac_File'}'` = yes; then
|
||||
:
|
||||
else
|
||||
- echo "c-client lib directory does not contain c-client.a !";
|
||||
+ echo "c-client lib directory does not contain libimap.a !";
|
||||
echo "Please specify a suitable c-client library directory: --with-cclientlib=DIR"; exit 1
|
||||
fi
|
||||
|
||||
Index: modules/ip/inet_ntop.c
|
||||
--- modules/ip/inet_ntop.c.orig 2005-02-16 20:34:26 +0100
|
||||
+++ modules/ip/inet_ntop.c 2005-02-16 20:34:30 +0100
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
-#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
|
||||
#include <string.h>
|
||||
Index: modules/ip/inet_pton.c
|
||||
--- modules/ip/inet_pton.c.orig 2000-12-27 17:07:07 +0100
|
||||
+++ modules/ip/inet_pton.c 2005-02-16 20:36:54 +0100
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
-#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
|
||||
#include <assert.h>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,244 +0,0 @@
|
||||
## |
||||
## ripe-dbase.spec -- OpenPKG RPM Package Specification |
||||
## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
||||
## |
||||
## 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: ripe-dbase |
||||
Summary: RIPE NCC Whois Server |
||||
URL: http://www.ripe.net/ripencc/pub-services/db/ |
||||
Vendor: RIPE NCC |
||||
Packager: OpenPKG Foundation e.V. |
||||
Distribution: OpenPKG Community |
||||
Class: EVAL |
||||
Group: WHOIS |
||||
License: RIPE NCC |
||||
Version: 3.2.0 |
||||
Release: 20080101 |
||||
|
||||
# package options |
||||
%option with_extobjs no |
||||
|
||||
# list of sources |
||||
Source0: ftp://ftp.ripe.net/ripe/dbase/software/ripe-dbase-%{version}.tar.gz |
||||
Source1: ripe-dbase-setup.sh |
||||
Source2: ripe-dbase-modify.sh |
||||
Source3: rc.ripe-dbase |
||||
Source4: rc.ripe-dbase.extobjs |
||||
Source5: rc.ripe-filter |
||||
Source6: whois_filt.pl |
||||
Source7: whois_filt.config |
||||
Patch0: ripe-dbase.patch |
||||
Patch1: ripe-dbase.patch.extobjs |
||||
|
||||
# build information |
||||
BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc |
||||
PreReq: OpenPKG, openpkg >= 20100101 |
||||
BuildPreReq: gnupg, glib, glib::with_threads = yes, mysql |
||||
PreReq: gnupg, glib, glib::with_threads = yes, mysql |
||||
BuildPreReq: libxml, libxslt, imap, zlib, openssl |
||||
PreReq: libxml, libxslt, imap, zlib, openssl |
||||
%if "%{with_extobjs}" == "yes" |
||||
BuildPreReq: java |
||||
PreReq: ripe-asused, perl-net |
||||
%endif |
||||
|
||||
%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. |
||||
|
||||
%track |
||||
prog ripe-dbase = { |
||||
version = %{version} |
||||
url = ftp://ftp.ripe.net/ripe/dbase/software/ |
||||
regex = ripe-dbase-(__VER__)\.tar\.gz |
||||
} |
||||
|
||||
%prep |
||||
%setup -q |
||||
cp -f defs/variants/RIPE/*.xml defs/ |
||||
cp -f defs/variants/RIPE/*.h defs/ |
||||
cp -f defs/variants/RIPE/Makefile.syntax defs/ |
||||
cp -f defs/variants/RIPE/*.def include/ |
||||
%patch -p0 |
||||
%if "%{with_extobjs}" == "yes" |
||||
%patch -p0 -P 1 |
||||
%endif |
||||
%{l_shtool} subst \ |
||||
-e 's;@topdir@/conf;@confdir@;g' \ |
||||
-e 's;sendmail -fmy-dbm -t;sendmail -t;g' \ |
||||
-e 's;^RIPADMIN sqlhost,3306,dbuser,dbpsw,RIPADMIN;RIPADMIN localhost,3306,root,pwd,RIPADMIN;' \ |
||||
-e 's;^UPDSOURCE SAMPLE sqlhost,3306,dbuser,dbpsw,SAMPLEDB whois.mydb.net,43001,43004;UPDSOURCE RIPE localhost,3306,root,pwd,RIPEDB localhost,43001,43004;' \ |
||||
conf/rip.config.sample.in |
||||
%{l_shtool} subst \ |
||||
-e 's;^\(DATABASE.*\)SAMPLEDB;\1RIPEDB;' \ |
||||
-e 's;^\(SOURCE.*\)SAMPLE;\1RIPE;' \ |
||||
-e 's;^\(database.*\)SAMPLEDB;\1RIPEDB;' \ |
||||
-e 's;^\(host:.*\)sqlhost;\1localhost;' \ |
||||
-e 's;^\(user:.*\)dbuser;\1root;' \ |
||||
-e 's;^\(password:.*\)dbpsw;\1pwd;' \ |
||||
conf/sources.config.sample |
||||
%{l_shtool} subst \ |
||||
-e 's;sample.db.gz;ripe.db.gz;' \ |
||||
bin/load/make_db.in |
||||
%{l_shtool} subst \ |
||||
-e 's;-I/usr/include/openssl;%{l_cppflags openssl .};' \ |
||||
configure |
||||
|
||||
%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 |
||||
%if "%{with_extobjs}" == "yes" |
||||
( cd defs |
||||
%{l_make} %{l_mflags} JAVAC="%{l_prefix}/bin/javac -classpath xalan/xerces.jar:." |
||||
) || exit $? |
||||
%endif |
||||
%{l_make} %{l_mflags} |
||||
|
||||
%install |
||||
%{l_shtool} mkdir -f -p -m 755 \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/sbin \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/var/ripe-dbase/tmp/load/RIPE |
||||
%{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 |
||||
%if "%{with_extobjs}" == "yes" |
||||
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
||||
%{SOURCE ripe-dbase-modify.sh} \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/sbin/ripe-dbase-modify |
||||
l_hostname=`%{l_shtool} echo -e %h%d` |
||||
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
||||
-e "s;@l_hostname@;$l_hostname;g" \ |
||||
%{SOURCE whois_filt.pl} \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/bin/whois_filt |
||||
%{l_shtool} install -c -m 644 %{l_value -s -a} \ |
||||
%{SOURCE whois_filt.config} \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/ripe-dbase/ |
||||
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
||||
%{SOURCE rc.ripe-dbase.extobjs} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.ripe-dbase |
||||
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
||||
%{SOURCE rc.ripe-filter} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
||||
%endif |
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
||||
%{l_files_std} \ |
||||
'%config %{l_prefix}/etc/ripe-dbase/*' \ |
||||
'%config %attr(0775,%{l_musr},%{l_mgrp}) %{l_prefix}/var/ripe-dbase/tmp' \ |
||||
'%config %attr(0775,%{l_musr},%{l_mgrp}) %{l_prefix}/var/ripe-dbase/log/upd' \ |
||||
'%config %attr(0775,%{l_musr},%{l_mgrp}) %{l_prefix}/var/ripe-dbase/log/forw' \ |
||||
'%config %attr(0775,%{l_musr},%{l_mgrp}) %{l_prefix}/var/ripe-dbase/log/ack' |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
|
||||
%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 change all 'pwd' text in the following files:" |
||||
echo " \$ $RPM_INSTALL_PREFIX/etc/ripe-dbase/rip.config.sample" |
||||
echo " \$ $RPM_INSTALL_PREFIX/etc/ripe-dbase/sources.config.sample" |
||||
echo " The text should match the MySQL password stored in:" |
||||
echo " \$ $RPM_INSTALL_PREFIX/etc/mysql/my.pwd" |
||||
echo "" |
||||
echo "2. Now start the MySQL server:" |
||||
echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start" |
||||
echo "" |
||||
echo "Choose to either use the WHOIS server with (3a) no initial data," |
||||
echo "or (3b) the full contents of the current RIPE database snapshot." |
||||
echo "" |
||||
echo "3a. To begin using the WHOIS server with an empty RIPE database, run:" |
||||
echo " \$ $RPM_INSTALL_PREFIX/sbin/ripe-dbase-setup" |
||||
echo "" |
||||
echo "3b. To begin using the WHOIS server with actual RIPE data, do the" |
||||
echo " following. This step may take ten (!) hours due to downloading" |
||||
echo " ripe.db.gz (~60 Mb) and make_db data importing:" |
||||
echo " \$ cd $RPM_INSTALL_PREFIX/var/ripe-dbase/tmp/load/RIPE" |
||||
echo " \$ ftp ftp.ripe.net:ripe/dbase" |
||||
echo " \$ mget RIPE.CURRENTSERIAL ripe.db.gz" |
||||
echo " \$ quit" |
||||
echo " \$ $RPM_INSTALL_PREFIX/libexec/ripe-dbase/make_db \\" |
||||
echo " -c $RPM_INSTALL_PREFIX/etc/ripe-dbase/rip.config.sample \\" |
||||
echo " -s RIPE -1" |
||||
echo "" |
||||
%if "%{with_extobjs}" == "yes" |
||||
echo "4. Modify the native RIPE datastructures to accommodate the" |
||||
echo " extra objects (which you selected by using with_extobjs):" |
||||
echo " \$ $RPM_INSTALL_PREFIX/sbin/ripe-dbase-modify" |
||||
echo "" |
||||
echo "5. Finally start the WHOIS server by running:" |
||||
echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc ripe-dbase start" |
||||
%else |
||||
echo "4. Finally start the WHOIS server by running:" |
||||
echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc ripe-dbase start" |
||||
%endif |
||||
) | %{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 |
||||
%if "%{with_extobjs}" == "yes" |
||||
eval `%{l_rc} ripe-filter status 2>/dev/null` |
||||
[ ".$ripe_filter_active" = .yes ] && %{l_rc} ripe-filter restart |
||||
%endif |
||||
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 |
||||
%if "%{with_extobjs}" == "yes" |
||||
%{l_rc} ripe-filter stop 2>/dev/null |
||||
%endif |
||||
rm -rf $RPM_INSTALL_PREFIX/var/ripe-dbase/log/* >/dev/null 2>&1 || true |
||||
fi |
||||
exit 0 |
||||
|
||||
@ -1,47 +0,0 @@
|
||||
# |
||||
# config.dat |
||||
# |
||||
# Defines various data needed for registry synchronisation |
||||
|
||||
# |
||||
# List of our private objects and attributes which |
||||
# will not get exported by the script |
||||
# |
||||
<private> |
||||
reg-id |
||||
window |
||||
facility |
||||
location |
||||
remedyref |
||||
ticket |
||||
reg-id |
||||
range |
||||
preference |
||||
purpose |
||||
registry |
||||
usedfor |
||||
region |
||||
comment |
||||
assigned |
||||
</private> |
||||
|
||||
# |
||||
# List all maintainers with according passwords which we will need here |
||||
# |
||||
# This is not case-sensitive |
||||
<maintainer> |
||||
LOCAL-DB-MNT XXXXXXXXXXX |
||||
CW-EUROPE-GSOC XXXXXXXXXXXX |
||||
IPERGY-NOC XXXXXXXXx |
||||
</maintainer> |
||||
|
||||
# |
||||
# This is the the list of source and destination sources |
||||
# of the registries we use. |
||||
# |
||||
# Left side is the local source and right side is the destination |
||||
# source. The first pair defines the default for the script. |
||||
<source> |
||||
EUCW RIPE |
||||
ARINDB ARINDB |
||||
</source> |
||||
@ -1,225 +0,0 @@
|
||||
#!@l_prefix@/bin/perl |
||||
# |
||||
# whois wrapper to filter out private objects and attributes |
||||
# Arnd Vehling, NetHead - 11/03/2004 |
||||
# For Cable & Wireless Munich |
||||
# |
||||
|
||||
require 5.004; |
||||
use strict; |
||||
require Net::Daemon; |
||||
package cwho; |
||||
|
||||
use RipeWhois; |
||||
|
||||
use vars qw($VERSION @ISA); |
||||
$VERSION = '0.01'; |
||||
@ISA = qw(Net::Daemon); # to inherit from Net::Daemon |
||||
|
||||
sub Version ($) { 'CW Local whoisd server by ::nethead::, 0.01'; } |
||||
|
||||
# |
||||
# Glob Vars |
||||
# |
||||
|
||||
# Where to write the pidfile. Specify "none" for none. |
||||
my $pidfile = '@l_prefix@/var/ripe-dbase/whois_filt.pid'; |
||||
|
||||
my $header = "% This is the Cable & Wireless Whois server.\n% The objects are in RPSL format.\n%\n% Rights restricted by copyright.\n"; |
||||
|
||||
# Configuration file with private definitions |
||||
my $config="@l_prefix@/etc/ripe-dbase/whois_filt.config"; |
||||
|
||||
|
||||
# All whois objects go into this |
||||
my @src_objects = (); |
||||
my @privates = (); |
||||
|
||||
# Whois Server Definition |
||||
my %ldb = ('Host' => 'localhost', 'Port' => '43001', |
||||
'Mode' => 0); |
||||
|
||||
# Which source |
||||
my $local_source = "ARINCW"; |
||||
|
||||
## |
||||
## Whois Query Code |
||||
## |
||||
|
||||
# |
||||
# Parse Config File |
||||
# |
||||
sub read_config |
||||
{ |
||||
# Parse config file and read private attributes and local-src name |
||||
# for later use |
||||
my $Mode = $/; undef $/; |
||||
open( CONFIG, $config ) || die( "Cant open config-file $config\n" ); |
||||
my $cnf = <CONFIG>; |
||||
|
||||
# Put all private attributes into a string |
||||
if ( $cnf =~ /<private>(.*?)<\/private>/ims ) { |
||||
my $priv = $1; |
||||
@privates = split( /\n/, $priv ); |
||||
} else { |
||||
die( "Problem with config file $config. No private attributes!\n" ); |
||||
} |
||||
|
||||
close( CONFIG ); |
||||
$/ = $Mode; |
||||
} |
||||
|
||||
|
||||
# |
||||
# Make the Query |
||||
# |
||||
sub do_query |
||||
{ |
||||
my $whois_query = $_[0]; |
||||
|
||||
my $source_whois = new RipeWhois(Host => $ldb{'Host'}, |
||||
Port => $ldb{'Port'}, |
||||
FormatMode => $ldb{'Mode'}); |
||||
|
||||
unless(ref($source_whois)) { |
||||
print STDERR "ERROR Failed to open Whois Source ".$ldb{'Host'}."\n"; |
||||
exit 1; |
||||
} |
||||
|
||||
if($source_whois->GetErrorCode()) { |
||||
print "Error. Problem with ". $ldb{'Host'}.":".$ldb{'Port'}." ".$source_whois->GetErrorString(); |
||||
exit 2; |
||||
} |
||||
|
||||
# Execute query |
||||
#print "Query: $whois_query\n"; |
||||
|
||||
@src_objects = $source_whois->QueryObjects($whois_query); |
||||
|
||||
unless(@src_objects) { |
||||
print "\nNo Objects found.\n"; |
||||
my $myerr = $source_whois->GetErrorString(); |
||||
print "Query error: $myerr\n"; |
||||
exit 3; |
||||
} |
||||
} |
||||
|
||||
## |
||||
## Daemon Code |
||||
## |
||||
|
||||
# Treat command line option in the constructor |
||||
sub new ($$;$) { |
||||
my($class, $attr, $args) = @_; |
||||
my($self) = $class->SUPER::new($attr, $args); |
||||
if ($self->{'parent'}) { |
||||
# Called via Clone() |
||||
$self->{'base'} = $self->{'parent'}->{'base'}; |
||||
} else { |
||||
# Initial call |
||||
if ($self->{'options'} && $self->{'options'}->{'base'}) { |
||||
$self->{'base'} = $self->{'options'}->{'base'} |
||||
} |
||||
} |
||||
if (!$self->{'base'}) { |
||||
$self->{'base'} = 'dec'; |
||||
} |
||||
$self; |
||||
} |
||||
|
||||
sub Run ($) { |
||||
|
||||
my($self) = @_; |
||||
my($line, $sock, $source, $query, $rc); |
||||
$sock = $self->{'socket'}; |
||||
|
||||
if (!defined($line = $sock->getline())) { |
||||
if ($sock->error()) { |
||||
$self->Error("Client connection error %s", |
||||
$sock->error()); |
||||
} |
||||
$sock->close(); |
||||
return; |
||||
} |
||||
|
||||
# Process whois query |
||||
$line =~ s/\s+$//; # Remove CRLF, if any |
||||
|
||||
# Construct Query |
||||
$query = "-s $local_source $line"; |
||||
|
||||
# Execute Query, fills @src_objects |
||||
&do_query( $query ); |
||||
|
||||
# Print header |
||||
$rc = printf $sock $header; |
||||
|
||||
if (!$rc) { |
||||
$self->Error("Client connection error %s", |
||||
$sock->error()); |
||||
$sock->close(); |
||||
return; |
||||
} |
||||
|
||||
# Filter and Print Objects |
||||
foreach $source (@src_objects) { |
||||
|
||||
# |
||||
# Skip private Objects |
||||
# |
||||
# I need to change the config.dat format |
||||
# so that attributes and objects are in separate |
||||
# config sections so i dont need to code it |
||||
# statically here |
||||
# |
||||
if ( ($source =~ /remarks:\s+NO-EXPORT/is) || |
||||
($source =~ /^range:\s+/is) || |
||||
($source =~ /^ticket:\s+/is) || |
||||
($source =~ /^reg-id:\s+/is) || |
||||
($source =~ /^purpose:\s+/is) || |
||||
($source =~ /^facility:\s+/is) |
||||
) { next; } |
||||
|
||||
# Remove private attributes, if any |
||||
foreach my $priv (@privates) { |
||||
$source =~ s/^$priv:.*?$//mgi; |
||||
} |
||||
$source =~ s/\n\n/\n/g; |
||||
|
||||
#print("\n$source\n"); |
||||
$rc = printf $sock ("\n$source\n"); |
||||
|
||||
if (!$rc) { |
||||
$self->Error("Client connection error %s", |
||||
$sock->error()); |
||||
$sock->close(); |
||||
return; |
||||
} |
||||
} # foreach |
||||
|
||||
$rc = printf $sock ("\n"); |
||||
|
||||
if (!$rc) { |
||||
$self->Error("Client connection error %s", |
||||
$sock->error()); |
||||
$sock->close(); |
||||
return; |
||||
} |
||||
} |
||||
|
||||
## |
||||
## Main |
||||
## |
||||
|
||||
|
||||
# Read Config File |
||||
&read_config(); |
||||
|
||||
package Main; |
||||
|
||||
# Create Server |
||||
my $server = cwho->new({'pidfile' => $pidfile, |
||||
'localport' => 43}, \@ARGV); |
||||
# Bind to address/port, run server |
||||
$server->Bind(); |
||||
|
||||
@ -1,82 +0,0 @@
|
||||
## |
||||
## ripe-ipadm.spec -- OpenPKG RPM Package Specification |
||||
## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
||||
## |
||||
## 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: ripe-ipadm |
||||
Summary: IP Administration Tools Collection |
||||
URL: http://ipweb.eu.cw.net/ |
||||
Vendor: Cable & Wireless |
||||
Packager: OpenPKG Foundation e.V. |
||||
Distribution: OpenPKG Community |
||||
Class: EVAL |
||||
Group: WHOIS |
||||
License: Commercial |
||||
Version: 0.7.2 |
||||
Release: 20080101 |
||||
|
||||
# list of sources |
||||
Source0: ftp://ipadm0.eu.cw.net/ipadmin/ipadmin-%{version}.tar.gz |
||||
|
||||
# build information |
||||
BuildPreReq: OpenPKG, openpkg >= 20100101, perl, bash, perl-net, ripe-asused |
||||
PreReq: OpenPKG, openpkg >= 20100101, perl, bash, perl-net, ripe-asused |
||||
|
||||
%description |
||||
The ripe-ipadm consists of tools and utilities for IP network |
||||
administration, meant to be used with a RIPE IP administration |
||||
framework such as provided by the RIPE Whois database software |
||||
package. |
||||
|
||||
%track |
||||
prog ripe-ipadm = { |
||||
version = %{version} |
||||
url = ftp://ipadm0.eu.cw.net/ipadmin/ |
||||
regex = ipadmin-(__VER__)\.tar\.gz |
||||
} |
||||
|
||||
%prep |
||||
%setup -q -n ipadmin-%{version} |
||||
%{l_shtool} subst \ |
||||
-e 's;@confdir@;%{l_prefix}/etc/ripe-dbase;g' \ |
||||
parsewrap.sh |
||||
|
||||
%build |
||||
%{l_make} %{l_mflags -O} |
||||
|
||||
%install |
||||
%{l_make} %{l_mflags} install \ |
||||
SHTOOL=%{l_shtool} \ |
||||
PERL=%{l_prefix}/bin/perl \ |
||||
BASH=%{l_prefix}/bin/bash \ |
||||
DESTDIR=$RPM_BUILD_ROOT \ |
||||
prefix=%{l_prefix} \ |
||||
sysconfdir=%{l_prefix}/etc/ripe-ipadm \ |
||||
localstatedir=%{l_prefix}/var/ripe-ipadm |
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
||||
%{l_files_std} \ |
||||
'%config %{l_prefix}/etc/ripe-ipadm/*.conf' |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
|
||||
@ -1,85 +0,0 @@
|
||||
## |
||||
## ripe-whois.spec -- OpenPKG RPM Package Specification |
||||
## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
||||
## |
||||
## 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: ripe-whois |
||||
Summary: RIPE Whois Tool |
||||
URL: http://www.ripe.net/ripencc/pub-services/db/ |
||||
Vendor: RIPE NCC |
||||
Packager: OpenPKG Foundation e.V. |
||||
Distribution: OpenPKG Community |
||||
Class: PLUS |
||||
Group: WHOIS |
||||
License: RIPE NCC |
||||
Version: 3.1.1 |
||||
Release: 20080101 |
||||
|
||||
# package options |
||||
%option with_altport yes |
||||
|
||||
# list of sources |
||||
Source0: ftp://ftp.ripe.net/tools/ripe-whois-%{version}v6.tar.gz |
||||
|
||||
# build information |
||||
BuildPreReq: OpenPKG, openpkg >= 20100101, perl |
||||
PreReq: OpenPKG, openpkg >= 20100101 |
||||
|
||||
%description |
||||
This is the RIPE NCC version of a command line Whois tool which |
||||
allows you to query the RIPE Whois server (whois.ripe.net). |
||||
|
||||
%track |
||||
prog ripe-whois = { |
||||
version = %{version}v6 |
||||
url = ftp://ftp.ripe.net/tools/ |
||||
regex = ripe-whois-(__VER__)\.tar\.gz |
||||
} |
||||
|
||||
%prep |
||||
%setup -q -n whois-%{version}v6 |
||||
%if "%{with_altport}" == "yes" |
||||
%{l_shtool} subst \ |
||||
-e 's;\(DEFAULT_WHOIS_PORT \)"43";\1"43001";' \ |
||||
whois3.c |
||||
%endif |
||||
|
||||
%build |
||||
CC="%{l_cc}" \ |
||||
CFLAGS="%{l_cflags -O}" \ |
||||
CPPFLAGS="%{l_cppflags}" \ |
||||
LDFLAGS="%{l_ldflags}" \ |
||||
./configure \ |
||||
--prefix=%{l_prefix} |
||||
%{l_make} %{l_mflags -O} |
||||
|
||||
%install |
||||
%{l_make} %{l_mflags} install \ |
||||
prefix=$RPM_BUILD_ROOT%{l_prefix} \ |
||||
exec_prefix=$RPM_BUILD_ROOT%{l_prefix} |
||||
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
|
||||
Loading…
Reference in new issue