| 1 |
jfs |
1230 |
#
|
| 2 |
|
|
# Makefile for the Securing Debian HOWTO (copied from Makefile.intln)
|
| 3 |
|
|
#
|
| 4 |
|
|
# Should work both for a manual in the Debian Documentation Project
|
| 5 |
joy |
1735 |
# manuals.sgml tree, and for the package build.
|
| 6 |
jfs |
1067 |
|
| 7 |
jfs |
1230 |
##### CONF PART
|
| 8 |
|
|
# this can and will be overriden by a higher level makefile
|
| 9 |
joy |
1926 |
PUBLISHDIR := /org/www.debian.org/www/doc/manuals
|
| 10 |
jfs |
1067 |
|
| 11 |
jfs |
1230 |
# Darn, I should have named dir and file the same way
|
| 12 |
|
|
#MANUAL = $(notdir $(shell pwd))
|
| 13 |
|
|
MANUAL = securing-debian-howto
|
| 14 |
jfs |
1067 |
|
| 15 |
opal |
1666 |
LNPUBDIRMAN=$(PUBLISHDIR)/$(MANUAL)/
|
| 16 |
|
|
|
| 17 |
jfs |
1230 |
# The cannonical language, in which the original document is
|
| 18 |
|
|
ORIG_LANG=en
|
| 19 |
|
|
# list of langs (above the canonical one)
|
| 20 |
|
|
# LANGS=$(shell ls $(MANUAL).*.sgml|sed 's/.*$(MANUAL)\.\([^.]*\)\.sgml/\1/')
|
| 21 |
|
|
#
|
| 22 |
|
|
# Since portuguese is not yet in debiandoc format we cannot publish it until it is
|
| 23 |
|
|
#
|
| 24 |
jfs |
2485 |
LANGS = es ja ru it de fr
|
| 25 |
jfs |
1067 |
|
| 26 |
jfs |
1230 |
EXTS=txt info
|
| 27 |
|
|
##### END OF CONF PART CHANGE THE END AT YOU OWN RISK
|
| 28 |
jfs |
1067 |
|
| 29 |
jfs |
1230 |
# what will be built
|
| 30 |
|
|
HTMLDIRS=$(MANUAL).html $(foreach lang,$(LANGS),$(MANUAL).$(lang).html)
|
| 31 |
|
|
ALLFILES=$(foreach ext,$(EXTS),\
|
| 32 |
|
|
$(MANUAL).$(ORIG_LANG).$(ext)\
|
| 33 |
|
|
$(foreach lang,$(LANGS),$(MANUAL).$(lang).$(ext))\
|
| 34 |
|
|
)
|
| 35 |
jfs |
1067 |
|
| 36 |
jfs |
1230 |
|
| 37 |
|
|
#====[ build rules ]===========================================================
|
| 38 |
|
|
# generate anything some dirs want version.ent to be builded, some not
|
| 39 |
|
|
|
| 40 |
|
|
DEBIAN=$(wildcard debian)
|
| 41 |
|
|
ifeq ($(DEBIAN),"debian")
|
| 42 |
|
|
all: version.ent $(HTMLDIRS) $(ALLFILES)
|
| 43 |
|
|
else
|
| 44 |
|
|
all: $(HTMLDIRS) $(ALLFILES)
|
| 45 |
|
|
endif
|
| 46 |
|
|
|
| 47 |
|
|
version.ent: debian/changelog
|
| 48 |
|
|
./debian/rules $@
|
| 49 |
|
|
|
| 50 |
|
|
#----[ generating HTML ]-------------------------------------------------------
|
| 51 |
|
|
# for orig_lang
|
| 52 |
|
|
$(MANUAL).html: $(MANUAL).sgml
|
| 53 |
|
|
debiandoc2html -l $(ORIG_LANG) -c $<
|
| 54 |
|
|
|
| 55 |
|
|
# for translated languages
|
| 56 |
|
|
# FIXME: there is a trick because debiandoc2html does a sed 'y/.../...'
|
| 57 |
|
|
# which should be reverted to have the content negociation working.
|
| 58 |
|
|
# This trick is bad. debiandoc2html should be corrected.
|
| 59 |
|
|
$(MANUAL).%.html: $(MANUAL).%.sgml
|
| 60 |
|
|
debiandoc2html -l $* -c $<
|
| 61 |
|
|
@echo "cleaning up file extensions";\
|
| 62 |
|
|
for file in `ls $(MANUAL).$*.html/*` ; do\
|
| 63 |
|
|
newfile=`echo $$file|\
|
| 64 |
|
|
sed 's/$(shell echo $*|\
|
| 65 |
|
|
sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ_/abcdefghijklmnopqrstuvwxyz-/'\
|
| 66 |
|
|
)\.html/$*\.html/'`;\
|
| 67 |
|
|
if [ $$file != $$newfile ] ; then\
|
| 68 |
|
|
mv $$file $$newfile;\
|
| 69 |
|
|
fi\
|
| 70 |
|
|
done;
|
| 71 |
|
|
|
| 72 |
|
|
|
| 73 |
|
|
#----[ generating plain text ]-------------------------------------------------
|
| 74 |
|
|
# for orig_lang
|
| 75 |
|
|
$(MANUAL).$(ORIG_LANG).txt: $(MANUAL).sgml
|
| 76 |
|
|
debiandoc2text -l $(ORIG_LANG) -c $<
|
| 77 |
|
|
|
| 78 |
|
|
# for translated languages
|
| 79 |
|
|
$(MANUAL).%.txt: $(MANUAL).%.sgml
|
| 80 |
|
|
debiandoc2text -l $* $<
|
| 81 |
|
|
|
| 82 |
|
|
#----[ generating tov ]--------------------------------------------------------
|
| 83 |
|
|
# for orig_lang
|
| 84 |
|
|
$(MANUAL).$(ORIG_LANG).tov: $(MANUAL).sgml
|
| 85 |
|
|
debiandoc2textov -l $(ORIG_LANG) -c $<
|
| 86 |
|
|
|
| 87 |
|
|
# for translated languages
|
| 88 |
|
|
$(MANUAL).%.tov: $(MANUAL).%.sgml
|
| 89 |
|
|
debiandoc2textov -l $* $<
|
| 90 |
|
|
|
| 91 |
|
|
#----[ generating info ]-------------------------------------------------------
|
| 92 |
|
|
# for orig_lang
|
| 93 |
|
|
$(MANUAL).$(ORIG_LANG).info: $(MANUAL).sgml
|
| 94 |
|
|
debiandoc2info -l $(ORIG_LANG) -c $<
|
| 95 |
|
|
|
| 96 |
|
|
# for translated languages
|
| 97 |
|
|
$(MANUAL).%.info: $(MANUAL).%.sgml
|
| 98 |
|
|
debiandoc2info -l $* $<
|
| 99 |
|
|
|
| 100 |
|
|
#----[ generating PostScript ]-------------------------------------------------
|
| 101 |
|
|
# for orig_lang
|
| 102 |
|
|
$(MANUAL).$(ORIG_LANG).ps: $(MANUAL).sgml
|
| 103 |
|
|
debiandoc2latexps -l $(ORIG_LANG) -c $<
|
| 104 |
|
|
|
| 105 |
|
|
# for translated languages
|
| 106 |
|
|
$(MANUAL).%.ps: $(MANUAL).%.sgml
|
| 107 |
|
|
debiandoc2latexps -l $* $<
|
| 108 |
|
|
|
| 109 |
|
|
#----[ generating PDF ]--------------------------------------------------------
|
| 110 |
|
|
# for orig_lang
|
| 111 |
|
|
$(MANUAL).$(ORIG_LANG).pdf: $(MANUAL).sgml
|
| 112 |
|
|
debiandoc2latexpdf -l $(ORIG_LANG) -c $<
|
| 113 |
|
|
|
| 114 |
|
|
# for translated languages
|
| 115 |
|
|
$(MANUAL).%.pdf: $(MANUAL).%.sgml
|
| 116 |
|
|
debiandoc2latexpdf -l $* $<
|
| 117 |
|
|
|
| 118 |
|
|
#====[ publishing to the DDP web pages ]=======================================
|
| 119 |
|
|
publish: publish-html publish-files
|
| 120 |
|
|
|
| 121 |
|
|
#----[ publish html ]----------------------------------------------------------
|
| 122 |
|
|
publish-html: $(HTMLDIRS)
|
| 123 |
|
|
test -d $(PUBLISHDIR)/$(MANUAL) \
|
| 124 |
|
|
|| install -d -m 755 $(PUBLISHDIR)/$(MANUAL)
|
| 125 |
|
|
rm -f $(PUBLISHDIR)/$(MANUAL)/*.html
|
| 126 |
|
|
# install any translated html
|
| 127 |
|
|
$(foreach lang,$(LANGS),\
|
| 128 |
|
|
install -p -m 644 $(MANUAL).$(lang).html/*.html $(PUBLISHDIR)/$(MANUAL)/;)
|
| 129 |
|
|
# install original html
|
| 130 |
|
|
install -p -m 644 $(MANUAL).html/*.html \
|
| 131 |
|
|
$(PUBLISHDIR)/$(MANUAL)/
|
| 132 |
joy |
1240 |
# make the symlinks for html files
|
| 133 |
jfs |
1230 |
@$(foreach file,$(wildcard $(MANUAL).html/*.html),\
|
| 134 |
|
|
name=`echo $(file) | sed 's/$(MANUAL).html\///'`; \
|
| 135 |
|
|
link=`echo $$name|sed 's/.$(ORIG_LANG).html$$/.html/'`;\
|
| 136 |
|
|
echo "$$link -> $$name";\
|
| 137 |
joy |
1735 |
ln -sf $$name\
|
| 138 |
jfs |
1230 |
$(PUBLISHDIR)/$(MANUAL)/$$link;\
|
| 139 |
|
|
)
|
| 140 |
|
|
|
| 141 |
|
|
#----[ publish the files ]-----------------------------------------------------
|
| 142 |
|
|
publish-files: $(ALLFILES)
|
| 143 |
|
|
test -d $(PUBLISHDIR)/$(MANUAL) \
|
| 144 |
|
|
|| install -d -m 755 $(PUBLISHDIR)/$(MANUAL)
|
| 145 |
|
|
$(foreach ext,$(EXTS),\
|
| 146 |
|
|
rm -f $(PUBLISHDIR)/$(MANUAL)/*.$(ext);\
|
| 147 |
|
|
\
|
| 148 |
|
|
$(foreach lang,$(LANGS),\
|
| 149 |
|
|
install -p -m 644 $(MANUAL).$(lang).$(ext)\
|
| 150 |
|
|
$(PUBLISHDIR)/$(MANUAL)/;)\
|
| 151 |
|
|
\
|
| 152 |
|
|
install -p -m 644 $(MANUAL).$(ORIG_LANG).$(ext)\
|
| 153 |
|
|
$(PUBLISHDIR)/$(MANUAL)/;\
|
| 154 |
|
|
\
|
| 155 |
joy |
1735 |
ln -sf $(MANUAL).$(ORIG_LANG).$(ext)\
|
| 156 |
jfs |
1230 |
$(PUBLISHDIR)/$(MANUAL)/$(MANUAL).$(ext);\
|
| 157 |
|
|
)
|
| 158 |
|
|
|
| 159 |
|
|
|
| 160 |
|
|
#----[ publish the ps ]--------------------------------------------------------
|
| 161 |
|
|
publish-ps: ps
|
| 162 |
|
|
test -d $(PUBLISHDIR)/$(MANUAL) \
|
| 163 |
|
|
|| install -d -m 755 $(PUBLISHDIR)/$(MANUAL)
|
| 164 |
|
|
rm -f $(PUBLISHDIR)/$(MANUAL)/*.ps
|
| 165 |
|
|
# install any translated ps
|
| 166 |
|
|
$(foreach lang,$(LANGS),\
|
| 167 |
|
|
install -p -m 644 $(MANUAL).$(lang).ps \
|
| 168 |
|
|
$(PUBLISHDIR)/$(MANUAL)/ ;)
|
| 169 |
|
|
# install original ps
|
| 170 |
|
|
install -p -m 644 $(MANUAL).$(ORIG_LANG).ps\
|
| 171 |
|
|
$(PUBLISHDIR)/$(MANUAL)/
|
| 172 |
joy |
1240 |
# make the symlinks for ps
|
| 173 |
joy |
1735 |
ln -sf $(MANUAL).$(ORIG_LANG).ps\
|
| 174 |
jfs |
1230 |
$(PUBLISHDIR)/$(MANUAL)/$(MANUAL).ps
|
| 175 |
|
|
|
| 176 |
|
|
|
| 177 |
|
|
#====[ validating SGML ]=======================================================
|
| 178 |
jfs |
1067 |
validate:
|
| 179 |
jfs |
1230 |
set -x; for i in $(wildcard *.sgml); do nsgmls -ges -wall $$i; done
|
| 180 |
jfs |
1067 |
|
| 181 |
jfs |
1230 |
#====[ cleaning up ]===========================================================
|
| 182 |
|
|
clean distclean:
|
| 183 |
jfs |
2430 |
rm -f securing-debian-howto*.{txt,ps,dvi,pdf,info*,log,tex,aux,toc,tpt,sasp*} *~
|
| 184 |
jfs |
1264 |
rm -rf securing-debian-howto*.html
|
| 185 |
jfs |
1067 |
|
| 186 |
jfs |
1230 |
.PHONY: all html txt ps\
|
| 187 |
|
|
publish publish-html publish-txt publish-ps\
|
| 188 |
|
|
clean distclean validate
|