| 1 |
################################################################ |
| 2 |
# make a zip for CTAN submission including the TeX directory structure. |
| 3 |
# |
| 4 |
# The overall procedure is to run make in this directory $(HERE) and then |
| 5 |
# export it to a temporary directory $(EXPORTED) without all the generated |
| 6 |
# files. On this directory we run "make ctanext" (see below) which makes a |
| 7 |
# CTAN-compliant directory structure, and zips it up to the file |
| 8 |
# <package>.ctan.zip which can be submitted to the CTAN maintainers. |
| 9 |
# |
| 10 |
# Note that part of the CTAN submission is a zip file with a TDS-compliant |
| 11 |
# directory struture, which is generated by running "make tdsext" (see below) |
| 12 |
# on $(EXPORTED). |
| 13 |
# |
| 14 |
# Note furthermore, that this Makefile only automates the top-level mechanics |
| 15 |
# of the CTAN zip files, ... It relies on the Variables set in the regular Makefiles |
| 16 |
# and in particular on their targets "ltds", "lctan", "filedate", and "checksum". |
| 17 |
################################################################ |
| 18 |
|
| 19 |
HERE = $(shell pwd) |
| 20 |
GITREPOS = $(HERE) |
| 21 |
REPOSNAME = LaTeX-proposal |
| 22 |
TMP = /tmp |
| 23 |
#TDSCOLL ?= $(shell basename $$PWD) |
| 24 |
TDSCOLL = proposal |
| 25 |
EXPORTED = $(TMP)/$(TDSCOLL).exp |
| 26 |
|
| 27 |
TDS.dir = $(TDSCOLL).tds |
| 28 |
TDSDIR = $(TMP)/$(TDS.dir) |
| 29 |
TDS.zip = $(TDS.dir).zip |
| 30 |
TDSZIP = $(TMP)/$(TDS.zip) |
| 31 |
|
| 32 |
CTANDIR = $(TMP)/$(TDSCOLL) |
| 33 |
CTAN.zip = $(TDSCOLL).ctan.zip |
| 34 |
CTANZIP = $(TMP)/$(CTAN.zip) |
| 35 |
|
| 36 |
MAKE = make |
| 37 |
|
| 38 |
# this target makes the file CTANZIP by creating and populating the directory |
| 39 |
# CTANDIR and zipping it. To be current, we first make all, and update |
| 40 |
# the filedates and the checksums. To get rid of all the junk we commit and |
| 41 |
# export a clean copy EXPORTED, on which we run the target ctanexp below, |
| 42 |
# which generates a directory CTANDIR, which we zip and move into place. |
| 43 |
ctan: all filedate checksum |
| 44 |
git commit -am'draining just to be sure for CTAN distribution' --allow-empty |
| 45 |
rm -Rf $(EXPORTED) |
| 46 |
@echo "exporting a clean copy to $(EXPORTED)" |
| 47 |
cd $(TMP);rm -Rf $(REPOSNAME);git clone $(GITREPOS);mv $(REPOSNAME) $(EXPORTED) |
| 48 |
rm -Rf $(EXPORTED)/.git |
| 49 |
find $(EXPORTED) -name ".gitignore" -delete |
| 50 |
cd $(EXPORTED);$(MAKE) -$(MAKEFLAGS) ctanext |
| 51 |
@echo "zipping the result to $(TDSCOLL).ctan.zip" |
| 52 |
cd $(TMP);zip -r $(CTANZIP) $(TDS.zip) $(TDSCOLL);cp $(CTANZIP) $(HERE) |
| 53 |
@echo "cleaning up" |
| 54 |
rm -Rf $(EXPORTED) $(CTANDIR) $(CTANZIP) $(TDSZIP) |
| 55 |
@echo "disabling checksums again for further development" |
| 56 |
$(MAKE) -$(MAKEFLAGS) disablechecksum |
| 57 |
|
| 58 |
# this target is run on EXPORTED. It first makes the target tdsext below, |
| 59 |
# and then copies all necessary stuff into CTANDIR. |
| 60 |
ctanext: tdsext |
| 61 |
@echo "making a CTAN compliant archive in $(CTANDIR)" |
| 62 |
rm -Rf $(CTANDIR) $(CTANZIP) |
| 63 |
mkdir -p $(CTANDIR) |
| 64 |
@echo " copying material from $(EXPORTED) to $(CTANDIR)" |
| 65 |
@for d in $(DTXDIRS); do (cd $$d && $(MAKE) -$(MAKEFLAGS) lctan) done |
| 66 |
@for d in $(SRCDIRS) $(DOCDIRS); do (cp -R $$d $(CTANDIR)) done; |
| 67 |
@for d in $(SRCFILES); do (cp -p $$d $(CTANDIR)) done; |
| 68 |
cp $(TDS.README) $(CTANDIR)/README |
| 69 |
|
| 70 |
# this target makes the file TDSZIP by creating and populating the directory |
| 71 |
# TDSDIR and zipping it. |
| 72 |
tdsext: |
| 73 |
@echo "making a TDS compliant archive" |
| 74 |
rm -Rf $(TDSDIR) $(TDSZIP) |
| 75 |
@echo " enabling checksums" |
| 76 |
$(MAKE) -$(MAKEFLAGS) enablechecksum |
| 77 |
@echo " copying LaTeX Sources to $(TDSDIR)" |
| 78 |
@for d in $(DTXDIRS); do (cd $$d && $(MAKE) -$(MAKEFLAGS) ltds) done |
| 79 |
@echo " copying binary dir to $(TDSDIR)" |
| 80 |
@for d in $(SRCDIRS); do (cp -R $$d $(TDSDIR)/source/latex/$(TDSCOLL)) done; |
| 81 |
@for d in $(SRCFILES); do (cp -R $$d $(TDSDIR)/source/latex/$(TDSCOLL)) done; |
| 82 |
@echo " copying documentation to $(TDSDIR)" |
| 83 |
@for d in $(DOCDIRS); do (cp -R $$d $(TDSDIR)/doc/latex/$(TDSCOLL)) done; |
| 84 |
@for d in $(TDS.doc); do (cp -R $$d $(TDSDIR)/doc/latex/$(TDSCOLL)) done; |
| 85 |
@echo "zipping the result to $(TDSCOLL).tds.zip" |
| 86 |
cd $(TDSDIR);zip -r -q $(TDSZIP) . |
| 87 |
@echo "and removing the temporary directory $(TDSDIR)" |
| 88 |
rm -Rf $(TDSDIR) |