aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: a43097c6f557f62eae61e2fda9ca62d843e25a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic
VERSION=$(shell python setup.py --version)
VERSION_TAG=v$(subst .,_,$(VERSION))
TARFILE=archivemail-$(VERSION).tar.gz
HTDOCS=htdocs-$(VERSION)

default:
	@echo "no default target"

clean:
	rm -f *.pyc manpage.links manpage.refs manpage.log
	rm -rf $(HTDOCS)

test:
	python test_archivemail

clobber: clean
	rm -rf build dist
	rm -f $(HTDOCS).tgz


sdist: clobber doc
	cp archivemail.py archivemail
	python setup.py sdist
	rm archivemail

# FIXME: bdist_rpm chokes on the manpage. 
#        This is python/distutils bug #644744
#bdist_rpm: clobber doc
#	cp archivemail.py archivemail
#	python setup.py bdist_rpm
#	rm archivemail

tag:
	git tag -a $(VERSION_TAG)

upload:
	(cd dist && lftp -c 'open upload.sf.net && cd incoming && put $(TARFILE)')

doc: archivemail.1 archivemail.html

htdocs: $(HTDOCS).tgz
$(HTDOCS).tgz: index.html archivemail.html RELNOTES style.css manpage.css
	install -d -m 775 $(HTDOCS)
	install -m 664 $^ $(HTDOCS)
	cd $(HTDOCS) && mv archivemail.html manpage.html
	tar czf $(HTDOCS).tgz $(HTDOCS)

archivemail.1: archivemail.sgml
	docbook2man archivemail.sgml
	chmod 644 archivemail.1

archivemail.html: archivemail.sgml db2html.dsl
	docbook2html --dsl db2html.dsl -u archivemail.sgml
	chmod 644 archivemail.html
	tidy -modify -indent -f /dev/null archivemail.html || true

.PHONY: clean test clobber sdist tag upload doc htdocs