#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DESTDIR = $(CURDIR)/debian/tmp DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl XP = xsltproc --nonet %: dh $@ override_dh_auto_clean: find . -name *.pyc | xargs rm -f rm -rf build dh_auto_clean debian/chemstruc.1: debian/manpage.xml cd debian; $(XP) $(DB2MAN) manpage.xml override_dh_auto_configure: mkdir -p build cd build; cmake -DCMAKE_INSTALL_PREFIX=$(DESTDIR)/usr .. override_dh_auto_build: debian/chemstruc.1 ## do nothing since install would run the build again. ## cd build; make override_dh_auto_install: cd build; make install install -d $(DESTDIR)/usr/share/ install -m 755 convert.cgi $(DESTDIR)/usr/share/chemical-structures install -m 644 index.html $(DESTDIR)/usr/share/chemical-structures install -d $(DESTDIR)/usr/bin install -m 755 chemstruc $(DESTDIR)/usr/bin install -d $(DESTDIR)/etc/apache2/conf-available install -m 644 apache.conf $(DESTDIR)/etc/apache2/conf-available/chemical-structures.conf rm -f $(DESTDIR)/usr/share/chemical-structures/jmol/LICENSE.txt sh removeMolTimestamp $(DESTDIR)/usr/share/chemical-structures override_dh_install: # take in account d/*.install files dh_install # create necessary subdirectories under /usr/share/chemical-structures # for the package chemical-structures. for d in $$(find debian/chemical-structures-data/usr/share/chemical-structures -maxdepth 1 -mindepth 1 -type d); do \ e=$$(echo $$d| sed 's/chemical-structures-data/chemical-structures/'); \ install -d $$e; \ done # move every HTML file from chemical-structures-data to # chemical-structures. # first, from the molecules families' subdirectories: for f in $$(find debian/chemical-structures-data/usr/share/chemical-structures/*/*.html); do \ g=$$(echo $$f| sed 's/chemical-structures-data/chemical-structures/'); \ echo "$$(basename $$f): chemical-structures-data ==> chemical-structures"; \ mv $$f $$g; \ done # then from the top directory, and including the gci script. for f in $$(find debian/chemical-structures-data/usr/share/chemical-structures -maxdepth 1 -type f); do \ g=$$(echo $$f| sed 's/chemical-structures-data/chemical-structures/'); \ mv $$f $$g; \ done