xref: /freebsd/contrib/dialog/package/debian/rules (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
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
14CPPFLAGS	:= $(shell dpkg-buildflags --get CPPFLAGS)
15CFLAGS		:= $(shell dpkg-buildflags --get CFLAGS)
16LDFLAGS		:= $(shell dpkg-buildflags --get LDFLAGS)
17
18ACTUAL_PROG	= cdialog
19
20ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21        CFLAGS += -O0
22else
23        CFLAGS += -O2
24endif
25ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
26        INSTALL_PROGRAM += -s
27endif
28
29
30configure: configure-stamp
31configure-stamp:
32	dh_testdir
33
34	cp -v package/dialog.map package/${ACTUAL_PROG}.map
35
36	CPPFLAGS="$(CPPFLAGS)" \
37	CFLAGS="$(CFLAGS)" \
38	LDFLAGS="$(LDFLAGS)" \
39	./configure \
40		--host=$(DEB_HOST_GNU_TYPE) \
41		--build=$(DEB_BUILD_GNU_TYPE) \
42		--prefix=/usr \
43		--mandir=\$${prefix}/share/man \
44		--enable-nls \
45		--enable-header-subdir \
46		--enable-widec \
47		--with-shared \
48		--with-screen=ncursesw6 \
49		--with-package=${ACTUAL_PROG} \
50		--with-versioned-syms \
51		--disable-rpath-hack
52
53	touch configure-stamp
54
55build: build-stamp
56build-stamp: configure-stamp
57	dh_testdir
58
59	$(MAKE)
60
61	touch build-stamp
62
63clean:
64	dh_testdir
65	dh_testroot
66
67	[ ! -f makefile ] || $(MAKE) distclean
68
69	rm -f configure-stamp build-stamp install-stamp
70
71	dh_clean
72
73install: install-stamp
74install-stamp: build-stamp
75	dh_testdir
76	dh_testroot
77	dh_clean -k
78	dh_installdirs
79
80	$(MAKE) install DESTDIR=$(CURDIR)/debian/${ACTUAL_PROG}
81
82	touch install-stamp
83
84# Build architecture-independent files here.
85binary-indep: build install
86# No binary-indep target.
87
88# Build architecture-dependent files here.
89binary-arch: build install
90	dh_testdir
91	dh_testroot
92	dh_installdocs
93	dh_installexamples
94	dh_installchangelogs CHANGES
95	dh_strip
96	dh_compress
97	dh_fixperms
98	dh_installdeb
99	dh_makeshlibs
100	dh_shlibdeps
101	dh_gencontrol
102	dh_md5sums
103	dh_builddeb
104
105binary: binary-indep binary-arch
106.PHONY: build clean binary-indep binary-arch binary install install-stamp
107