From ed92a5c7fc0f99c44f7fbb8b80c9eecfd5995db0 Mon Sep 17 00:00:00 2001 From: Romain Beauxis Date: Tue, 13 Mar 2007 14:08:37 +0000 Subject: [PATCH] Moved modifications on db.inc.php to a patch, added patch support to build files --- debian/conf/apache.conf | 8 +++ debian/conf/db.inc.php | 73 -------------------- debian/control | 2 +- debian/patches/dbconfig-common_support.patch | 31 +++++++++ debian/patches/series | 1 + debian/rules | 13 +++- 6 files changed, 53 insertions(+), 75 deletions(-) delete mode 100644 debian/conf/db.inc.php create mode 100644 debian/patches/dbconfig-common_support.patch create mode 100644 debian/patches/series diff --git a/debian/conf/apache.conf b/debian/conf/apache.conf index 9154a86..1f5cffa 100644 --- a/debian/conf/apache.conf +++ b/debian/conf/apache.conf @@ -15,3 +15,11 @@ AllowOverride None + + Options -FollowSymLinks + AllowOverride None + Order allow,deny + Deny from all + + + diff --git a/debian/conf/db.inc.php b/debian/conf/db.inc.php deleted file mode 100644 index 81b1083..0000000 --- a/debian/conf/db.inc.php +++ /dev/null @@ -1,73 +0,0 @@ - diff --git a/debian/control b/debian/control index c210237..4fb546d 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: web Priority: extra Maintainer: Debian Roundcube Maintainers Uploaders: Vincent Bernat , Romain Beauxis -Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5) +Build-Depends: debhelper (>= 5), quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27-1) Build-Depends-Indep: po-debconf Standards-Version: 3.7.2 diff --git a/debian/patches/dbconfig-common_support.patch b/debian/patches/dbconfig-common_support.patch new file mode 100644 index 0000000..0394533 --- /dev/null +++ b/debian/patches/dbconfig-common_support.patch @@ -0,0 +1,31 @@ +--- roundcube_0.1~beta2.2/config/db.inc.php.dist 2006-03-20 23:08:51.000000000 +0100 ++++ roundcube_0.1~beta2.2/config/db.inc.php.dist 2007-03-13 14:33:38.000000000 +0100 +@@ -14,13 +14,20 @@ + + $rcmail_config = array(); + +-// PEAR database DSN for read/write operations +-// format is db_provider://user:password@host/databse +-// currentyl suported db_providers: mysql, sqlite +- +-$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail'; +-// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail'; +-// sqlite example: 'sqlite://./sqlite.db?mode=0646'; ++/* Do not set db_dsnw here, use dpkg-reconfigure roundcube to configure database ! */ ++ ++include_once("/etc/roundcube/debian-db.php"); ++ ++switch ($dbtype) { ++ case "sqlite": ++ $rcmail_config['db_dsnw'] = "sqlite:///$basepath/$dbname?mode=0640"; ++ break; ++ default: ++ if ($dbport != '') $dbport=":$dbport"; ++ if ($dbserver == '') $dbserver="localhost"; ++ $rcmail_config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname"; ++ break; ++ } + + // PEAR database DSN for read only operations (if empty write database will be used) + // useful for database replication + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..f86a938 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +dbconfig-common_support.patch diff --git a/debian/rules b/debian/rules index 02058c1..875d56c 100755 --- a/debian/rules +++ b/debian/rules @@ -1,18 +1,29 @@ #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk # In order to regenerate 'debian/control' : # DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean # Then check manually if everything's ok binary-install/roundcube:: - rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/{Auth,DB,DB.php,Mail,Net,PEAR.php} + # Removing PEAR classes that are provided via strd packages + rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/Auth + rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/DB + rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/DB.php + rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/Mail + rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/Net + rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/PEAR.php + # Symlink all that is in /usr/share/roundcube to /var/lib/roundcube find debian/roundcube/usr/share/roundcube -maxdepth 1 -mindepth 1 | \ while read i; do \ dh_link "`echo "$$i" | sed -e s#debian/roundcube/##`" \ "`echo "$$i" | sed -e s#debian/roundcube/usr/share/roundcube/#var/lib/roundcube/#`"; \ done + # Install config/db.inc.php.dist + install -m 0640 $(CURDIR)/config/db.inc.php.dist $(CURDIR)/debian/roundcube/etc/roundcube/db.inc.php + # Some files are executable while not being scripts or binary... chmod -x $(CURDIR)/debian/roundcube/usr/share/roundcube/program/include/rcube_mdb2.inc chmod -x $(CURDIR)/debian/roundcube/var/lib/roundcube/skins/default/images/icons/plus.gif chmod -x $(CURDIR)/debian/roundcube/var/lib/roundcube/skins/default/common.css -- 2.39.2