File: Makefile

package info (click to toggle)
piuparts 0.38
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 364 kB
  • ctags: 383
  • sloc: python: 3,617; makefile: 78; sh: 23
file content (62 lines) | stat: -rw-r--r-- 2,073 bytes parent folder | download
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
prefix = /usr/local
sbindir = $(prefix)/sbin
sharedir = $(prefix)/share
mandir = $(sharedir)/man
man1dir = $(mandir)/man1
libdir = $(prefix)/lib
docdir = $(prefix)/share/doc/piuparts/
site24 = $(libdir)/python2.4/site-packages
site25 = $(libdir)/python2.5/site-packages
etcdir = $(prefix)/etc
distribution=${shell dpkg-parsechangelog | sed -n 's/^Distribution: *//p'}
ifeq ($(distribution),UNRELEASED)
version=${shell echo "`dpkg-parsechangelog | sed -n 's/^Version: *//p'`~`date +%Y%m%d%H%M`"}
else
version=${shell dpkg-parsechangelog | sed -n 's/^Version: *//p'}
endif

ignore = -I fdmount -N

all: install-conf install-doc install

install-doc:
	# build and install manual 
	# the first a2x call is to workaround 559305 in sid, while the 2nd is for lenny
	a2x --copy -a toc -a toclevels=3 -f xhtml -r /etc/asciidoc/ README.txt || \
	  a2x --copy -a toc -a toclevels=3 -f xhtml README.txt
	install -d $(docdir)/
	for file in README.txt README.html docbook-xsl.css ; do \
	    install -m 0755 $$file $(docdir)/ ; done
	# build and install manpage
	a2x -f manpage piuparts.1.txt
	install -d $(man1dir) 
	install -m 0644 piuparts.1 $(man1dir)
	gzip -9f $(man1dir)/piuparts.1
	a2x --copy -f xhtml piuparts.1.txt
	install -m 0755 piuparts.1.html $(docdir)

install-conf:
	install -d $(etcdir)/piuparts
	install -m 0644 piuparts.conf.sample $(etcdir)/piuparts/piuparts.conf

install:
	install -d $(sbindir) 
	echo $(version)
	sed -e 's/__PIUPARTS_VERSION__/$(version)/g' piuparts.py > piuparts
	install piuparts $(sbindir)/piuparts
	
	install -d $(sharedir)/piuparts
	for file in piuparts-slave piuparts-master piuparts-report piuparts-analyze; do \
	    install -m 0755 $$file.py $(sharedir)/piuparts/$$file ; done
	
	install -d $(site24)/piupartslib
	install -d $(site25)/piupartslib
	install -m 0644 piupartslib/*.py $(site24)/piupartslib
	install -m 0644 piupartslib/*.py $(site25)/piupartslib

check:
	python piuparts.py unittest
	python unittests.py

clean:
	rm -rf piuparts.1 piuparts.1.xml piuparts.1.html piuparts README.xml README.html docbook-xsl.css piuparts.html