File: rules

package info (click to toggle)
ace-of-penguins 1.5~rc2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,592 kB
  • sloc: sh: 13,542; ansic: 9,856; makefile: 246; perl: 36
file content (133 lines) | stat: -rwxr-xr-x 2,804 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/make -f

-include /usr/share/dpkg/buildtools.mk
CC_FOR_BUILD ?= $(CC)

PACKAGE		= ace-of-penguins
PRGPREFIX	= ace-
ICON_NAME	= ace.png
ICON_SRC	= desktop/ace.png

# list of programs taken from games/Makefile
PROGS = \
 canfield \
 freecell \
 golf \
 mastermind \
 merlin \
 minesweeper \
 pegged \
 solitaire \
 spider \
 taipedit \
 taipei \
 thornq

CFLAGS  += -D_FILE_OFFSET_BITS=64
cc      := $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)

CONFFLAGS = --prefix=/usr --bindir=/usr/games

include debian/debian-vars.mk

export DEB_BUILD_MAINT_OPTIONS	= hardening=+all

# NOTE: The sources won't compile with -pedantic
export DEB_CFLAGS_MAINT_APPEND	= -Wall $(CPPFLAGS)

MANDIR = $(MANROOTDIR)/man6

#######################################################################

override_dh_auto_configure:
	CC="$(cc)" dh_auto_configure -- $(CONFFLAGS)

override_dh_auto_build: build-man
	dh_auto_build -- CC="$(cc)" BUILD_CC="$(CC_FOR_BUILD)"

test:
	# target: test

	@echo "# Display commands to test programs. Feed through '| sh'" >&2

	@for prog in $(PROGS); \
	do \
	    echo "$$prog &"; \
	done

man:
	# target: man
	$(MAKE) -C debian -f pod2man.mk PACKAGE=$(PACKAGE) \
	MANSECT=6 makeman

clean-man:
	# target: clean-man - remove manual page links (will be generated)

	for NAME in $(PROGS); \
	do \
		man=$(DEBDIR)/$(PRGPREFIX)$$NAME.6; \
		rm -f $$man; \
	done || :

build-man: man
	# target: build-man - link pages to master page
	for NAME in $(PROGS); \
	do \
	    man=debian/$(PRGPREFIX)$$NAME.6; \
	    echo ".so man6/ace-of-penguins.6" > $$man; \
	done

override_dh_auto_test:
	# nothing to test

override_dh_clean: clean-man
	#  target: clean - You may safely ignore message "invalid host type"
	if [ -f Makefile ]; then \
	    $(MAKE) \
		to_srcdir="$(TOPDIR)" \
		top_builddir="$(TOPDIR)" \
		clean distclean \
		|| : ; \
	fi

	rm -rf lib/.lib lib/.deps games/.lib games/.deps */*.[ao] *.[ao]

	dh_clean

override_dh_installman:
	dh_installman
	# Check that all is in order
	echo "PWD: pwd"
	( cd $(MANDIR) && ls -l )

override_dh_auto_install:
	dh_auto_install

	# rename programs to start with prefix
	for NAME in $(PROGS) ; do \
	    mv $(PKGDIR)/usr/games/$$NAME \
	       $(PKGDIR)/usr/games/$(PRGPREFIX)$$NAME || exit 1; \
	done

	$(INSTALL_DIR) $(PKGDIR)/usr/share/applications
	$(INSTALL_DATA) debian/desktop/*.desktop $(PKGDIR)/usr/share/applications

	# delete test program
	rm -f $(PKGDIR)/usr/games/penguins

	# Not used in Debian
	find $(PKGDIR) -name "*.la" | xargs --no-run-if-empty rm -f

	# Install custom icon
	install -D -m 644 $(ICON_SRC) $(ICONDIR)/hicolor/48x48/apps/$(ICON_NAME)

override_dh_installdocs:
	# Policy: COPYING file is not needed
	dh_installdocs -X COPYING -X .git -X CVS -X .svn docs/*

%:
	dh $@

.PHONY: test man build-man clean-man

# End of file