]> git.donarmstrong.com Git - roundcube.git/blobdiff - debian/rules
Move .htaccess to /etc/roundcube and use a symlink (Closes: #591369).
[roundcube.git] / debian / rules
index 2dd606a9b053ba8a8407da01061bc4ec907edd75..d521ef136760eed3b5dff32b3c7af6c9e9bef90f 100755 (executable)
@@ -1,66 +1,59 @@
 #!/usr/bin/make -f
-# -*- makefile -*-
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
-       dh_testdir
-       touch configure-stamp
-
-
-build: build-stamp
-
-build-stamp: configure-stamp 
-       dh_testdir
-       touch $@
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp configure-stamp
-       dh_clean 
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-       install -m 0644 $(CURDIR)/index.php $(CURDIR)/debian/roundcube/usr/share/roundcube
-       cp -r $(CURDIR)/program $(CURDIR)/debian/roundcube/usr/share/roundcube
-       rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/{Auth,DB,DB.php,Mail,Net,PEAR.php}
-       cp -r $(CURDIR)/skins $(CURDIR)/debian/roundcube/usr/share/roundcube
-       find $(CURDIR)/debian/roundcube/usr/share/roundcube -type f -print0 | xargs -0 chmod 644
-
-       cp $(CURDIR)/config/*.php $(CURDIR)/debian/roundcube/usr/share/roundcube/config
-       install -m 0644 $(CURDIR)/debian/conf/apache.conf $(CURDIR)/debian/roundcube/etc/roundcube
-       install -m 0640 $(CURDIR)/debian/conf/db.inc.php $(CURDIR)/debian/roundcube/etc/roundcube
-       install -m 0640 $(CURDIR)/debian/default $(CURDIR)/debian/roundcube/etc/default/roundcube.default
-
-       install -m 0644 $(CURDIR)/SQL/mysql.initial.sql $(CURDIR)/debian/roundcube/usr/share/dbconfig-common/data/roundcube/install/mysql
-       install -m 0644 $(CURDIR)/SQL/postgres.initial.sql $(CURDIR)/debian/roundcube/usr/share/dbconfig-common/data/roundcube/install/pgsql
-       install -m 0644 $(CURDIR)/SQL/sqlite.initial.sql $(CURDIR)/debian/roundcube/usr/share/dbconfig-common/data/roundcube/install/sqlite
-
-
-binary-indep: build install
-
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs CHANGELOG
-       dh_installdocs
-       dh_installlogrotate
-       dh_install
-       dh_installcron
-       dh_installdebconf       
-       dh_compress
-       dh_fixperms
-       dh_installdeb
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+include /usr/share/cdbs/1/rules/debhelper.mk
+
+DEB_INSTALL_CHANGELOGS_ALL=CHANGELOG
+
+# 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-core::
+       # Remove plugins
+       rm -rf $(CURDIR)/debian/roundcube-core/usr/share/roundcube/plugins
+
+       # Symlink all that is in /usr/share/roundcube to /var/lib/roundcube
+       find debian/roundcube-core/usr/share/roundcube -maxdepth 1 -mindepth 1 | \
+       while read i; do \
+               if [ ! -L "$$i" ]; then \
+                 dh_link -proundcube-core "`echo "$$i" | sed -e s#debian/roundcube-core/##`" \
+                 "`echo "$$i" | sed -e s#debian/roundcube-core/usr/share/roundcube/#var/lib/roundcube/#`"; \
+               fi \
+       done
+       # Install config files
+       install -m 0640 $(CURDIR)/config/db.inc.php.dist $(CURDIR)/debian/roundcube-core/etc/roundcube/db.inc.php
+       install -m 0640 $(CURDIR)/config/main.inc.php.dist $(CURDIR)/debian/roundcube-core/usr/share/roundcube
+       install -m 0640 $(CURDIR)/.htaccess $(CURDIR)/debian/roundcube-core/etc/roundcube/htaccess
+       for c in $(CURDIR)/debian/roundcube-core/etc/roundcube/*.php; do \
+               dh_link -proundcube-core etc/roundcube/$$(basename $$c) var/lib/roundcube/config/$$(basename $$c) ; \
+       done
+       dh_link -proundcube-core etc/roundube/htaccess var/lib/roundcube/.htaccess
+
+       # Database related files
+       # Install empty tables and updates for each db type
+       install -m 0644 $(CURDIR)/SQL/mysql.initial.sql $(CURDIR)/debian/roundcube-core/usr/share/dbconfig-common/data/roundcube/install/mysql
+       install -m 0644 $(CURDIR)/SQL/postgres.initial.sql $(CURDIR)/debian/roundcube-core/usr/share/dbconfig-common/data/roundcube/install/pgsql
+       install -m 0644 $(CURDIR)/SQL/sqlite.initial.sql $(CURDIR)/debian/roundcube-core/usr/share/dbconfig-common/data/roundcube/install/sqlite
+
+       # Old database upgrades
+       cp -r $(CURDIR)/debian/sql/* $(CURDIR)/debian/roundcube-core/usr/share/dbconfig-common/data/roundcube/upgrade/.
+
+       # Some files are executable while not being scripts or binary...
+       find $(CURDIR)/debian/roundcube-core/usr/share/roundcube -type f -print0 | xargs -r0 chmod -x
+       # Remove useless file
+       rm $(CURDIR)/debian/roundcube-core/usr/share/roundcube/bin/*.sh
+       find $(CURDIR)/debian/roundcube-core -name '._*' -print0 | xargs -r0 rm
+       find $(CURDIR)/debian/roundcube-core -name '*.js.src' -print0 | xargs -r0 rm
+       # Remove files shipped in tinymce package
+       rm -rf $(CURDIR)/debian/roundcube-core/usr/share/roundcube/program/js/tiny_mce
+       dh_link -proundcube-core usr/share/tinymce/www usr/share/roundcube/program/js/tiny_mce
+       # Remove jquery as well
+       rm $(CURDIR)/debian/roundcube-core/usr/share/roundcube/program/js/jquery-1.4.min.js
+       dh_link -proundcube-core usr/share/javascript/jquery/jquery.min.js usr/share/roundcube/program/js/jquery-1.4.min.js
+
+$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/% :
+       install -d $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/bug/$(cdbs_curpkg)
+       install -m 644 $(CURDIR)/debian/bug.control $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/bug/$(cdbs_curpkg)/control
+
+clean::
+       debconf-updatepo