#!/usr/bin/make -f # # Debian build rules for s5 using debhelper # Variables also used in the get-orig-source script - keep them in sync! ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) DEB_NODOC=0 else DEB_NODOC=1 endif B=$(CURDIR)/build S=$B/s5 C=$B/cmd D=$(CURDIR)/debian/s5 DD=$D/usr/share/doc/s5 DJ=$(CURDIR)/debian/libjs-s5 J=$(DJ)/usr/share/javascript/s5 # Variables only used in the rules file REBASE= s,/usr/local/etc,/etc,g;s,/usr/local,/usr,g get-orig-source: . debian/get-orig-source.sh override_dh_auto_build: mkdir -p $C $S tar -cf - --exclude=.DS_Store --exclude=s5-blank.html *.html pix primer ui | tar -C $S -xf - cd $S && env TZ=UTC unzip -x $(CURDIR)/s5-blank.zip for p in `cat $(CURDIR)/debian/patches/series`; do \ (cd $S/s5-blank; patch -p1 < $(CURDIR)/debian/patches/$$p); \ done find $S -name __MACOSX -or -name .DS_Store | xargs rm -rf find $S -regextype posix-extended -type f -iregex '.*\.(css|htc|html|js|txt)' -print0 | xargs -0 sed -i.debbuild -e 's/ $$//' find $S -type f -name '*.debbuild' -delete sed -e '${REBASE}' debian/s5.sh > $C/s5 chmod 0755 $C/s5 sed -e '${REBASE}' debian/s5.conf > $C/s5.conf sed -e '${REBASE}' debian/s5.1 > $C/s5.1 override_dh_auto_test: mkdir '$B/test' env S5='$C/s5' S5_DIR='$S' TMPDIR='$B/test' debian/tests/blank override_dh_auto_clean: rm -rf $B override_dh_auto_install: # The actual content of the templates goes into libjs-s5. # mkdir -p $J/default mv $S/ui $J/default/ mv $S/s5-blank $J/ # Everything else is actually documentation. # ifeq (${DEB_NODOC},0) mkdir -p $(DD) (cd $B && tar -cf - s5) | tar -C $(DD)/.. -xf - endif # OK, we're almost done... # find $D $(DJ) -type d | xargs chmod 755 find $D $(DJ) -type f | xargs chmod 644 %: dh $@