summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/pgf/Makefile.pgf_release
blob: 611a617153683b7d94ed9e3a78b382242bc6c733 (plain)
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# release script which generates a TDS zip file.
#
# DO NOT invoke this from a pgf directory, 
# use 
# make -f pgf/scripts/pgf/Makefile.pgf_release
# 
# use
# make -f pgf/scripts/pgf/Makefile.pgf_release upload USER=cfeuersaenger
# to (a) create a current snapshot as-is and (b) upload it to 
# http://pgf.sourceforge.net/
#
# Note that the index.php on sourceforge expects VERSION=_CVS .
#

VERSION=_$(shell git --git-dir=pgf/.git describe --abbrev=0 --tags)

USER=cfeuersaenger

ZIP=pgf$(VERSION).tds.zip
CTANZIP=pgf$(VERSION).ctan.flatdir.zip
PDF=pgf$(VERSION).pdf
CHANGELOG=pgf$(VERSION).ChangeLog

files: zip ctanzip pdf $(CHANGELOG)

zip: $(ZIP)

pdf: $(PDF)

upload: $(ZIP) $(PDF) $(CHANGELOG)
	scp $^ $(USER),pgf@web.sourceforge.net:htdocs/

FORCE:

$(ZIP): FORCE
	# collect into /tmp/pgf:
	rm -fr /tmp/pgf /tmp/$@
	rsync --copy-links \
		--exclude=CVS \
		--exclude=.git \
		--exclude='.*.sw?' \
		--exclude='*.aux' \
		--exclude='*.log' \
		--exclude='*~' \
		--exclude='*.bbl' \
		--exclude='*.blg' \
		--exclude='*.idx' \
		--exclude='*.ilg' \
		--exclude='*.log' \
		--exclude='*.ind' \
		--exclude='*.toc' \
		--exclude='*.out' \
		--exclude='*.djs' \
		--exclude='*.tmp' \
		--exclude='*.tuo' \
		--exclude='*.tui' \
		--exclude='*.top' \
		--exclude='*.pgf' \
		--exclude='*.mp' \
		--exclude='.#*' \
		--exclude='.gitignore' \
		--exclude='.cvsignore' \
		--exclude='Makefile.pgf_release' \
		-r pgf /tmp
	# cleanup docs:
	cp /tmp/pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual.pdf /tmp/pgf/doc/generic/pgf/pgfmanual.pdf
	make -C /tmp/pgf/doc/generic/pgf/version-for-dvipdfm/en clean
	make -C /tmp/pgf/doc/generic/pgf/version-for-dvipdfmx/en clean
	make -C /tmp/pgf/doc/generic/pgf/version-for-dvips/en clean
	make -C /tmp/pgf/doc/generic/pgf/version-for-tex4ht/en clean
	make -C /tmp/pgf/doc/generic/pgf/version-for-vtex/en clean
	make -C /tmp/pgf/doc/generic/pgf/version-for-xetex/en clean
	make -C /tmp/pgf/doc/generic/pgf/version-for-luatex/en clean
	make -C /tmp/pgf/doc/generic/pgf/version-for-pdftex/en clean
	# now restructure to get TDS:
	cd /tmp/pgf; \
		rm -f README.md; \
		rm -f .travis.yml; \
		rm -f .gitignore; \
		rm -rf .github; \
		rm -rf ci; \
		rm -rf experiments; \
		rm -rf scripts; \
		rm -f doc/generic/pgf/version-for-dvips/en/pgfmanual-test*; \
		rm -f doc/generic/pgf/version-for-dvisvgm/en/color.cfg; \
		rm README; \
		mv README-3.0.0 doc/generic/pgf;
	# clean-up tests:
	make -C /tmp/pgf/source/generic/pgf/testsuite/external clean
	rm -f /tmp/pgf/source/generic/pgf/testsuite/mathtest/pgfmathtestsuite.pdf
	# generate FILES file:
	cd /tmp && find pgf -type f > /tmp/pgf/doc/generic/pgf/FILES
	# generate zip archive:
	cd /tmp/pgf && zip -r /tmp/$@ *
	# copy archive to make target:
	cp /tmp/$@ $@
	# show file size(s)
	find `pwd` -maxdepth 1 \( -name '$(@:.zip=)*' \) -ls

