File: rules

package info (click to toggle)
fltk1.1 1.1.10-29
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,620 kB
  • sloc: cpp: 76,654; ansic: 40,942; makefile: 1,703; sh: 438
file content (115 lines) | stat: -rwxr-xr-x 3,988 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DPKG_EXPORT_BUILDFLAGS = yes
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk

XCFLAGS = -Wall -Wunused -Wno-format-y2k -fPIE -fno-strict-aliasing

PKG_CONFIG = /usr/bin/$(DEB_HOST_GNU_TYPE)-pkg-config
libdir = /usr/lib/$(DEB_HOST_MULTIARCH)
GAMES = blocks checkers sudoku
EXTRA_MFLAGS = OPTIM="$(CFLAGS) $(XCFLAGS)" STRIP=@:

%:
	dh $@

override_dh_autoreconf:
	-mv configure debian/configure.saved
# FLTK uses a hand-maintained configh.in and an autoheader-unfriendly
# configure.ac.
	AUTOHEADER=/bin/true dh_autoreconf

override_dh_autoreconf_clean:
	dh_autoreconf_clean
	[ -e configure ] || mv debian/configure.saved configure

override_dh_auto_configure:
	mv fltk.spec fltk.spec.saved
	dh_auto_configure -- FTCONFIG="$(PKG_CONFIG) freetype2" \
            DSOFLAGS="$(filter-out -fPIE -pie,$(LDFLAGS))" \
	    --enable-shared --enable-threads --enable-xft \
	    --enable-xinerama --without-links --libdir=$(libdir) \
	    --with-optim=$(filter -O%,$(CXXFLAGS))
	mv fltk.spec.saved fltk.spec

override_dh_auto_build-arch:
	dh_auto_build -- $(EXTRA_MFLAGS) DIRS='$$(IMAGEDIRS) src fluid'
	$(MAKE) -C test $(EXTRA_MFLAGS) $(GAMES)

override_dh_auto_build-indep:
ifneq "" "$(filter nodoc,$(DEB_BUILD_OPTIONS))"
	dh_auto_build -- $(EXTRA_MFLAGS) DIRS='$$(IMAGEDIRS) src fluid test'
else
	dh_auto_build -- $(EXTRA_MFLAGS)
	$(MAKE) -C documentation fltk.pdf fltk.ps
endif

override_dh_auto_clean:
	mv fltk.spec fltk.spec.saved
# Avoid reconfigure.  Removed by distclean.  >> deliberate -- keeping
# existing contents allows for proper cleaning between builds.
	echo 'RMDIR = rm -Rf' >> makeinclude
	dh_auto_clean
	mv fltk.spec.saved fltk.spec

override_dh_clean:
	dh_clean debian/libfltk1.1.symbols.$(DEB_HOST_ARCH)

override_dh_auto_install-arch:
	dh_auto_install -a -- $(EXTRA_MFLAGS) DIRS='$$(IMAGEDIRS) src'
	mkdir -p debian/tmp/usr/games
	mkdir -p debian/tmp/usr/lib/fltk
	mkdir -p debian/tmp/usr/share/applications
	mkdir -p debian/tmp/usr/share/icons/hicolor/32x32/apps
	mkdir -p debian/tmp/usr/share/icons/hicolor/128x128/apps
	mkdir -p debian/tmp/usr/share/man/man6
	mkdir -p debian/tmp/usr/share/pixmaps
## fltk1.1-games (installed by hand to be able to add fl prefixes.)
	for game in $(GAMES); do \
	    cp test/$$game debian/tmp/usr/games/fl$$game && \
	    sed -e 's,Exec=,&/usr/games/fl,; s,Icon=,&fl,; s,Name=,&FLTK ,' \
	      test/desktop/$$game.desktop \
	      >debian/tmp/usr/share/applications/fl$$game.desktop && \
	    cp test/desktop/$$game-32.png \
	      debian/tmp/usr/share/icons/hicolor/32x32/apps/fl$$game.png && \
	    cp test/desktop/$$game-128.png \
	      debian/tmp/usr/share/icons/hicolor/128x128/apps/fl$$game.png && \
	    sed -e '1s,^\.TH ,&fl,; 3s,^,fl,' documentation/$$game.man \
	      >debian/tmp/usr/share/man/man6/fl$$game.6 \
	    || exit 1; \
	done
## libfltk1.1-dev
	cp CMake/FLTKUse.cmake debian/CMakeCache.txt debian/tmp/usr/lib/fltk
	sed 's,@libdir@,$(libdir),' debian/FLTKConfig.cmake.in \
	    >debian/tmp/usr/lib/fltk/FLTKConfig.cmake

override_dh_auto_install-indep:
	dh_auto_install -i -- $(EXTRA_MFLAGS) DIRS='documentation test'

override_dh_install-arch:
## libfltk1.1-dev
	sed -e 's/ -f[a-z]*-prefix-map=[^ ]*/ /g' fltk-config \
	    > debian/tmp/usr/bin/fltk-config
	chmod +x debian/tmp/usr/bin/fltk-config
	dh_install

override_dh_installdocs:
	dh_installdocs -A CREDITS README

override_dh_makeshlibs-arch:
# On most Debian architectures, 1.1.9-3 was the first version to build
# with GCC 4.3, which proceeded to introduce a few new symbols.  On
# alpha, however, 4.2 remained the default through lenny's release.
ifeq ($(DEB_HOST_ARCH),alpha)
	sed -e 's/1\.1\.9-3~/1.1.10~rc2/' debian/libfltk1.1.symbols \
	  > debian/libfltk1.1.symbols.$(DEB_HOST_ARCH)
endif
	dh_makeshlibs  -V

override_dh_installchangelogs:
	dh_installchangelogs
	for x in debian/*/usr/share/doc/*/changelog; do \
	    mv -v $$x `dirname $$x`/NEWS; \
	done