Install the sql files for dbconfig

This commit is contained in:
Emmanuel Papin 2014-12-03 15:38:31 +01:00
parent 9eb21bc3dd
commit 8a51a754aa
1 changed files with 21 additions and 5 deletions

View File

@ -72,6 +72,7 @@ override_dh_clean:
done || true
override_dh_install:
dh_install --fail-missing
#
# NOTE: This is a short-term kludge; hopefully changes in the next
# upstream version will render this unnecessary.
@ -81,7 +82,6 @@ override_dh_install:
dh_link var/cache/zoneminder/events usr/share/zoneminder/events
dh_link var/cache/zoneminder/images usr/share/zoneminder/images
dh_link var/cache/zoneminder/temp usr/share/zoneminder/temp
#
# This is a slightly lesser kludge; moving the cgi stuff to
# /usr/share/zoneminder/cgi-bin breaks one set of behavior,
@ -89,8 +89,24 @@ override_dh_install:
# behavior.
#
dh_link usr/lib/cgi-bin usr/share/zoneminder/cgi-bin
dh_install --fail-missing
#
# Install sql file for dbconfig (first installation)
install -m 644 db/zm_create.sql \
debian/zoneminder/usr/share/dbconfig-common/data/zoneminder/install/mysql
#
# Remove unneeded sql requests
# dbconfig will create the underlying database
sed -i "/^ *CREATE DATABASE/d" \
debian/zoneminder/usr/share/dbconfig-common/data/zoneminder/install/mysql
sed -i "/^ *USE /d" \
debian/zoneminder/usr/share/dbconfig-common/data/zoneminder/install/mysql
#
# Install sql update files for dbconfig
for sqlfile in db/*; do \
lnk=`echo $$sqlfile | sed "s/^db\/zm_update-\(.*\)\.sql/\1/"`; \
dh_link usr/share/zoneminder/$$sqlfile \
usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$$lnk; \
done || true
override_dh_fixperms:
dh_fixperms