madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

host moved to lotus
[cv.git] / Makefile
1 OMPONENTS = cv tech-profile refs
2 LANGUAGES = en
3
4 RST2HTML = rst2html
5 RST2HTML_OPTS = --tab-width=2 --initial-header-level=2 --link-stylesheet
6 RST2HTML_OPTS := $(RST2HTML_OPTS) --cloak-email-addresses
7
8 SUFFIX = html
9
10 .PHONY: all
11 all: $(addsuffix .$(SUFFIX), $(foreach l,$(LANGUAGES),$(addsuffix .$(l),$(COMPONENTS))))
12         for l in $(LANGUAGES); do \
13                 for c in $(COMPONENTS); do \
14                         ln -sf $$c.$$l.$(SUFFIX) $$c.$(SUFFIX).$$l; \
15                 done; \
16         done
17         chmod -R u=rwX,og=rX .
18         find . -type d -exec chmod g+s {} \;
19         find . -type d -name .svn -exec chmod og= {} \;
20         chown -R --reference=. .
21         chgrp -R --reference=. .
22         $(MAKE) cv_martin-f-krafft.zip
23
24 cv_martin-f-krafft.zip: DIR = $(patsubst %.zip,%,$@)
25 cv_martin-f-krafft.zip: $(wildcard *.$(SUFFIX) *.css *.png *.pdf)
26         mkdir --parent $(DIR)
27         ln -f $^ $(DIR)
28         zip -r $@ $(DIR)
29         rm -r $(DIR)
30         chmod 644 $@
31
32 .PHONY: pdfs
33 pdfs: $(patsubst %.ps,%.pdf,$(wildcard *.ps))
34
35 .PHONY: refs
36 refs: $(patsubst %.rst,%.$(SUFFIX),$(wildcard ref-*.rst))
37
38 %.pdf: %.ps
39         ps2pdf -dEmbedAllFonts=true -dCompressPages=true -dUseFlatCompression=true \
40                 -dAutoFilterColorImages=false -sColorImageFilter=FlateEncode $< $@
41
42 cv.en.% refs.en.%: RST2HTML_OPTS := $(RST2HTML_OPTS) --stylesheet=cv.css --language=en
43 tech-profile.en.%: RST2HTML_OPTS := $(RST2HTML_OPTS) --stylesheet=tech-profile.css --language=en
44 refs.en.%: RST2HTML_OPTS := $(RST2HTML_OPTS) --stylesheet=refs.css --language=en
45 ref-%: RST2HTML_OPTS := $(RST2HTML_OPTS) --stylesheet=ref.css --language=en
46
47 %.$(SUFFIX): %.rst
48         $(RST2HTML) $(RST2HTML_OPTS) $< > $@
49         sed -i -e 's,text/html,application/xhtml+xml,' \
50                                  -e 's,XHTML 1\.0 Transitional,XHTML 1.0 Strict,' \
51                                  -e 's,xhtml1-transitional,xhtml1-strict,' \
52                                  -e 's,<title>Curriculum Vitae</title>,<title>CV Martin F. Krafft</title>,' \
53                                  -e 's,<title>Technical Profile</title>,<title>Tech Profile Martin F. Krafft</title>,' \
54                                  -e 's,<title>List of References</title>,<title>References Martin F. Krafft</title>,' $@
55
56 .PHONY: push
57 push: DEST_SERVER = lotus
58 push: DEST_DIR = /srv/apache2/martin-krafft.net/htdocs/cv
59 push: pdfs
60         git push
61         ssh $(DEST_SERVER) make -C $(DEST_DIR) update
62
63 .PHONY: clean
64 clean:
65         rm -f $(wildcard *.$(SUFFIX))
66         rm -f $(wildcard *.zip)
67         find . -type l -exec rm {} \;
68
69 .PHONY: update
70 update:
71         git pull
72         $(MAKE)