1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
#!/usr/bin/make -f
# rules file for sgml-data
#
# I do not use debstd, debhelper, or any of that stuff.
# I believe in stripped down rules files; nothing that is not required
# I believe in readability through abstraction
#
# Some bytes in this file may have been touched by Ian Jackson,
# so I can never remove his name from this file. Oh boy.
package := sgml-data
# directory abstraction
PREFIX := debian/tmp
libdir := $(PREFIX)/usr/lib/$(package)
sgmldir := $(PREFIX)/usr/lib/sgml
docdir := $(PREFIX)/usr/doc/$(package)
install_file := install -o root -g root -m 644 --preserve-timestamps
install_program := install -o root -g root -m 755 --preserve-timestamps
make_dir := install -d -o root -g root -m 755
compress := gzip -9f
build:
touch build
clean:
$(checkdir)
rm -f build
find . -name "*~" | xargs rm -f
rm -rf $(PREFIX)
rm -f debian/files* core debian/substvars
binary-indep: build
$(checkdir)
$(make_dir) $(PREFIX)
$(make_dir) $(libdir) $(docdir)
$(make_dir) $(sgmldir)/dtd $(sgmldir)/entities $(sgmldir)/declaration
# The SGML catalog
$(install_file) sgml.catalog $(libdir)
# The DTDs
set -e; for file in dtd/*; do \
[ -f $$file ] && \
$(install_file) $$file $(sgmldir)/dtd ;\
done
# The entities
set -e; for file in entities/*; do \
[ -f $$file ] && \
$(install_file) $$file $(sgmldir)/entities ;\
done
# The declarations
set -e; for file in declarations/*; do \
[ -f $$file ] && \
$(install_file) $$file $(sgmldir)/declaration ;\
done
# compatability links
ln -s html-4.decl $(sgmldir)/declaration/html.decl
$(make_dir) $(sgmldir)/sgml
set -e; for file in $(sgmldir)/declaration/*; do \
fbase=`basename $$file` ;\
ln -s ../declaration/$$fbase $(sgmldir)/sgml/$$fbase ;\
done
# The checker script, until this gets added to sgml-base
$(install_program) sgml-catalog-check.pl $(libdir)
# Now create all the nice links as specified in SGML FS Guidelines
./sgml-catalog-check.pl -l -v 0
# move in documentation
$(install_file) debian/README.Debian debian/TODO.Debian \
debian/copyright $(docdir)
$(install_file) debian/changelog $(docdir)/changelog
# compress docdir (policy)
#find $(infodir) $(mandir) -type f | xargs $(compress)
find $(docdir) -type f \( -size +4k -or -name "changelog*" \) \
! -name "*.html" ! -name "*.gif" \
! -name "copyright" | xargs $(compress)
# move in control files
$(make_dir) $(PREFIX)/DEBIAN
$(install_program) debian/postinst debian/postrm $(PREFIX)/DEBIAN
# check for bad links
if [ `symlinks -r debian/tmp | grep dangling | wc -l` -gt 0 ] ;\
then \
exit 1 ;\
fi
dpkg-gencontrol -isp
chmod g-w $(PREFIX)/DEBIAN/control
dpkg --build $(PREFIX) ..
binary-arch: checkroot build
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
define checkdir
test -f sgml.catalog
test -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|