r103819 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103818‎ | r103819 | r103820 >
Date:16:24, 21 November 2011
Author:hashar
Status:deferred
Tags:
Comment:
testswarm.deb enhancements

* copy sourcefile files
* setup apache (.conf, .htaccess ..)
* first pass at database configuration

Somehow, the db configuration helper does not seem to configure anything
the config.ini file is never generated by the postinst script :-(
Modified paths:
  • /trunk/debs/testswarm/debian/README.Debian (added) (history)
  • /trunk/debs/testswarm/debian/README.source (added) (history)
  • /trunk/debs/testswarm/debian/changelog (modified) (history)
  • /trunk/debs/testswarm/debian/compat (modified) (history)
  • /trunk/debs/testswarm/debian/control (modified) (history)
  • /trunk/debs/testswarm/debian/copyright (modified) (history)
  • /trunk/debs/testswarm/debian/dirs (modified) (history)
  • /trunk/debs/testswarm/debian/docs (modified) (history)
  • /trunk/debs/testswarm/debian/patches (added) (history)
  • /trunk/debs/testswarm/debian/patches/01_rewriterule_base.patch (added) (history)
  • /trunk/debs/testswarm/debian/patches/02_debian_config_ini.patch (added) (history)
  • /trunk/debs/testswarm/debian/patches/series (added) (history)
  • /trunk/debs/testswarm/debian/rules (modified) (history)
  • /trunk/debs/testswarm/debian/testswarm.apache.conf (added) (history)
  • /trunk/debs/testswarm/debian/testswarm.config (added) (history)
  • /trunk/debs/testswarm/debian/testswarm.debhelper.log (added) (history)
  • /trunk/debs/testswarm/debian/testswarm.postinst (added) (history)
  • /trunk/debs/testswarm/debian/testswarm.postrm (added) (history)
  • /trunk/debs/testswarm/debian/testswarm.prerm (added) (history)
  • /trunk/debs/testswarm/debian/testswarm.substvars (added) (history)

Diff [purge]

Index: trunk/debs/testswarm/debian/control
@@ -1,12 +1,15 @@
22 Source: testswarm
3 -Section: misc
 3+Section: web
44 Priority: extra
5 -Maintainer: Chad Horohoe <chad@wikimedia.org>
6 -Build-Depends: debhelper (>= 6), libapache2-mod-php5, mysql-server, dbconfig-common
7 -Standards-Version: 3.8.0
 5+Maintainer: Antoine Musso <amusso@wikimedia.org>
 6+Uploaders: Antoine Musso <amusso@wikimedia.org>, Chad Horohoe <chad@wikimedia.org>
 7+Build-Depends: debhelper (>= 7), dbconfig-common, quilt
 8+Standards-Version: 3.8.3
89 Homepage: https://github.com/jquery/testswarm
910
1011 Package: testswarm
1112 Architecture: any
12 -Depends: ${shlibs:Depends}
13 -Description:Javascript unit test runner
 13+Depends: apache2, libapache2-mod-php5 | php5, php5-mysql, mysql-server, ucf, dbconfig-common, ${shlibs:Depends}, ${misc:Depends}
 14+Recommends: mysql-client
 15+Description: Javascript unit test runner
 16+ <insert long description, indented with spaces>
Index: trunk/debs/testswarm/debian/compat
@@ -1 +1 @@
2 -6
 2+7
Index: trunk/debs/testswarm/debian/testswarm.substvars
@@ -0,0 +1 @@
 2+misc:Depends=
Index: trunk/debs/testswarm/debian/changelog
@@ -1,5 +1,6 @@
2 -testswarm (0-44ed30bb40) unstable; urgency=low
 2+testswarm (0.0.20111012-1) unstable; urgency=low
33
44 * Initial import from https://github.com/jquery/testswarm
 5+ * Package version uses last commit date
56
6 - -- Chad Horohoe <chad@wikimedia.org> Tue, 15 Nov 2011 14:34:02 -0500
 7+ -- Antoine Musso <amusso@wikimedia.org> Sun, 20 Nov 2011 14:30:36 +0100
Index: trunk/debs/testswarm/debian/patches/01_rewriterule_base.patch
@@ -0,0 +1,11 @@
 2+--- a/config/.htaccess-sample
 3+@@ -4,7 +4,7 @@
 4+ </Files>
 5+
 6+ RewriteEngine On
 7+-RewriteBase /
 8++RewriteBase /testswarm
 9+
 10+ RewriteCond %{REQUEST_FILENAME} -f [OR]
 11+ RewriteCond %{REQUEST_FILENAME} -d
Index: trunk/debs/testswarm/debian/patches/02_debian_config_ini.patch
@@ -0,0 +1,16 @@
 2+--- /dev/null
 3+@@ -0,0 +1,13 @@
 4++; This file is a template only. The actual config has been added in testswarm root
 5++; directory as /usr/share/testswarm/site/config.ini
 6++; Rename to config.ini
 7++; and move to the site root
 8++[database]
 9++ host = "_DBC_DBSERVER_"
 10++ username = "_DBC_DBUSER_"
 11++ password = "_DBC_DBPASS_"
 12++ database = "_DBC_DBNAME_"
 13++[web]
 14++; set to /testswarm/ to run a local copy in a non-root directory, also update .htaccess with RewriteBase /testswarm/
 15++; include trailing slash!
 16++ contextpath = "/testswarm/"
Index: trunk/debs/testswarm/debian/patches/series
@@ -0,0 +1,2 @@
 2+01_rewriterule_base.patch
 3+02_debian_config_ini.patch
Index: trunk/debs/testswarm/debian/docs
@@ -1 +1,3 @@
 2+LICENSE
23 README
 4+debian/testswarm.apache.conf
Index: trunk/debs/testswarm/debian/rules
@@ -1,20 +1,31 @@
22 #!/usr/bin/make -f
33 # -*- makefile -*-
4 -#export DH_VERBOSE=1
 4+export DH_VERBOSE=1
55
6 -build: build-stamp
 6+# Our fabulous paths:
 7+TDIR:=debian/testswarm
 8+SHAREDIR:=${TDIR}/usr/share/testswarm
 9+SITEDIR:=${SHAREDIR}/site
710
8 -build-stamp:
 11+include /usr/share/quilt/quilt.make
 12+
 13+configure: configure-stamp
 14+configure-stamp: $(QUILT_STAMPFN)
915 dh_testdir
 16+ touch configure-stamp
1017
11 - $(MAKE)
 18+build: build-stamp
 19+build-stamp: patch configure-stamp
 20+ dh_testdir
 21+
 22+ #$(MAKE)
1223 touch $@
1324
1425 clean:
1526 dh_testdir
1627 dh_testroot
1728 rm -f build-stamp
18 - $(MAKE) clean
 29+ #$(MAKE) clean
1930
2031 dh_clean
2132
@@ -22,8 +33,21 @@
2334 dh_testdir
2435 dh_testroot
2536 dh_installdirs
 37+ # Copy index.php
 38+ install -p *.php ${SITEDIR}
 39+ # Copy all php/css/js files:
 40+ cp -p -R content css images inc js logic ${SITEDIR}
 41+ # Fix permissions:
 42+ find ${SITEDIR} -exec chown root:www-data {} \;
 43+ find ${SITEDIR} -type d -exec chmod 750 {} \;
 44+ find ${SITEDIR} -type f -exec chmod 640 {} \;
 45+ # Perl script examples belong to usr/share
 46+ cp -p -R scripts ${SHAREDIR}
 47+ # Place SQL scripts in dbconfig-common area
 48+ cp -p config/testswarm.sql config/useragents.sql ${TDIR}/usr/share/dbconfig-common/data/testswarm/install/mysql
 49+ cp -p config/.htaccess-sample ${SITEDIR}/.htaccess
 50+ install -p -m 640 -g www-data config/config.Debian.ini ${TDIR}/etc/testswarm/
2651
27 -
2852 binary-indep: install
2953 binary-arch: install
3054 dh_testdir
Index: trunk/debs/testswarm/debian/README.source
@@ -0,0 +1,9 @@
 2+testswarm for Debian
 3+--------------------
 4+
 5+<this file describes information about the source package, see Debian policy
 6+manual section 4.14. You WILL either need to modify or delete this file>
 7+
 8+
 9+
 10+
Index: trunk/debs/testswarm/debian/testswarm.apache.conf
@@ -0,0 +1,14 @@
 2+Alias /testswarm /usr/share/testswarm/site
 3+
 4+<DirectoryMatch /usr/share/testswarm/site>
 5+ Options +FollowSymLinks
 6+ AllowOverride None
 7+ order allow,deny
 8+ allow from all
 9+
 10+ AddType application/x-httpd-php .php
 11+ php_value include_path .
 12+
 13+ DirectoryIndex index.php
 14+</DirectoryMatch>
 15+
Index: trunk/debs/testswarm/debian/testswarm.config
@@ -0,0 +1,13 @@
 2+#!/bin/sh
 3+
 4+set -e
 5+
 6+. /usr/share/debconf/confmodule
 7+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
 8+ . /usr/share/dbconfig-common/dpkg/config.mysql
 9+ dbc_go testswarm $@
 10+fi
 11+
 12+db_go || true
 13+
 14+exit 0
Index: trunk/debs/testswarm/debian/dirs
@@ -0,0 +1,5 @@
 2+etc/testswarm
 3+var/log/testswarm
 4+usr/share/doc/testswarm
 5+usr/share/testswarm/site
 6+usr/share/dbconfig-common/data/testswarm/install/mysql
Index: trunk/debs/testswarm/debian/testswarm.debhelper.log
@@ -0,0 +1,13 @@
 2+dh_installdirs
 3+dh_installchangelogs
 4+dh_installdocs
 5+dh_installman
 6+dh_link
 7+dh_strip
 8+dh_compress
 9+dh_fixperms
 10+dh_installdeb
 11+dh_shlibdeps
 12+dh_gencontrol
 13+dh_md5sums
 14+dh_builddeb
Index: trunk/debs/testswarm/debian/copyright
@@ -1,5 +1,5 @@
2 -This package was debianized by Chad Horohoe <chad@wikimedia.org> on
3 -Tue, 15 Nov 2011 14:34:02 -0500.
 2+This package was debianized by Chad Horohoe <chad@wikimedia.org> and
 3+Antoine Musso <amusso@wikimedia.org> on Tue, 15 Nov 2011 14:34:02 -0500.
44
55 It was downloaded from <https://github.com/jquery/testswarm>
66
@@ -33,4 +33,5 @@
3434 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3535 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3636 OTHER DEALINGS IN THE SOFTWARE.
37 -
\ No newline at end of file
 37+
 38+
Index: trunk/debs/testswarm/debian/testswarm.postinst
@@ -0,0 +1,38 @@
 2+#!/bin/sh
 3+# postinst script for testswarm
 4+#
 5+# see: dh_installdeb(1)
 6+
 7+set -e
 8+
 9+. /usr/share/debconf/confmodule
 10+. /usr/share/dbconfig-common/dpkg/config.mysql
 11+dbc_first_version="0.0.20111012-1"
 12+dbc_generate_include="template:/usr/share/testswarm/site/config.ini"
 13+dbc_generate_include_owner="root:www-data"
 14+dbc_generate_include_perms="0640"
 15+dbc_generate_include_args="-o template_infile=/etc/testswarm/config.Debian.ini --dbname=database_default --dbpass=database_password --dbuser=database_username --dbserver=database_hostname --dbport=database_port"
 16+dbc_generate_include_args="-o template_infile=/etc/testswarm/config.Debian.ini"
 17+dbc_go testswarm $@
 18+
 19+# config/testswarm.sql
 20+# config/useragents.sql
 21+
 22+
 23+##### Install apache configuration file ###############################
 24+
 25+ucf --debconf-ok /usr/share/doc/testswarm/testswarm.apache.conf /etc/testswarm/apache.conf
 26+
 27+# Symlink default conf if there is none
 28+if [ ! -e "/etc/apache2/conf.d/testswarm.conf" ]; then
 29+ ln -s /etc/testswarm/apache.conf /etc/apache2/conf.d/testswarm.conf
 30+fi
 31+invoke-rc.d apache2 reload || true
 32+
 33+
 34+# dh_installdeb will replace this with shell code automatically
 35+# generated by other debhelper scripts.
 36+
 37+#DEBHELPER#
 38+
 39+exit 0
Index: trunk/debs/testswarm/debian/testswarm.postrm
@@ -0,0 +1,44 @@
 2+#!/bin/sh
 3+
 4+if [ "$1" != "remove" ] && [ "$1" != "purge" ]; then
 5+ exit 0;
 6+fi
 7+
 8+. /usr/share/debconf/confmodule
 9+if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
 10+ . /usr/share/dbconfig-common/dpkg/postrm.mysql
 11+ dbc_go testswarm $@
 12+fi
 13+
 14+case "$1" in
 15+purge)
 16+ # FIXME: add files that need to be removed!
 17+
 18+ if which ucf >/dev/null 2>&1; then
 19+ ucf --purge /usr/share/testswarm/site/config.ini
 20+ ucfr --purge testswarm /usr/share/testswarm/site/config.ini
 21+ ucf --purge /etc/testswarm/apache.conf
 22+ ucfr --purge testswarm /etc/testswarm/apache.conf
 23+ fi
 24+ rm -f /usr/share/testswarm/site/config.ini
 25+ rm -f /etc/testswarm/apache.conf
 26+
 27+ # unlink testswarm apache conf and restart apache
 28+ if [ -L "/etc/apache2/conf.d/testswarm.conf" ]; then
 29+ rm /etc/apache2/conf.d/testswarm.conf
 30+ fi
 31+ invoke-rc.d apache2 reload || true
 32+
 33+ ;;
 34+
 35+
 36+remove)
 37+ # unlink testswarm apache conf and restart apache
 38+ if [ -L "/etc/apache2/conf.d/testswarm.conf" ]; then
 39+ rm /etc/apache2/conf.d/testswarm.conf
 40+ fi
 41+ invoke-rc.d apache2 reload || true
 42+
 43+ ;;
 44+
 45+esac
Index: trunk/debs/testswarm/debian/testswarm.prerm
@@ -0,0 +1,11 @@
 2+#!/bin/sh
 3+
 4+set -e
 5+
 6+. /usr/share/debconf/confmodule
 7+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
 8+ . /usr/share/dbconfig-common/dpkg/config.mysql
 9+ dbc_go testswarm $@
 10+fi
 11+
 12+#DEBHELPER#
Index: trunk/debs/testswarm/debian/README.Debian
@@ -0,0 +1,8 @@
 2+testswarm for Debian
 3+--------------------
 4+
 5+This package is still a bit hacky. Please do test it locally and report any
 6+issue directly to me.
 7+I will hopefully remove this notice once we have a working testswarm package!
 8+
 9+ -- Antoine Musso <amusso@wikimedia.org> Sun, 20 Nov 2011 14:30:36 +0100

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103472Initial skeleton for testswarm debdemon16:24, 17 November 2011

Status & tagging log