Pārlūkot izejas kodu

integrate Arnd's SQL modifications, to install and suggest conditionally with_extobjs

Michael Schloh von Bennewitz 21 gadi atpakaļ
vecāks
revīzija
86a9bfd860
2 mainītis faili ar 101 papildinājumiem un 2 dzēšanām
  1. 85 0
      ripe-dbase/ripe-dbase-modify.sh
  2. 16 2
      ripe-dbase/ripe-dbase.spec

+ 85 - 0
ripe-dbase/ripe-dbase-modify.sh

@@ -0,0 +1,85 @@
+#!/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
+

+ 16 - 2
ripe-dbase/ripe-dbase.spec

@@ -36,7 +36,7 @@ Class:        JUNK
 Group:        Database
 License:      RIPE NCC
 Version:      3.2.0
-Release:      20040315
+Release:      20040317
 
 #   package options
 %option       with_extobjs  no
@@ -44,7 +44,8 @@ Release:      20040315
 #   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
+Source2:      ripe-dbase-modify.sh
+Source3:      rc.ripe-dbase
 Patch0:       ripe-dbase.patch
 Patch1:       ripe-dbase.patch.extobjs
 
@@ -140,6 +141,11 @@ AutoReqProv:  no
     %{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
+%endif
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
         %{l_files_std} \
         '%config %{l_prefix}/etc/ripe-dbase/*' \
@@ -183,8 +189,16 @@ AutoReqProv:  no
           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 "5. Finally start the WHOIS server by running:"
+          echo "     \$ $RPM_INSTALL_PREFIX/etc/rc ripe-dbase start"
+%else
           echo "4. Finally start the WHOIS server by running:"
           echo "     \$ $RPM_INSTALL_PREFIX/etc/rc ripe-dbase start"
+%endif
         ) | %{l_rpmtool} msg -b -t notice
     fi
     if [ $1 -eq 2 ]; then