diff --git a/debian/apache.conf b/debian/apache.conf index 90dd411..1f751c0 100644 --- a/debian/apache.conf +++ b/debian/apache.conf @@ -1,4 +1,4 @@ -#Alias /gallery3 /usr/share/gallery3 +Alias /gallery3 /usr/share/gallery3 Options FollowSymLinks diff --git a/debian/changelog b/debian/changelog index 8a0b110..101b896 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +gallery3 (3.0.1-2) unstable; urgency=low + + * debian/{links,rules}: set data directory to /var/lib/gallery3 + * Auto setup gallery3 + + -- Michael C. Schultheiss Fri, 28 Jan 2011 22:00:48 +0000 + gallery3 (3.0.1-1) unstable; urgency=low * New upstream release diff --git a/debian/config b/debian/config index 19271c9..92811ad 100644 --- a/debian/config +++ b/debian/config @@ -14,4 +14,6 @@ db_version 2.0 || [ 0 -lt 30 ] db_input high gallery3/webserver_type || true +db_input high gallery3/admin-password || true + db_go || true diff --git a/debian/links b/debian/links index 18d87de..2f850e1 100644 --- a/debian/links +++ b/debian/links @@ -1 +1 @@ -var/lib/gallery3/g3data usr/share/gallery3/var +var/lib/gallery3 usr/share/gallery3/var diff --git a/debian/make_password.php b/debian/make_password.php new file mode 100644 index 0000000..f8f862a --- /dev/null +++ b/debian/make_password.php @@ -0,0 +1,6 @@ +HashPassword($_SERVER["argv"][1]), "\n"; +?> diff --git a/debian/postinst b/debian/postinst index 818641a..8fe9f13 100644 --- a/debian/postinst +++ b/debian/postinst @@ -13,12 +13,26 @@ if ! dbc_go gallery3 $@ ; then echo 'Automatic configuration using dbconfig-common failed!' fi +if [ -z $dbc_dbserver ]; then + dbc_dbserver="localhost" +fi + if [ "$DPKG_DEBUG" = "developer" ]; then set -x fi case "$1" in configure) + + if [ ! -f /var/lib/gallery3/database.php ]; then + php /usr/share/gallery3/installer/index.php -h $dbc_dbserver -u $dbc_dbuser -p $dbc_dbpass -d $dbc_dbname + fi + + db_get gallery3/admin-password + g3_admin_passwd="$RET" + export g3_admin_passwd + g3_admin_passwd_hash=$(php /usr/share/gallery3/make_password.php $g3_admin_passwd) + mysql -u$dbc_dbuser -p$dbc_dbpass -e "update users set password='$g3_admin_passwd_hash' where id=2" $dbc_dbname db_get gallery3/webserver_type webservers="$RET" diff --git a/debian/rules b/debian/rules index 40f6059..0557056 100755 --- a/debian/rules +++ b/debian/rules @@ -6,7 +6,7 @@ DESTDIR=$(CURDIR)/debian/gallery3 GDIR=$(DESTDIR)/usr/share/gallery3 GCONFDIR=$(DESTDIR)/etc/gallery3 -GDATADIR=$(DESTDIR)/var/lib/gallery3/g3data +GDATADIR=$(DESTDIR)/var/lib/gallery3 DOCDIR=$(DESTDIR)/usr/share/doc/gallery3 @@ -41,6 +41,7 @@ install: fi \ done install -m 644 debian/apache.conf $(GCONFDIR) + install -m 644 debian/make_password.php $(GDIR) build: # Build architecture-dependent files here. diff --git a/debian/templates b/debian/templates index 5871ecf..ecaf732 100644 --- a/debian/templates +++ b/debian/templates @@ -14,3 +14,15 @@ _Description: Should ${webserver} be restarted? Remember that in order to activate the new configuration, ${webserver} has to be restarted. You can also restart ${webserver} by manually executing 'invoke-rc.d ${webserver} restart'. + +Template: gallery3/admin-password +Type: password +Default: +_Description: Password for Gallery 3 admin user + Gallery 3 may be accessed, after installation, from + http://localhost/gallery3/ + . + Administrative access to Gallery 3 requires identification with a + username and a password. + . + The default username is admin and the password is whatever you set here.