File: rules

package info (click to toggle)
muttprint 0.72d-8etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,184 kB
  • ctags: 1
  • sloc: makefile: 73; sh: 67
file content (135 lines) | stat: -rwxr-xr-x 4,005 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

$(shell chmod ugo+x debian/scripts/get_upstream_version.sh)
TAR_DIR=muttprint-$(shell debian/scripts/get_upstream_version.sh)

include /usr/share/dbs/dbs-build.mk

configure: $(STAMP_DIR)/configure-stamp
$(STAMP_DIR)/configure-stamp: $(patched)
	dh_testdir
	
	# we do have to clean here to let them be regenerated
	-cd $(BUILD_TREE)/doc/manual && $(MAKE) clean
	-cd $(BUILD_TREE)/doc/manpages && $(MAKE) clean
	
	touch $(STAMP_DIR)/configure-stamp

build: $(STAMP_DIR)/configure-stamp $(STAMP_DIR)/build-stamp
$(STAMP_DIR)/build-stamp:
	dh_testdir
	
	# regenerate the documentation with the right docdir
	cd $(BUILD_TREE)/doc/manual && $(MAKE) docdir=/usr/share/doc \
		sharedir=/usr/share mandir=/usr/share/man libdir=/usr/share \
		bindir=/usr/bin
	cd $(BUILD_TREE)/doc/manpages && $(MAKE) docdir=/usr/share/doc \
		sharedir=/usr/share mandir=/usr/share/man libdir=/usr/share \
		bindir=/usr/bin
	
	touch $(STAMP_DIR)/build-stamp

clean: 
	dh_testdir
	dh_testroot
	rm -rf $(STAMP_DIR) $(SOURCE_DIR)
	
	# ensure needed scripts are +x
	chmod ugo+x debian/scripts/*

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# rm CVS data
	#find $(BUILD_TREE) -type d -name "CVS" | xargs rm -rf
	#for cvsfile in Entries Repository Root; do \
	#	find $(BUILD_TREE) -type f -name "$$cvsfile" | xargs rm -f; \
	#done
	
	cd $(BUILD_TREE) && $(MAKE) install
	
	# no need to install these files
	rm $(CURDIR)/debian/muttprint/usr/share/doc/muttprint/COPYING
	rm $(CURDIR)/debian/muttprint/usr/share/doc/muttprint/INSTALL
	rm $(CURDIR)/debian/muttprint/usr/share/doc/muttprint/CHANGES
	
	# install default /etc/Muttprintrc
	cp $(CURDIR)/debian/Muttprintrc \
		$(CURDIR)/debian/muttprint/etc/Muttprintrc
	
	# move the images to ospics ...
	mv $(CURDIR)/debian/muttprint/usr/share/muttprint \
		$(CURDIR)/debian/ospics/usr/share/ && \
	cd $(CURDIR)/debian/ospics/usr/share && mv muttprint ospics
	# make .png and .jpg versions of the images
	#cd $(CURDIR)/debian/ospics/usr/share/ospics && \
	#	for format in png jpg; do \
	#		for epsfile in *.eps; do \
	#			convert eps:$$epsfile \
	#			 `basename $$epsfile .eps`.$$format; \
	#		done; \
	#	done
	# ... and flip them
	#cd $(CURDIR)/debian/ospics/usr/share/ospics && \
	#	for format in eps png jpg; do \
	#		convert -flop BabyTuX.$$format BabyTuX_flip.$$format; \
	#	done
	
	# uudecode the images from CVS
	cd $(BUILD_TREE)/pics; for i in *.uu; do \
		uudecode $$i > `basename $$i .uu`; \
	done
	cp $(BUILD_TREE)/pics/*.png $(BUILD_TREE)/pics/*.jpg \
		$(CURDIR)/debian/ospics/usr/share/ospics
	# remove Gentoo*
	rm -f $(CURDIR)/debian/ospics/usr/share/ospics/Gentoo*
	# .. and the .uu stuff
	rm -f $(CURDIR)/debian/ospics/usr/share/ospics/*.uu
	# flip the BabyTux PNG
	cd $(CURDIR)/debian/ospics/usr/share/ospics && \
		convert -flop BabyTuX.png BabyTuX_flip.png

	# move the translations back
	# yes, this way is ugly but easy ;)
	mkdir $(CURDIR)/debian/muttprint/usr/share/muttprint
	mv $(CURDIR)/debian/ospics/usr/share/ospics/translations \
		$(CURDIR)/debian/muttprint/usr/share/muttprint

	# move the manual into muttprint-manual
	cd $(CURDIR)/debian/muttprint/usr/share/doc/muttprint && \
	mv manual* \
	  $(CURDIR)/debian/muttprint-manual/usr/share/doc/muttprint/manual
	
	# install sample configuration files
	cd $(CURDIR)/debian/muttprint/usr/share/doc/muttprint
#	mkdir examples && mv sample-* examples/ && 
#	for l in `find ./examples -type f -name sample-*`; do \
#		ln -s examples/`basename $$l` `basename $$l`; done

	# remove muttprint-langinfo stuff
	rm -f $(CURDIR)/debian/muttprint/usr/bin/muttprint-langinfo	

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs $(BUILD_TREE)/CHANGES
	dh_installdebconf
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_perl $(BUILD_TREE)/muttprint
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install
	dh_testdir

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure