#!/usr/bin/make -f # This is converted from a sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. PKG = sgmltools-lite PKGDIR = $(CURDIR)/debian/$(PKG) PKGETCDIR = $(PKGDIR)/usr/share/$(PKG) PKGDOCDIR = $(PKGDIR)/usr/share/doc/$(PKG) PKGMANDIR = $(PKGDIR)/usr/share/man DBIMAGEDIR = /usr/share/sgml/docbook/stylesheet/dsssl/modular/images/ export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s) build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: cd src && ./configure --prefix=/usr --datadir=/usr/share \ --mandir=/usr/share/man \ --with-etcsgml="/usr/share/sgmltools-lite" \ --with-dbimages="$(DBIMAGEDIR)" cd src && $(MAKE) touch build-stamp clean: rm -f build-stamp [ ! -f src/Makefile ] || $(MAKE) -C src clean sh debian/common/doclean.sh $(PKG) install: build sh debian/common/doclean.sh $(PKG) sh debian/common/installdirs.sh $(PKG) cd src && $(MAKE) install prefix=$(PKGDIR)/usr \ datadir=$(PKGDIR)/usr/share \ mandir=$(PKGDIR)/usr/share/man \ etcdir=$(PKGDIR)/usr/share/sgmltools-lite # remove extra dtd files rm -rf $(PKGDIR)/usr/share/sgml/dtd # remove extra catalog files rm -f $(PKGETCDIR)/catalog.rh71 rm -f $(PKGETCDIR)/catalog.rh62 rm -f $(PKGETCDIR)/catalog.suse # remove buildcat since Debian has sgml-base package rm -rf $(PKGDIR)/usr/bin/buildcat # replace gensgmlenv with Debian specific one cp debian/addition/gensgmlenv $(PKGDIR)/usr/bin/ # Debian does not need buildcat and we use modified gensgmlenv rm -rf $(PKGETCDIR)/catalog.d # create symlink from system supercatalog to package config dir ln -s /etc/sgml/catalog $(PKGETCDIR)/catalog # move stylesheet files mkdir -p $(PKGDIR)/usr/share/sgml/stylesheet/dsssl/ mv $(PKGDIR)/usr/share/sgml/stylesheets/sgmltools \ $(PKGDIR)/usr/share/sgml/stylesheet/dsssl/ rmdir $(PKGDIR)/usr/share/sgml/stylesheets # add Debian specific manpages cp debian/addition/*.1 $(PKGDIR)/usr/share/man/man1/ # rename the manpage of the main command mv $(PKGDIR)/usr/share/man/man1/sgmltools-lite.1 \ $(PKGDIR)/usr/share/man/man1/sgmltools.1 # add Debian specific jadewhich script mkdir -p $(PKGDIR)/usr/share/sgmltools-lite/ cp debian/addition/jadewhich $(PKGDIR)/usr/share/sgmltools-lite/ chmod a+x $(PKGDIR)/usr/share/sgmltools-lite/jadewhich # rewrite main command to use jadewhich sed -e "s:/usr/bin/.*jade:/usr/share/sgmltools-lite/jadewhich:" \ $(PKGDIR)/usr/bin/sgmltools >$(PKGDIR)/usr/bin/sgmltools.new; mv $(PKGDIR)/usr/bin/sgmltools.new $(PKGDIR)/usr/bin/sgmltools; chmod a+x $(PKGDIR)/usr/bin/* binary-indep: build install sh debian/common/installdocs.sh $(PKG) gzip -9n $(PKGDIR)/usr/share/man/man1/* install -o 0 -g 0 -p -m 644 debian/changelog $(PKGDOCDIR)/changelog.Debian install -o 0 -g 0 -p -m 644 src/ChangeLog $(PKGDOCDIR)/changelog gzip -9n $(PKGDOCDIR)/changelog* gzip -9n $(PKGDOCDIR)/README* find $(PKGDIR) -print0 | xargs -0r chown --no-dereference 0:0 find $(PKGDIR) ! -type l -print0 | xargs -0r chmod go=rX,u+rw,a-s find $(PKGDOCDIR) -type d -print0 | xargs -0r chmod 755 find $(PKGMANDIR) -type f -print0 | xargs -0r chmod 644 sh debian/common/installmaintscript.sh $(PKG) dpkg-gencontrol -P$(PKGDIR) cd $(PKGDIR) && find * -type f ! -regex '^DEBIAN/.*' -print0 |\ LC_ALL=C sort -z | xargs -0r md5sum > DEBIAN/md5sums chmod 644 $(PKGDIR)/DEBIAN/md5sums chown 0:0 $(PKGDIR)/DEBIAN/md5sums find $(PKGDIR) -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \ xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH" dpkg --build $(PKGDIR) .. binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure