File: rules

package info (click to toggle)
lire 2%3A2.0.2-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 13,480 kB
  • ctags: 5,059
  • sloc: perl: 61,803; xml: 18,361; sh: 1,834; makefile: 1,359
file content (155 lines) | stat: -rwxr-xr-x 3,928 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/usr/bin/make -f
# $Id: rules,v 1.51 2006/10/03 11:12:06 vanbaal Exp $

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

package=lire
version=$(shell head -n 1 debian/changelog | sed -e 's/.*(\(\([0-9]\+:\)\?\([^-]\+\).*\).*).*/\3/' )
DESTDIR=$(CURDIR)/debian/$(package)

# This is the debhelper compatability version to use.
export DH_COMPAT=4

patchdir = $(CURDIR)/debian/patches
patches = $(shell ls $(patchdir) | sort)
rev_patches = $(shell ls $(patchdir) | sort -r)

configure: configure-stamp
configure-stamp:
	dh_testdir

	@for file in $(patches); do \
		if [ ! -f $(patchdir)/$$file.stamp ]; then \
			echo Applying $$file...; \
			patch -p1 < $(patchdir)/$$file; \
			touch $(patchdir)/$$file.stamp; \
		fi; \
	done

	LOGGER=/usr/bin/logger \
	PLOTICUS=/usr/bin/ploticus \
	SENDMAIL=/usr/sbin/sendmail \
	./configure 				\
		--prefix=/usr			\
		--sysconfdir=/etc		\
		--infodir=/usr/share/info	\
		--libexecdir=/usr/share/lire/lib	\
		--mandir=/usr/share/man		\
		--with-spooldir=/var/spool/lire \
		--with-archivedir=/var/lib/lire/data

	touch configure-stamp


build: configure-stamp build-indep debian/po/templates.pot


## we use po-debconf's po2debconf, the debconf-mergetemplate follow-up.
## see po-debconf(7)
debian/po/templates.pot: debian/templates
	debconf-updatepo


build-indep: build-indep-stamp
build-indep-stamp:
	dh_testdir

	$(MAKE)

	touch build-indep-stamp


clean:
	dh_testdir
	dh_testroot
	rm -f build-indep-stamp configure-stamp

	-$(MAKE) distclean
	rm -f $(DESTDIR)/etc/default/lire.d/apache.cfg \
            $(DESTDIR)/etc/default/lire.d/apache2.cfg \
            $(DESTDIR)/etc/default/lire.d/exim.cfg \
            $(DESTDIR)/etc/default/lire.d/postfix.cfg \
            $(DESTDIR)/etc/default/lire.d/squid.cfg \
            $(DESTDIR)/etc/default/lire.d/syslog.cfg \
	    $(CURDIR)/all/lib/config-defaults/lire.xml

#	workaround a bug within the automake framework
	-rm -f extras/Time/Makefile

	@for file in $(rev_patches); do \
		if [ -f $(patchdir)/$$file.stamp ]; then \
			echo Reversing $$file...; \
			patch -R -p1 < $(patchdir)/$$file; \
			rm -f $(patchdir)/$$file.stamp; \
		fi; \
	done

	dh_clean


install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) install DESTDIR=$(DESTDIR)

#       install debian lr_vendor_cron config files
	sh $(CURDIR)/mkinstalldirs $(DESTDIR)/etc/default/lire.d
	install -c -m 644 $(CURDIR)/debian/apache.cfg \
            $(DESTDIR)/etc/default/lire.d/apache.cfg
	install -c -m 644 $(CURDIR)/debian/apache2.cfg \
            $(DESTDIR)/etc/default/lire.d/apache2.cfg
	install -c -m 644 $(CURDIR)/debian/exim.cfg \
            $(DESTDIR)/etc/default/lire.d/exim.cfg
	install -c -m 644 $(CURDIR)/debian/postfix.cfg \
            $(DESTDIR)/etc/default/lire.d/postfix.cfg
	install -c -m 644 $(CURDIR)/debian/squid.cfg \
            $(DESTDIR)/etc/default/lire.d/squid.cfg
	install -c -m 644 $(CURDIR)/debian/syslog.cfg \
            $(DESTDIR)/etc/default/lire.d/syslog.cfg

	rm -rf $(DESTDIR)/usr/share/lire/sgml

	dh_movefiles -i --sourcedir=debian/$(package)

#	remove directories that are left empty
	rm -rf $(DESTDIR)/usr/share/man/man3              \
		$(DESTDIR)/usr/share/doc/lire/user-manual \
		$(DESTDIR)/usr/share/doc/lire/dev-manual  \
		$(DESTDIR)/usr/share/perl5/Lire/Msgstore

# Build architecture-dependent files
binary-arch: build install
# nothing to do


# Build architecture-independent files
binary-indep: build install
	dh_testdir
	dh_testroot
# this should take care of purging from /var/cache/debconf in postrm
	dh_installdebconf

	dh_installdocs
	dh_installchangelogs ChangeLog

#	dh_installexamples
#       dh_installlogrotate

#	dh_installinit

	dh_installcron
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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