ctanzip: $(CTANZIP)

# code to satisfy http://www.ctan.org/upload ...
$(CTANZIP): $(ZIP)
	cd /tmp && zip -r $(abspath $@) pgf pgf.tds.zip
	rm -fr /tmp/pgf /tmp/pgf.ctan.tmp $@
	mkdir -p /tmp/pgf /tmp/pgf.ctan.tmp
	cd /tmp/pgf.ctan.tmp && unzip $(abspath $(ZIP))
	mv /tmp/pgf.ctan.tmp/doc/generic/pgf/README /tmp/pgf
	mv /tmp/pgf.ctan.tmp/doc/generic/pgf /tmp/pgf/doc
	cp $(ZIP) /tmp/pgf.tds.zip
	mkdir /tmp/pgf/tex
	mkdir /tmp/pgf/source
	find /tmp/pgf.ctan.tmp/tex \( -type f ! -name '*.lua' \) -exec mv -i {} /tmp/pgf/tex \;
	#
	# try to make the .lua files "browsable" without throwing all in one dir...
	mkdir -p /tmp/pgf/lua/graphdrawing /tmp/pgf/lua/luamath /tmp/pgf/lua/generic
	cd /tmp/pgf.ctan.tmp/tex/generic/pgf/graphdrawing/lua && find -name '*.lua' | rsync -r --include-from - . /tmp/pgf/lua/graphdrawing
	cd /tmp/pgf.ctan.tmp/tex/generic/pgf/libraries/luamath && find -name '*.lua' | rsync -r --include-from - . /tmp/pgf/lua/luamath
	cd /tmp/pgf.ctan.tmp/tex/generic/pgf/lua && find -name '*.lua' | rsync -r --include-from - . /tmp/pgf/lua/generic
	#
	find /tmp/pgf.ctan.tmp/tex -name '*.lua' -delete
	find /tmp/pgf.ctan.tmp/source \( -type f ! -name Makefile \) -exec mv -i {} /tmp/pgf/source \;
	find /tmp/pgf.ctan.tmp/source -name 'Makefile' -delete
	#
	# I suppose this here is more or less empty anyway, but who cares:
	find /tmp/pgf.ctan.tmp/doc -type f -exec mv -i {} /tmp/pgf/doc \;
	# 
	# CTAN wishes to not have empty directories (version-for-*/en/plots):
	find /tmp/pgf/doc -type d -exec rmdir {} \; > /dev/null 2>&1 || true
	#
	@# for some reason, CVS checks out some of the math*.tex files as executable which confuses the CTAN file checker:
	find /tmp/pgf/tex -type f -exec chmod 06444 {} \;
	rm /tmp/pgf/doc/INSTALL
	echo "Please search for pgf.tds.zip and install that one into a local texmf branch (which is typically simpler). This release is intended to satisfy CTAN package browsing policies." > /tmp/pgf/INSTALL_NOTES
	@NUM_FILES=$$(find /tmp/pgf.ctan.tmp/ -type f |wc -l); \
	if [ $$NUM_FILES -gt 0 ]; then echo "INTERNAL FAILURE: $$NUM_FILES FILES LEFT OVER IN /tmp/pgf.ctan.tmp! All must be included into $@. Left-overs:"; find /tmp/pgf.ctan.tmp/ -type f; exit 1; fi
	cd /tmp && zip -r $(abspath $@) pgf pgf.tds.zip

$(CHANGELOG): FORCE
	cp pgf/doc/generic/pgf/ChangeLog $(CHANGELOG)

$(PDF): pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual.pdf
	cp $< $@