File: rules

package info (click to toggle)
memchan 2.3-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,868 kB
  • sloc: ansic: 3,320; sh: 990; tcl: 687; makefile: 51
file content (66 lines) | stat: -rwxr-xr-x 1,703 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
#!/usr/bin/make -f

DDIR = $(CURDIR)/debian/tmp
MDIR = $(CURDIR)/debian/tcl-memchan
MDDIR = $(CURDIR)/debian/tcl-memchan-dev
DOCDIR = $(MDIR)/usr/share/doc/tcl-memchan/html
DDOCDIR = $(MDDIR)/usr/share/doc/tcl-memchan-dev/html

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

%:
	dh $@

override_dh_auto_configure:
	dh_testdir
	CFLAGS="$(CFLAGS)" \
	dh_auto_configure -- \
			  --with-tcl=/usr/lib \
			  --with-tclinclude=/usr/include/tcl \
			  --enable-threads

override_dh_auto_build:
	$(MAKE)
	$(MAKE) doc
	$(MAKE) doc-html

override_dh_auto_install:
	# Install the package into debian/tmp.
	$(MAKE) install-binaries DESTDIR=$(DDIR)
	$(MAKE) install-libraries DESTDIR=$(DDIR)
	install -m 755 -d $(DDIR)/usr/lib/tcltk
	mv $(DDIR)/usr/lib/Memchan* $(DDIR)/usr/lib/tcltk
	# Cleanup manpages
	for f in *.n ; do \
	    sed -e'/^\.so man.macros/ d' \
	        -e'/^\.B[SE]$$/ d' \
	    	-e's/^\.TH \([^ ]\+\) n/.TH \1 3tcl/' \
		-i $$f || exit 1; \
	done
	# Cleanup docs
	for f in *.html ; do \
	    sed -i -e's/(n)/(3tcl)/g' $$f; \
	done
	# Copy HTML docs
	mv memchanapi.html $(DDOCDIR)
	mv *.html $(DOCDIR)
	mv memchanapi.n memchanapi.3tcl
	# Generate documentation indices
	tclsh debian/gen_index.tcl $(DOCDIR) >$(DOCDIR)/index.html
	tclsh debian/gen_index.tcl $(DDOCDIR) >$(DDOCDIR)/index.html

get-orig-source:
	wget -O memchan_2.3.orig.tar.gz \
		http://prdownloads.sourceforge.net/memchan/Memchan2.3.tar.gz

.PHONY: override_dh_auto_configure override_dh_auto_build override_dh_auto_install get-orig-source