OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Michael van Elst
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src openpkg-web Date: 04-Mar-2003 17:25:47
Branch: HEAD Handle: 2003030416254402
Added files:
openpkg-src/powerdns powerdnssetup
Modified files:
openpkg-src/powerdns powerdns.spec
openpkg-web news.txt
Log:
added rudimentary setup script
Summary:
Revision Changes Path
1.3 +21 -8 openpkg-src/powerdns/powerdns.spec
1.1 +154 -0 openpkg-src/powerdns/powerdnssetup
1.3536 +1 -0 openpkg-web/news.txt
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/powerdns/powerdns.spec
============================================================================
$ cvs diff -u -r1.2 -r1.3 powerdns.spec
--- openpkg-src/powerdns/powerdns.spec 28 Feb 2003 15:56:36 -0000 1.2
+++ openpkg-src/powerdns/powerdns.spec 4 Mar 2003 16:25:46 -0000 1.3
@@ -35,7 +35,7 @@
Group: unknown
License: GPL
Version: 2.9.6
-Release: 20030228
+Release: 20030304
# list of sources
Source0: http://downloads.powerdns.com/releases/pdns-%{version}.tar.gz
@@ -43,6 +43,7 @@
Source2: fsl.powerdns
# package options
+%option with_fsl yes
%option with_pipe no
%option with_mysql no
%option with_pgsql no
@@ -71,21 +72,15 @@
The PowerDNS name server is a modern, advanced and high performance
authoritative-only nameserver. It is written from scratch and conforms
to all the relevant DNS standards documents.
-
The PowerDNS name server utilizes a flexible backend architecture which
can access DNS information from any data source. This includes file
formats, Bind zone files, relational databases or LDAP directories.
-
By connecting directly to a database, no 'reloading' is needed. Changes
committed to the database are effective immediately.
-
If you have specific needs for your DNS infrastructure then you can use
the Backend Developers Kit to write the 'glue' between PowerDNS and your
data or logic.
- Since version 2.9, PowerDNS is licensed under GNU General Public License
- version 2.
-
%prep
%setup -q -n pdns-%{version}
@@ -101,12 +96,19 @@
MODULES="$MODULES gpgsql"
%endif
MODULES=`echo "$MODULES" | sed 's;^ ;;'`
+ lf="%{l_ldflags}"
+ li=""
+%if "%{with_fsl}" == "yes"
+ lf="$lf `%{l_prefix}/bin/fsl-config --all --ldflags --libs`"
+ li="$li `%{l_prefix}/bin/fsl-config --all --libs`"
+%endif
CC="%{l_cc}" \
CXX="%{l_cxx}" \
CFLAGS="%{l_cflags -O}" \
CXXFLAGS="%{l_cxxflags -O} -DDLLIMPORT=" \
CPPFLAGS="%{l_cppflags} -DDLLIMPORT=" \
- LDFLAGS="%{l_ldflags}" \
+ LDFLAGS="$lf" \
+ LIBS="$li" \
./configure \
--prefix=%{l_prefix} \
--sysconfdir=%{l_prefix}/etc/powerdns \
@@ -142,6 +144,9 @@
# Setup config file
mv $RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf-dist \
$RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf
+ %{l_shtool} subst \
+ -e 's;@l_prefix@;%{l_prefix};g' \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf
# Creating run-command script
%{l_shtool} mkdir -f -p -m 755 \
@@ -150,6 +155,14 @@
-e 's;@l_susr@;%{l_susr};g' -e 's;@l_sgrp@;%{l_sgrp};g' \
-e 's;@l_musr@;%{l_musr};g' -e 's;@l_mgrp@;%{l_mgrp};g' \
%{SOURCE rc.powerdns} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes"
+ # Install setup script
+ %{l_shtool} mkdir -p -m 755 \
+ powerdnssetup} $RPM_BUILD_ROOT%{l_prefix}/sbin
+ %{l_shtool} install -c -m 755 \
+ %{SOURCE powerdnssetup} $RPM_BUILD_ROOT%{l_prefix}/sbin/
+%endif
# Creating fsl directory
%{l_shtool} mkdir -f -p -m 755 \
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/powerdns/powerdnssetup
============================================================================
$ cvs diff -u -r0 -r1.1 powerdnssetup
--- /dev/null 2003-03-04 17:25:47.000000000 +0100
+++ powerdnssetup 2003-03-04 17:25:47.000000000 +0100
@@ -0,0 +1,154 @@
+#!/bin/sh
+
+case "$1" in
+gmysql)
+ dbtype=MySQL
+ ;;
+gpgsql)
+ dbtype=PostgreSQL
+ ;;
+*)
+ echo "usage: $0 [ gmysql | gpgsql ]"
+ exit 1
+ ;;
+esac
+
+while [ ".$db" = . ]; do
+echo "Please enter the name of the database to be created:"
+read db
+done
+
+while [ ".$root" = . ]; do
+echo "Please enter the name of the database administrator account:"
+read root
+done
+
+while [ ".$pdnsadm" = . ]; do
+echo "Please enter the name of the DNS administrator account:"
+read pdnsadm
+done
+
+while [ ".$pdns" = . ]; do
+echo "Please enter the name of the DNS user account:"
+read pdns
+done
+
+echo ""
+echo "The $dbtype database '$db' will be created by '$root'."
+echo "Access is granted to the DNS administrator '$pdnsadm'"
+echo "and the DNS user '$pdns'."
+echo ""
+
+case "$1" in
+gmysql)
+ echo "Please log in as the $dbtype database administrator ($root)"
+ mysql -u$root -p mysql <<EOFEOF
+ DROP DATABASE $db;
+ CREATE DATABASE $db;
+ GRANT ALL ON $db TO $pdnsadm WITH GRANT OPTION
+EOFEOF
+ if [ $? -gt 0 ]; then exit 1; fi
+ echo "The database has been created"
+ echo ""
+ echo "Please log in as the $dbtype DNS administrator ($pdnsadm)"
+ mysql -u$pdnsadm -p $db <<EOFEOF
+ CREATE TABLE domains (
+ id INT auto_increment,
+ name VARCHAR(255) NOT NULL,
+ master VARCHAR(20) DEFAULT NULL,
+ last_check INT DEFAULT NULL,
+ type VARCHAR(6) NOT NULL,
+ notified_serial INT DEFAULT NULL,
+ account VARCHAR(40) DEFAULT NULL,
+ primary key (id)
+ )type=InnoDB;
+
+ CREATE UNIQUE INDEX name_index ON domains(name);
+
+ CREATE TABLE records (
+ id INT auto_increment,
+ domain_id INT DEFAULT NULL,
+ name VARCHAR(255) DEFAULT NULL,
+ type VARCHAR(6) DEFAULT NULL,
+ content VARCHAR(255) DEFAULT NULL,
+ ttl INT DEFAULT NULL,
+ prio INT DEFAULT NULL,
+ change_date INT DEFAULT NULL,
+ primary key(id)
+ )type=InnoDB;
+
+ CREATE INDEX rec_name_index ON records(name);
+ CREATE INDEX nametype_index ON records(name,type);
+ CREATE INDEX domain_id ON records(domain_id);
+
+ CREATE TABLE supermasters (
+ ip VARCHAR(25) NOT NULL,
+ nameserver VARCHAR(255) NOT NULL,
+ account VARCHAR(40) DEFAULT NULL
+ );
+
+ GRANT SELECT ON supermasters TO $pdns;
+ GRANT ALL ON domains TO $pdns;
+EOFEOF
+ if [ $? -gt 0 ]; then exit 1; fi
+ echo "The database has been populated"
+ echo ""
+ ;;
+gpgsql)
+ echo "Please log in as the $dbtype database administrator ($root)"
+ psql -U $root $db <<EOFEOF
+ DROP DATABASE $db;
+ CREATE DATABASE $db;
+ GRANT ALL ON $db TO $pdnsadm WITH GRANT OPTION;
+EOFEOF
+ if [ $? -gt 0 ]; then exit 1; fi
+ echo "The database has been created"
+ echo ""
+ echo "Please log in as the $dbtype DNS administrator ($pdnsadm)"
+ psql -U $pdnsadm $db <<EOFEOF
+ CREATE TABLE domains (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(255) NOT NULL,
+ master VARCHAR(20) DEFAULT NULL,
+ last_check INT DEFAULT NULL,
+ type VARCHAR(6) NOT NULL,
+ notified_serial INT DEFAULT NULL,
+ account VARCHAR(40) DEFAULT NULL
+ );
+ CREATE UNIQUE INDEX name_index ON domains(name);
+
+ CREATE TABLE records (
+ id SERIAL PRIMARY KEY,
+ domain_id INT DEFAULT NULL,
+ name VARCHAR(255) DEFAULT NULL,
+ type VARCHAR(6) DEFAULT NULL,
+ content VARCHAR(255) DEFAULT NULL,
+ ttl INT DEFAULT NULL,
+ prio INT DEFAULT NULL,
+ change_date INT DEFAULT NULL,
+ CONSTRAINT domain_exists
+ FOREIGN KEY(domain_id) REFERENCES domains(id)
+ ON DELETE CASCADE
+ );
+
+ CREATE INDEX rec_name_index ON records(name);
+ CREATE INDEX nametype_index ON records(name,type);
+ CREATE INDEX domain_id ON records(domain_id);
+
+ CREATE TABLE supermasters (
+ ip VARCHAR(25) NOT NULL,
+ nameserver VARCHAR(255) NOT NULL,
+ account VARCHAR(40) DEFAULT NULL
+ );
+
+ GRANT SELECT ON supermasters TO $pdns;
+ GRANT ALL ON domains TO $pdns;
+ GRANT ALL ON domains_id_seq TO $pdns;
+ GRANT ALL ON records TO $pdns;
+ GRANT ALL ON records_id_seq TO $pdns;
+EOFEOF
+ if [ $? -gt 0 ]; then exit 1; fi
+ echo "The database has been populated"
+ echo ""
+ ;;
+esac
@@ .
patch -p0 <<'@@ .'
Index: openpkg-web/news.txt
============================================================================
$ cvs diff -u -r1.3535 -r1.3536 news.txt
--- openpkg-web/news.txt 4 Mar 2003 16:06:47 -0000 1.3535
+++ openpkg-web/news.txt 4 Mar 2003 16:25:44 -0000 1.3536
@@ -1,3 +1,4 @@
+04-Mar-2003: Upgraded package: P<powerdns-2.9.6-20030304>
04-Mar-2003: Upgraded package: P<file-3.39-1.1.2>
04-Mar-2003: Upgraded package: P<file-3.39-1.2.1>
04-Mar-2003: Upgraded package: P<openpkg-tool-20030304-20030304>
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]