From 7a59b9247faf8ecf47ff45044af7ad30e36e383d Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Sat, 6 Mar 2004 12:44:50 +0000 Subject: - Add WITH_SQLITE knob to enable SQLite backend PR: ports/63817 Submitted by: Ralf van der Enden (maintainer) --- dns/powerdns/Makefile | 13 +++++++-- dns/powerdns/files/configure.powerdns | 7 ++++- .../files/patch-modules_gsqlitebackend_Makefile_in | 11 ++++++++ .../files/patch-modules_gsqlitebackend_ssqlite_cc | 10 +++++++ dns/powerdns/files/pdns.conf | 4 +++ dns/powerdns/files/pdns_sqlite.sql | 33 ++++++++++++++++++++++ dns/powerdns/pkg-plist | 1 + 7 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 dns/powerdns/files/patch-modules_gsqlitebackend_Makefile_in create mode 100644 dns/powerdns/files/patch-modules_gsqlitebackend_ssqlite_cc create mode 100644 dns/powerdns/files/pdns_sqlite.sql (limited to 'dns/powerdns') diff --git a/dns/powerdns/Makefile b/dns/powerdns/Makefile index 64333597c989..d12a244abcdf 100644 --- a/dns/powerdns/Makefile +++ b/dns/powerdns/Makefile @@ -7,7 +7,7 @@ PORTNAME= powerdns PORTVERSION= 2.9.16 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= dns ipv6 MASTER_SITES= http://downloads.powerdns.com/releases/ DISTNAME= pdns-${PORTVERSION} @@ -73,6 +73,15 @@ PLIST_SUB+= WITHLDAP="" PLIST_SUB+= WITHLDAP="@comment " .endif +.if defined(WITH_SQLITE) +LIB_DEPENDS= sqlite.2:${PORTSDIR}/${SQLITE_PORT} +SQLITE_PORT?= databases/sqlite +CONFIGURE_ARGS+= --enable-sqlite +CONFIGURE_MODULES+= "gsqlite" +.else +CONFIGURE_ARGS+= --disable-sqlite +.endif + .if defined(POWERDNS_WITH_RECURSOR) USE_GCC=3.2 CONFIGURE_ARGS+= --enable-recursor @@ -123,7 +132,7 @@ post-install: .endif .if !defined(NOPORTDOCS) ${MKDIR} ${EXAMPLESDIR} -.for i in pdns.conf pdns_mysql.sql pdns_postgresql.sql +.for i in pdns.conf pdns_mysql.sql pdns_postgresql.sql pdns_sqlite.sql ${INSTALL_DATA} ${FILESDIR}/$i ${EXAMPLESDIR}/ .endfor .endif diff --git a/dns/powerdns/files/configure.powerdns b/dns/powerdns/files/configure.powerdns index da3636e5b234..fcdfe0dddec8 100644 --- a/dns/powerdns/files/configure.powerdns +++ b/dns/powerdns/files/configure.powerdns @@ -11,7 +11,7 @@ if [ "${POWERDNS_OPTIONS}" ]; then else dialog --title "configuration options" --clear \ --checklist "\n\ -Please select desired options:" -1 -1 8 \ +Please select desired options:" -1 -1 9 \ PostgreSQL "PostgreSQL driver" ON \ MySQL323 "MySQL 3.23 driver" OFF \ MySQL40 "MySQL 4.0 driver" OFF \ @@ -19,6 +19,7 @@ MySQL41 "MySQL 4.1 driver" OFF \ OpenLDAP20 "OpenLDAP 2.0 backend" OFF \ OpenLDAP21 "OpenLDAP 2.1 backend" OFF \ OpenLDAP22 "OpenLDAP 2.2 backend" OFF \ +SQLite "SQLite backend" OFF \ Recursor "Build Recursor" OFF \ 2> /tmp/checklist.tmp.$$ @@ -71,6 +72,10 @@ while [ "$1" ]; do echo WITH_LDAP=YES echo LDAP_PORT?=net/openldap22-client ;; + \"SQLite\") + echo WITH_SQLITE=YES + echo SQLITE_PORT?=databases/sqlite + ;; \"Recursor\") echo POWERDNS_WITH_RECURSOR=YES ;; diff --git a/dns/powerdns/files/patch-modules_gsqlitebackend_Makefile_in b/dns/powerdns/files/patch-modules_gsqlitebackend_Makefile_in new file mode 100644 index 000000000000..015400560a2b --- /dev/null +++ b/dns/powerdns/files/patch-modules_gsqlitebackend_Makefile_in @@ -0,0 +1,11 @@ +--- modules/gsqlitebackend/Makefile.in Fri Mar 5 09:59:34 2004 ++++ modules/gsqlitebackend/Makefile.in Fri Mar 5 10:00:54 2004 +@@ -193,7 +193,7 @@ + clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + libgsqlitebackend.la: $(libgsqlitebackend_la_OBJECTS) $(libgsqlitebackend_la_DEPENDENCIES) +- $(CXXLINK) -rpath $(libdir) $(libgsqlitebackend_la_LDFLAGS) $(libgsqlitebackend_la_OBJECTS) $(libgsqlitebackend_la_LIBADD) $(LIBS) ++# $(CXXLINK) -rpath $(libdir) $(libgsqlitebackend_la_LDFLAGS) $(libgsqlitebackend_la_OBJECTS) $(libgsqlitebackend_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core diff --git a/dns/powerdns/files/patch-modules_gsqlitebackend_ssqlite_cc b/dns/powerdns/files/patch-modules_gsqlitebackend_ssqlite_cc new file mode 100644 index 000000000000..2a757b0714bb --- /dev/null +++ b/dns/powerdns/files/patch-modules_gsqlitebackend_ssqlite_cc @@ -0,0 +1,10 @@ +--- modules/gsqlitebackend/ssqlite.cc Fri Mar 5 22:06:33 2004 ++++ modules/gsqlitebackend/ssqlite.cc Fri Mar 5 22:06:56 2004 +@@ -6,6 +6,7 @@ + + #include "pdns/utility.hh" + #include ++#include + #include "ssqlite.hh" + #include + diff --git a/dns/powerdns/files/pdns.conf b/dns/powerdns/files/pdns.conf index a45251872b73..d97daffd5507 100644 --- a/dns/powerdns/files/pdns.conf +++ b/dns/powerdns/files/pdns.conf @@ -12,6 +12,10 @@ #gpgsql-user=pdns #gpgsql-password=pdns +# SQLite +#launch=gsqlite +#gsqlite-database= + ################################# # allow-axfr-ips If disabled, DO allow zonetransfers from these IP addresses # diff --git a/dns/powerdns/files/pdns_sqlite.sql b/dns/powerdns/files/pdns_sqlite.sql new file mode 100644 index 000000000000..f0f831fb2977 --- /dev/null +++ b/dns/powerdns/files/pdns_sqlite.sql @@ -0,0 +1,33 @@ +create table domains ( + id INTEGER PRIMARY KEY, + name VARCHAR(255) NOT NULL, + master VARCHAR(20) DEFAULT NULL, + last_check INTEGER DEFAULT NULL, + type VARCHAR(6) NOT NULL, + notified_serial INTEGER DEFAULT NULL, + account VARCHAR(40) DEFAULT NULL +); + +CREATE UNIQUE INDEX name_index ON domains(name); + +CREATE TABLE records ( + id INTEGER PRIMARY KEY, + domain_id INTEGER DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + type VARCHAR(6) DEFAULT NULL, + content VARCHAR(255) DEFAULT NULL, + ttl INTEGER DEFAULT NULL, + prio INTEGER DEFAULT NULL, + change_date INTEGER DEFAULT NULL +); + +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 +); + diff --git a/dns/powerdns/pkg-plist b/dns/powerdns/pkg-plist index 74c1eefe1f96..0925e1bcea29 100644 --- a/dns/powerdns/pkg-plist +++ b/dns/powerdns/pkg-plist @@ -15,4 +15,5 @@ etc/rc.d/pdns.sh.sample %%PORTDOCS%%share/examples/powerdns/pdns.conf %%PORTDOCS%%share/examples/powerdns/pdns_mysql.sql %%PORTDOCS%%share/examples/powerdns/pdns_postgresql.sql +%%PORTDOCS%%share/examples/powerdns/pdns_sqlite.sql %%PORTDOCS%%@dirrm share/examples/powerdns -- cgit v1.2.3