[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

tetex-base rules file



Ages ago I said I'd send the rules file I put together for
building the tetex-base packages, but I don't think I ever
actually did so.

I'm attaching it to this message.  Note that the reason I never
checked it into the CVS repository is that it creates packages
with slightly different contents than the old rules file.  I never
managed to find the time to do enough of an analysis of those
differences to convince me that it was completely ready for use.

Sorry I haven't been more active; I'm finding my job more draining
than I expected.  My machine also appears to be stunningly slow,
making it less than attractive for building teTeX time and again.
I'm hoping that both of these problems will ease up early next
year.

If you have any questions about the way this rules file works,
I'll do my best to answer them.

   Claire

#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

# Heavily updated to take advantage of debhelper
#  by C.M. Connelly <cmc@debian.org> on 2002 April 27.

# $Id$


# Uncomment this to turn on verbose mode. 
export DH_VERBOSE=1

SHELL = /bin/bash

package=tetex-base

build: build-stamp

build-stamp:
	dh_testdir

# Make sure all our expected symlinks are in place
	debian/restore-symlinks
# If this were a binary package, we would run configure and make now.

	touch build-stamp


### Clean up the source tree.

clean:
	dh_testdir
	dh_testroot

# Remove build-stamp.
	-rm -f build-stamp

# Make sure that our build scripts are executable.

	chmod +x debian/restore-symlinks
	chmod +x debian/remove-bad-license-files

# Make sure all our expected symlinks are in place.
	debian/restore-symlinks

# Remove any CVS directories that may be present in the source tree.
	-rm -rf debian/tmp `find debian/* -type d ! -name CVS `

# Remove files that we can't distribute if they're still in the tree
	debian/remove-bad-license-files

# Run dh_clean to clean up the source tree.
	dh_clean ./files* ./debian/files*


### Install the files for the packages.

install: build
# Make sure we're in the right directory and that we have root-like privileges.
	dh_testdir
	dh_testroot

	dh_clean -k

# We shouldn't need these lines -- the things they do should be taken
#   care of by the clean target.
#CMC#	-rm -rf debian/tmp `find debian/* -type d`
#CMC#	-rm -f files.* debian/*.files

# Install the directories listed in debian/*dirs into package subdirectories.
	dh_installdirs -A

## Create a list of all files and links.
	find ./texmf/ -path ./texmf/source -prune -o -type f -print -o -type l -print > files.all

# Filter nonfree

# If we had a tetex-nonfree package, we'd pull the names of the files
#   that would go in that package here.


# Create a list of documentation files.

## Generate the pattern on-the-fly, catching some stuff we may have
## been missing.
	(docpattern=`find ./texmf/doc -mindepth 1 -maxdepth 1 -type d -print | \
		sed -e 's#\.#|#' | \
		awk -F"\n" '{ORS="";print $$1}' | \
		sed -e 's/^|//'` && \
	grep -E "$$docpattern" files.all > files.doc)

# Create a list of files less documentation files.
	sort files.all files.doc | uniq -u > files.all-doc

# Change the pathnames of the files in files.doc and put the result
# into a debian/tetex-doc file list.
	sed -e "s#^\./#/usr/share/#g" files.doc | \
	sed -e "s#usr/share/texmf/doc#usr/share/doc/texmf#g" > \
	debian/tetex-doc.files


# Create a list of files for tetex-extra.
	grep -E "/bluesky/|/fonts/.*/(adobe|bitstrea)/|/fonts/.*/(cmextra|gothic|pandora|concrete|rsfs|stmary|bbold|bbm|wasy)/|/fonts/.*/(ec|tc)/|/fonts/.*/ams/|/fonts/.*/sauter|/fonts/.*/urw/|/french/|/hoekwater/|/omega/|/tex/.*/pictex/|/tex/amstex/|/texmf/.*/pstricks/|/texmf/.*/texdraw/|/texmf/.*/xypic/|/texmf/bibtex/|/texmf/metapost/" files.all-doc > files.extra

# Drop docs and extra from a list.
	sort files.all-doc files.extra | uniq -u > files.all-doc-extra

# Create a list of base files.
	grep -E "/tex/latex/(base|config|tools|graphics|mfnfss)|/fonts/.*/(public/latex|mflogo)" files.all-doc-extra > files.base
	sort files.all-doc-extra files.base | uniq -u > files.all-doc-extra-latexbase

# Append files with /tex/latex in their paths to files.extra
	grep -E "/tex/latex" files.all-doc-extra-latexbase >> files.extra

# Process files.extra into a debian/tetex-extra.files file that can be
# used by dh_movefiles.

	sed -e "s#^\.#usr/share#" files.extra > debian/tetex-extra.files


# Install tetex-base.

# Copy the whole texmf tree to the install directory.
	cp -a texmf debian/tmp/usr/share/

# Remove a source subdirectory, if it exists.
	rm -rf debian/tmp/usr/share/texmf/source

# Remove any texinfo-related files.
	rm -rf debian/tmp/usr/share/texmf/tex/texinfo

# Remove any web2c files. 
	rm -rf debian/tmp/usr/share/texmf/web2c

# Move the xdvi app-defaults file to the correct location and create a
#  link to it in its old location.
	mv debian/tmp/{usr/share/texmf/xdvi,etc/X11/app-defaults}/XDvi
	ln -s /etc/X11/app-defaults/XDvi debian/tmp/usr/share/texmf/xdvi

# Move the dvips configuration directory to /etc/texmf and create a link.
	mv debian/tmp/{usr/share/texmf/dvips/config,etc/texmf/dvips}
	ln -s /etc/texmf/dvips debian/tmp/usr/share/texmf/dvips/config

# Move and link the METAFONT modes file.
	mv debian/tmp/{usr/share/texmf/metafont/misc/modes.mf,etc/texmf/}
	ln -s /etc/texmf/modes.mf debian/tmp/usr/share/texmf/metafont/misc

# Move and link language.dat.
	mv debian/tmp/{usr/share/texmf/tex/generic/config/language.dat,etc/texmf/} 
	ln -s /etc/texmf/language.dat debian/tmp/usr/share/texmf/tex/generic/config/

# Move pdftex/config to /etc/texmf and link it back.
	mv debian/tmp/{usr/share/texmf/pdftex/config,etc/texmf/pdftex}
	ln -s /etc/texmf/pdftex debian/tmp/usr/share/texmf/pdftex/config

# Move the documentation directory from the texmf tree to /usr/share/doc
	mv debian/tmp/usr/share/{texmf/doc,doc/texmf}

# Move the helpindex.html file to /var/lib/texmf (where it can be
# safely updated without violating the FHS), and link it back to
# /usr/share/doc/texmf.
	mv debian/tmp/{usr/share/doc/texmf/helpindex.html,var/lib/texmf}
	ln -s /var/lib/texmf/helpindex.html debian/tmp/usr/share/doc/texmf

# Create a link within the texmf tree to the documentation.
	ln -s /usr/share/doc/texmf debian/tmp/usr/share/doc/texmf/doc

# Create a link within the package doc directory to the documentation.
	ln -s /usr/share/doc/texmf/ debian/tmp/usr/share/doc/tetex-base/texmf

# Copy the dhelp definition file to the package documentation directory.
	cp debian/dhelp debian/tmp/usr/share/doc/tetex-base/.dhelp

# Copy the LPPL file to /usr/share/doc/tetex-base.
	cp -p texmf/doc/latex/base/lppl.txt debian/tmp/usr/share/doc/tetex-base

# Remove the out-of-date ls-R file from /usr/share/texmf and create a
# link to one in /var/lib/texmf that we can update without violating
# the FHS.
	rm -f debian/tmp/usr/share/texmf/ls-R
	ln -s /var/lib/texmf/ls-R debian/tmp/usr/share/texmf

# Remove the xdvi.cfg file from the texmf tree.
	rm -f debian/tmp/usr/share/texmf/xdvi/xdvi.cfg

# Do something about making the mkhtml script usable.
## We should move this binary to tetex-bin, really, but at least into
## an appropriate directory.  In the meantime, we'll leave it where it
## is.
#	chmod +x debian/tmp/usr/share/texmf/doc/mkhtml

## Done installing tetex-base!


# Install tetex-extra and tetex-doc (and tetex-nonfree, if we had such
# a thing).

	dh_movefiles


binary-indep: build install
	dh_testdir -i
	dh_testroot -i

# Build preinst script for tetex-base.
	m4 -DTETEX_BASE debian/tetex-preinst.m4 > debian/preinst

# Build preinst script for tetex-extra.
	m4 debian/tetex-preinst.m4 > debian/tetex-extra.preinst

# Install debconf config and template files.
#       dh_installdebconf -i

# Install documentation (also creates /usr/share/doc/<package>
# directories).
	dh_installdocs -i

# Remove the /usr/share/doc/{tetex-extra,tetex-doc} directories and
# replace them with links to the /usr/share/doc/tetex-base directory
# (so all are identical).
	rm -rf debian/tetex-doc/usr/share/doc/tetex-doc
	rm -rf debian/tetex-extra/usr/share/doc/tetex-extra
	ln -s /usr/share/doc/tetex-base debian/tetex-extra/usr/share/doc/tetex-doc
	ln -s /usr/share/doc/tetex-base debian/tetex-extra/usr/share/doc/tetex-extra
# Install any example files.
#	dh_installexamples -i

# Install upstream changelog.
	dh_installchangelogs texmf/ChangeLog -p tetex-base

# Install menu files.
#	dh_installmenu -i
#
# Install cron files.
	dh_installcron -i
#
# Strip executables (but there aren't any).
#	dh_strip
#
# Compress files in tetex-doc.
## (dh_compress does -9 level compression.)
#	find debian/tetex-doc/usr/share/doc -name "*dvi" -exec gzip -9 {} \;
	dh_compress -i -p tetex-doc
#
# Install some other stuff we don't have.
#       dh_installlogrotate -i
#       dh_installemacsen -i
#       dh_installpam -i
#       dh_installmime -i
#       dh_installinit -i
#
# Install manpages.
## There are none now, but if we fix the mkhtml situation without
## moving the script to tetex-bin, there will be need to be a manpage.
#	dh_installman -i
#	dh_undocumented -i
#
# Install any info files.
	dh_installinfo -i

# Fix permissions.
	dh_fixperms -i

# Register any suid programs.
#  (There are none.)
#	dh_suidregister

# Generate shared-library dependencies.
#   (No libraries in this package.)
#	dh_shlibdeps

# Generate and install the package control file.
	dh_gencontrol -i

# Generate shlibs file for shared libaries.
#   (Still no libraries in this package.)
#	dh_makeshlibs -V

# Install files into the DEBIAN directories.
	dh_installdeb -i

# Generate the DEBIAN/md5sums files.
	dh_md5sums -i

# Build the debs.
	dh_builddeb -i

# Beep to let the builder know we're done.
	echo -en "\a"

binary-arch: build

# There are no architecture-dependent files generated by this package.
# If there were any they would be made here.

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
 Man cannot be civilised, or be kept civilised by what he does in his
	    spare time; only by what he does as his work.
			     W.R. Lethaby
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  C.M. Connelly               c@eskimo.com                   SHC, DS
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

Reply to: