# Example Makefile which uses ctanify and ctanupload to pack and upload a
# LaTeX package. The required data is passed using environment variables.
CONTRIBUTION  = foobar
NAME          = John Doe
EMAIL         = john.doe@inter.net
DIRECTORY     = /macros/latex/contrib/${CONTRIBUTION}
LICENSE       = free
FREEVERSION   = lppl
FILE          = ${CONTRIBUTION}.tar.gz
export CONTRIBUTION VERSION NAME EMAIL SUMMARY DIRECTORY DONOTANNOUNCE \
       ANNOUNCE NOTES LICENSE FREEVERSION FILE

ctanify: ${FILE}

${CONTRIBUTION}.sty: ${CONTRIBUTION}.ins ${CONTRIBUTION}.dtx
	yes | tex $<

${CONTRIBUTION}.pdf: ${CONTRIBUTION}.dtx ${CONTRIBUTION}.sty
	latexmk $<

${FILE}: ${CONTRIBUTION}.dtx ${CONTRIBUTION}.ins ${CONTRIBUTION}.sty \
         README ${CONTRIBUTION}.pdf
	ctanify $^

upload: ctanify
	ctanupload -p

