#!/usr/bin/make -f # $Id$ # # debian/rules file for phpbb3 Debian package # # Written from scratch, with inspiration from apache's debian/rules, and the # examples from dh_make # Copyright 2002, 2004 Jeroen van Wolffelaar # # Complete overhaul for debhelper 7 and dpkg source format 3 (quilt) # Copyright 2010 J.M. Roth # # Distributed under the GNU General Public License version 2 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Bash is easier export SHELL = /bin/bash VERSION := $(shell dpkg-parsechangelog --show-field Version) UPSTREAM := $(shell dpkg-parsechangelog --show-field Version | grep --only-matching '^[[:digit:].]\+') # Last version that matches the database LAST_VERSION := 3.0.12 get-orig-source: debian/get-orig-source ${UPSTREAM} _all @# mv *.orig*.tar* .. override_dh_auto_clean: debconf-updatepo -v override_dh_installchangelogs: dh_installchangelogs docs/CHANGELOG.html -pphpbb3 dh_installchangelogs -pphpbb3-l10n override_dh_installdeb: @# customize the stuff in the build directory rm debian/phpbb3/usr/share/phpbb3/install/schemas/index.htm cd debian/phpbb3/usr/share/phpbb3/docs && rm AUTHORS COPYING INSTALL.html sed -i "s/@VERSION@/$(VERSION) (Debian)/" debian/phpbb3/usr/share/phpbb3/www/common.php install -m 0755 debian/database_update_debian.php debian/phpbb3/usr/share/phpbb3/install/database_update_debian.php @# prune the language packs find debian/phpbb3-l10n/usr/share/phpbb3/www/language \( -name docs -o -name mods \) -type d -print0 | xargs -0r rm -r find debian/phpbb3-l10n/usr/share/phpbb3/www/language \( -name AUTHORS -o -name COPYING -o -name LICENSE -o -name README -o -name VERSION \) -type f -print0 | xargs -0r rm @### dbconfig install @# mysql cp install/schemas/mysql_41_schema.sql debian/phpbb3/usr/share/phpbb3/dbconfig-common/data/phpbb3/install/mysql cat debian/schema_data_debian.sql >> debian/phpbb3/usr/share/phpbb3/dbconfig-common/data/phpbb3/install/mysql @# postgres cp install/schemas/postgres_schema.sql debian/phpbb3/usr/share/phpbb3/dbconfig-common/data/phpbb3/install/pgsql cat debian/schema_data_debian.sql | sed "s/# POSTGRES BEGIN #/BEGIN;/" | sed "s/^#.*//" | sed -e 's/`/"/g' -e 's/UNIX_TIMESTAMP()/EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0))/' >> debian/phpbb3/usr/share/phpbb3/dbconfig-common/data/phpbb3/install/pgsql debian/postgres_update_seqs.sh install/schemas/postgres_schema.sql >> debian/phpbb3/usr/share/phpbb3/dbconfig-common/data/phpbb3/install/pgsql echo "COMMIT;" >> debian/phpbb3/usr/share/phpbb3/dbconfig-common/data/phpbb3/install/pgsql @# sqlite grep -v ^# install/schemas/sqlite_schema.sql > debian/phpbb3/usr/share/phpbb3/dbconfig-common/data/phpbb3/install/sqlite debian/sqliteconv1.sh debian/schema_data_debian.sql | perl -p debian/sqliteconv2.pl \ >> debian/phpbb3/usr/share/phpbb3/dbconfig-common/data/phpbb3/install/sqlite @### dbconfig update @###(some update /data/ copied via dh_install already) @# mysql install -m 0755 debian/database_update_debian.php debian/phpbb3/usr/share/dbconfig-common/scripts/phpbb3/upgrade/mysql/$(LAST_VERSION) @# postgres @#scripts install -m 0755 debian/database_update_debian.php debian/phpbb3/usr/share/dbconfig-common/scripts/phpbb3/upgrade/pgsql/$(LAST_VERSION) dh_installdeb %: dh $@