File: rules

package info (click to toggle)
menu 2.1.48
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,044 kB
  • sloc: cpp: 4,507; sh: 1,212; makefile: 232; perl: 104; ansic: 52
file content (114 lines) | stat: -rwxr-xr-x 3,148 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
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
#! /usr/bin/make -f
#   -*- mode: makefile; -*-
#
# Based on the sample file shipped with debhelper.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

arch    := $(shell dpkg-architecture -qDEB_HOST_ARCH)

DEB_HOST_GNU_CPU    ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

CXXFLAGS = -g -Wall
CFLAGS = -g -Wall
LDFLAGS = -Wl,-z,relro

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CXXFLAGS += -O0
CFLAGS += -O0
else
CXXFLAGS += -O2
CFLAGS += -O2
endif

build: build-stamp
build-stamp:
	dh_testdir
	./configure --host=$(DEB_HOST_GNU_TYPE) --target=$(DEB_HOST_GNU_TYPE) \
                    --build=$(DEB_BUILD_GNU_TYPE) \
                    --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man
	$(MAKE) CXXFLAGS="$(CXXFLAGS)" CFLAGS="$(CFLAGS)" "LDFLAGS=$(LDFLAGS)"
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp config.log

	# Add here commands to clean up after the build process.
	[ ! -f Makefile ] || $(MAKE) distclean

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs \
		   etc/menu-methods \
		   etc/menu \
		   usr/share/menu \
		   usr/share/man/man1 \
		   usr/share/bug/menu
		   

	# Add here commands to install the package into debian/menu.
	$(MAKE) install DESTDIR=`pwd`/debian/menu/

	install -p -g root -o root -m 644 \
	      examples/translate_menus debian/menu/etc/menu-methods
	install -p -g root -o root -m 644 \
	      examples/menu.h debian/menu/etc/menu-methods
	install -p -g root -o root -m 644 \
	      po-sections/lang.h debian/menu/etc/menu-methods
	install -p -g root -o root -m 644 \
	      examples/menu.config debian/menu/etc/menu-methods
	#
	install -p -g root -o root -m 644 \
	   doc/README.config-menus debian/menu/etc/menu/README
	install -p -g root -o root -m 644 \
	   doc/README.menu-methods debian/menu/etc/menu-methods/README
	install -p -g root -o root -m 644 \
	   doc/README.package-menus debian/menu/usr/share/menu/README
	#
	install -p -g root -o root -m 644 \
	   debian/bug.presubj debian/menu/usr/share/bug/menu/presubj
	#
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do here, no architecture independant packages here.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installman doc/update-menus.fr.1 doc/su-to-root.fr.1 \
	              doc/menufile.fr.5
	dh_installinfo doc/menu.info.gz
	dh_installchangelogs
	dh_lintian
	dh_strip
	dh_compress
	dh_fixperms
	#Ensure update-menus is not shipped executable
	chmod a-x debian/menu/usr/bin/update-menus
	dh_installdeb
#	refuse debhelper V3 conffiles behaviour.
	cp debian/conffiles debian/menu/DEBIAN
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb


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