File: rules

package info (click to toggle)
swish%2B%2B 6.1.5-5
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 2,916 kB
  • ctags: 2,205
  • sloc: ansic: 11,936; lisp: 804; sh: 629; perl: 366; makefile: 80
file content (129 lines) | stat: -rwxr-xr-x 3,685 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

tmp := $(CURDIR)/debian/swish++
renamed := extract index search splitmail 
man4to5 := man4/swish++.conf.4  man4/swish++.index.4  

install_file = install -p    -o root -g root -m 644
install_program = install -p    -o root -g root -m 755
install_script = install -p    -o root -g root -m 755
makedirectory = install -p -d -o root -g root -m 755
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These are probably irrelevant since the source is g++
CFLAGS = -g -Wall
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
install_program += -s
endif

include /usr/share/quilt/quilt.make

configure: configure-stamp

configure-stamp: $(QUILT_STAMPFN)
	dh_testdir
	## Patches and configuring
	#ln -s debian/patches
	#quilt push -a || test $$? = 2
	# Fix location of man pages
	mkdir -p $(CURDIR)/man/man5
	for i in $(man4to5); do j=$$(echo $${i} | tr '4' '5'); cp -p man/$${i} man/$${j}; done
	touch configure-stamp	

build: build-stamp

build-stamp: configure-stamp
	dh_testdir
	# Add here commands to compile the package.
	$(MAKE)
	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	## Reverse patches
	#quilt pop -a || test $$? = 2
	## Clean up quilt stuff
	#rm -rf patches .pc
	#rm -f build-stamp configure-stamp
	# Add here commands to clean up after the build process.
	$(MAKE) distclean
	# Clean up a left over file
	rm -f init_mod_vars.c
	# Clean up the renamed man pages
	for i in $(renamed); do rm -f $(CURDIR)/man/man1/$${i}++.1; done;
	# Remove copied manpages
	rm -rf $(CURDIR)/man/man5
	rm -f build-stamp configure-stamp
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
#	$(MAKE)  install DESTDIR=$(tmp)
	$(makedirectory) $(tmp)/usr/lib/swish++
	$(makedirectory) $(tmp)/usr/bin
	$(install_file) WWW.pm $(tmp)/usr/lib/swish++/
	$(install_program) search $(tmp)/usr/bin/search++
	$(install_program) extract $(tmp)/usr/bin/extract++
	$(install_program) index $(tmp)/usr/bin/index++
	$(install_script) scripts/splitmail $(tmp)/usr/bin/splitmail++
	$(install_script) scripts/httpindex $(tmp)/usr/bin/httpindex

	cd $(CURDIR)/man/man1 && for i in $(renamed); do cp -p $${i}.1 $${i}++.1; done;

	$(makedirectory) $(CURDIR)/debian/daemon
	$(install_script) scripts/searchmonitor $(CURDIR)/debian/daemon/searchmonitor
	$(install_script) scripts/searchc $(CURDIR)/debian/daemon/searchc
	$(install_script) scripts/searchd $(CURDIR)/debian/daemon/searchd
	# should customize the whole install as it's really opaque now


# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
#	dh_installdebconf	
	dh_installdocs 
	dh_installexamples $(CURDIR)/debian/email_indexing/ \
		$(CURDIR)/debian/oo_indexing $(CURDIR)/debian/daemon/ \
		$(CURDIR)/swish++.conf  $(CURDIR)/www_example/ \
		$(CURDIR)/debian/rlimit
	dh_installmenu
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
	dh_installcron
	dh_installman man/man1/splitmail++.1 man/man1/search++.1 man/man1/extract++.1 man/man1/index++.1 \
	man/man1/httpindex.1 man/man3/WWW.3 man/man5/swish++.conf.5 man/man5/swish++.index.5
	dh_installinfo
	dh_installchangelogs Changes
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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