xref: /freebsd/contrib/dialog/package/debian/rules (revision a96ef4501919d7ac08e94e98dc34b0bdd744802b)
17a1c0d96SNathan Whitehorn#!/usr/bin/make -f
2*a96ef450SBaptiste Daroussin# $Id: rules,v 1.11 2019/07/24 00:53:35 tom Exp $
3f4f33ea0SBaptiste Daroussin# Made with the aid of dh_make, by Craig Small
47a1c0d96SNathan Whitehorn# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
57a1c0d96SNathan Whitehorn# Some lines taken from debmake, by Cristoph Lameter.
67a1c0d96SNathan Whitehorn
77a1c0d96SNathan Whitehorn# Uncomment this to turn on verbose mode.
87a1c0d96SNathan Whitehorn#export DH_VERBOSE=1
97a1c0d96SNathan Whitehorn
107a1c0d96SNathan Whitehorn# These are used for cross-compiling and for saving the configure script
117a1c0d96SNathan Whitehorn# from having to guess our platform (since we know it already)
127a1c0d96SNathan WhitehornDEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
137a1c0d96SNathan WhitehornDEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
147a1c0d96SNathan Whitehorn
15f4f33ea0SBaptiste DaroussinCPPFLAGS	:= $(shell dpkg-buildflags --get CPPFLAGS)
16f4f33ea0SBaptiste DaroussinCFLAGS		:= $(shell dpkg-buildflags --get CFLAGS)
17f4f33ea0SBaptiste DaroussinLDFLAGS		:= $(shell dpkg-buildflags --get LDFLAGS)
18f4f33ea0SBaptiste Daroussin
19*a96ef450SBaptiste DaroussinTMP = $(CURDIR)/debian/tmp
20*a96ef450SBaptiste Daroussin
21f4f33ea0SBaptiste DaroussinACTUAL_PROG	= cdialog
22*a96ef450SBaptiste DaroussinDEV_PACKAGE	= $(ACTUAL_PROG)-dev
23*a96ef450SBaptiste Daroussin
24*a96ef450SBaptiste DaroussinBINDIR		= /usr/bin
25*a96ef450SBaptiste DaroussinLIBDIR		= /usr/lib
26*a96ef450SBaptiste DaroussinLOCALE		= /usr/share/locale
27*a96ef450SBaptiste DaroussinMANDIR		= /usr/share/man
28*a96ef450SBaptiste DaroussinHEADER		= /usr/include
297a1c0d96SNathan Whitehorn
307a1c0d96SNathan Whitehornifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
317a1c0d96SNathan Whitehorn        CFLAGS += -O0
327a1c0d96SNathan Whitehornelse
337a1c0d96SNathan Whitehorn        CFLAGS += -O2
347a1c0d96SNathan Whitehornendif
357a1c0d96SNathan Whitehornifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
367a1c0d96SNathan Whitehorn        INSTALL_PROGRAM += -s
377a1c0d96SNathan Whitehornendif
387a1c0d96SNathan Whitehorn
397a1c0d96SNathan Whitehorn
407a1c0d96SNathan Whitehornconfigure: configure-stamp
417a1c0d96SNathan Whitehornconfigure-stamp:
427a1c0d96SNathan Whitehorn	dh_testdir
437a1c0d96SNathan Whitehorn
44f4f33ea0SBaptiste Daroussin	cp -v package/dialog.map package/${ACTUAL_PROG}.map
45f4f33ea0SBaptiste Daroussin
46f4f33ea0SBaptiste Daroussin	CPPFLAGS="$(CPPFLAGS)" \
47f4f33ea0SBaptiste Daroussin	CFLAGS="$(CFLAGS)" \
48f4f33ea0SBaptiste Daroussin	LDFLAGS="$(LDFLAGS)" \
49f4f33ea0SBaptiste Daroussin	./configure \
507a1c0d96SNathan Whitehorn		--host=$(DEB_HOST_GNU_TYPE) \
517a1c0d96SNathan Whitehorn		--build=$(DEB_BUILD_GNU_TYPE) \
527a1c0d96SNathan Whitehorn		--prefix=/usr \
537a1c0d96SNathan Whitehorn		--mandir=\$${prefix}/share/man \
547a1c0d96SNathan Whitehorn		--enable-nls \
557a1c0d96SNathan Whitehorn		--enable-header-subdir \
567a1c0d96SNathan Whitehorn		--enable-widec \
57f4f33ea0SBaptiste Daroussin		--with-shared \
58f4f33ea0SBaptiste Daroussin		--with-screen=ncursesw6 \
59f4f33ea0SBaptiste Daroussin		--with-package=${ACTUAL_PROG} \
60f4f33ea0SBaptiste Daroussin		--with-versioned-syms \
617a1c0d96SNathan Whitehorn		--disable-rpath-hack
627a1c0d96SNathan Whitehorn
637a1c0d96SNathan Whitehorn	touch configure-stamp
647a1c0d96SNathan Whitehorn
657a1c0d96SNathan Whitehornbuild: build-stamp
667a1c0d96SNathan Whitehornbuild-stamp: configure-stamp
677a1c0d96SNathan Whitehorn	dh_testdir
687a1c0d96SNathan Whitehorn
697a1c0d96SNathan Whitehorn	$(MAKE)
707a1c0d96SNathan Whitehorn
717a1c0d96SNathan Whitehorn	touch build-stamp
727a1c0d96SNathan Whitehorn
737a1c0d96SNathan Whitehornclean:
747a1c0d96SNathan Whitehorn	dh_testdir
757a1c0d96SNathan Whitehorn	dh_testroot
767a1c0d96SNathan Whitehorn
777a1c0d96SNathan Whitehorn	[ ! -f makefile ] || $(MAKE) distclean
787a1c0d96SNathan Whitehorn
797a1c0d96SNathan Whitehorn	rm -f configure-stamp build-stamp install-stamp
807a1c0d96SNathan Whitehorn
817a1c0d96SNathan Whitehorn	dh_clean
827a1c0d96SNathan Whitehorn
837a1c0d96SNathan Whitehorninstall: install-stamp
847a1c0d96SNathan Whitehorninstall-stamp: build-stamp
857a1c0d96SNathan Whitehorn	dh_testdir
867a1c0d96SNathan Whitehorn	dh_testroot
877a1c0d96SNathan Whitehorn	dh_clean -k
887a1c0d96SNathan Whitehorn	dh_installdirs
897a1c0d96SNathan Whitehorn
90*a96ef450SBaptiste Daroussin	$(MAKE) install-full DESTDIR=$(TMP)
91*a96ef450SBaptiste Daroussin
92*a96ef450SBaptiste Daroussin	dh_install -p${ACTUAL_PROG} $(BINDIR)/$(ACTUAL_PROG)
93*a96ef450SBaptiste Daroussin	dh_install -p${ACTUAL_PROG} $(LIBDIR)
94*a96ef450SBaptiste Daroussin	dh_install -p${ACTUAL_PROG} $(LOCALE)
95*a96ef450SBaptiste Daroussin	dh_install -p${ACTUAL_PROG} $(MANDIR)/man1
96*a96ef450SBaptiste Daroussin	dh_install -p${DEV_PACKAGE} $(BINDIR)/$(ACTUAL_PROG)-config
97*a96ef450SBaptiste Daroussin	dh_install -p${DEV_PACKAGE} $(MANDIR)/man3
98*a96ef450SBaptiste Daroussin	dh_install -p${DEV_PACKAGE} $(HEADER)
99*a96ef450SBaptiste Daroussin
100*a96ef450SBaptiste Daroussin	echo FIXME
101*a96ef450SBaptiste Daroussin	for P in lib${ACTUAL_PROG}.so*; \
102*a96ef450SBaptiste Daroussin	do \
103*a96ef450SBaptiste Daroussin		[ -L "$$P" ] || continue; \
104*a96ef450SBaptiste Daroussin		case "$$P" in \
105*a96ef450SBaptiste Daroussin		*.so) \
106*a96ef450SBaptiste Daroussin			echo "DEV: $$P"; \
107*a96ef450SBaptiste Daroussin			dh_link -p${DEV_PACKAGE} $(LIBDIR)/`readlink $$P` $(LIBDIR)/$$P ; \
108*a96ef450SBaptiste Daroussin			;; \
109*a96ef450SBaptiste Daroussin		*) \
110*a96ef450SBaptiste Daroussin			echo "BIN: $$P"; \
111*a96ef450SBaptiste Daroussin			dh_link -p${ACTUAL_PROG} $(LIBDIR)/`readlink $$P` $(LIBDIR)/$$P ; \
112*a96ef450SBaptiste Daroussin			;; \
113*a96ef450SBaptiste Daroussin		esac; \
114*a96ef450SBaptiste Daroussin	done
1157a1c0d96SNathan Whitehorn
1167a1c0d96SNathan Whitehorn	touch install-stamp
1177a1c0d96SNathan Whitehorn
1187a1c0d96SNathan Whitehorn# Build architecture-independent files here.
1197a1c0d96SNathan Whitehornbinary-indep: build install
1207a1c0d96SNathan Whitehorn# No binary-indep target.
1217a1c0d96SNathan Whitehorn
1227a1c0d96SNathan Whitehorn# Build architecture-dependent files here.
1237a1c0d96SNathan Whitehornbinary-arch: build install
1247a1c0d96SNathan Whitehorn	dh_testdir
1257a1c0d96SNathan Whitehorn	dh_testroot
1267a1c0d96SNathan Whitehorn	dh_installdocs
1277a1c0d96SNathan Whitehorn	dh_installexamples
1287a1c0d96SNathan Whitehorn	dh_installchangelogs CHANGES
1297a1c0d96SNathan Whitehorn	dh_strip
1307a1c0d96SNathan Whitehorn	dh_compress
1317a1c0d96SNathan Whitehorn	dh_fixperms
1327a1c0d96SNathan Whitehorn	dh_installdeb
133f4f33ea0SBaptiste Daroussin	dh_makeshlibs
1347a1c0d96SNathan Whitehorn	dh_shlibdeps
1357a1c0d96SNathan Whitehorn	dh_gencontrol
1367a1c0d96SNathan Whitehorn	dh_md5sums
1377a1c0d96SNathan Whitehorn	dh_builddeb
1387a1c0d96SNathan Whitehorn
1397a1c0d96SNathan Whitehornbinary: binary-indep binary-arch
1407a1c0d96SNathan Whitehorn.PHONY: build clean binary-indep binary-arch binary install install-stamp
141