xref: /freebsd/contrib/dialog/package/debian/rules (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
1#!/usr/bin/make -f
2# MAde with the aid of dh_make, by Craig Small
3# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4# Some lines taken from debmake, by Cristoph Lameter.
5
6# Uncomment this to turn on verbose mode.
7#export DH_VERBOSE=1
8
9# These are used for cross-compiling and for saving the configure script
10# from having to guess our platform (since we know it already)
11DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
14CFLAGS =
15
16ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17        CFLAGS += -O0
18else
19        CFLAGS += -O2
20endif
21ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
22        INSTALL_PROGRAM += -s
23endif
24
25
26configure: configure-stamp
27configure-stamp:
28	dh_testdir
29
30	CFLAGS="$(CFLAGS)" ./configure \
31		--host=$(DEB_HOST_GNU_TYPE) \
32		--build=$(DEB_BUILD_GNU_TYPE) \
33		--prefix=/usr \
34		--mandir=\$${prefix}/share/man \
35		--enable-nls \
36		--enable-header-subdir \
37		--enable-widec \
38		--with-libtool \
39		--with-ncursesw \
40		--with-package=cdialog \
41		--disable-rpath-hack
42
43	touch configure-stamp
44
45build: build-stamp
46build-stamp: configure-stamp
47	dh_testdir
48
49	$(MAKE)
50
51	touch build-stamp
52
53clean:
54	dh_testdir
55	dh_testroot
56
57	[ ! -f makefile ] || $(MAKE) distclean
58
59	rm -f configure-stamp build-stamp install-stamp
60
61	dh_clean
62
63install: install-stamp
64install-stamp: build-stamp
65	dh_testdir
66	dh_testroot
67	dh_clean -k
68	dh_installdirs
69
70	$(MAKE) install DESTDIR=$(CURDIR)/debian/cdialog
71
72	touch install-stamp
73
74# Build architecture-independent files here.
75binary-indep: build install
76# No binary-indep target.
77
78# Build architecture-dependent files here.
79binary-arch: build install
80	dh_testdir
81	dh_testroot
82	dh_installdocs
83	dh_installexamples
84	dh_installchangelogs CHANGES
85	dh_strip
86	dh_compress
87	dh_fixperms
88	dh_installdeb
89	dh_shlibdeps
90	dh_gencontrol
91	dh_md5sums
92	dh_builddeb
93
94binary: binary-indep binary-arch
95.PHONY: build clean binary-indep binary-arch binary install install-stamp
96