File: rules

package info (click to toggle)
fltk1.3 1.3.4-9
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 24,020 kB
  • sloc: cpp: 104,403; ansic: 88,673; sh: 3,654; makefile: 1,884; perl: 27; xml: 7
file content (130 lines) | stat: -rwxr-xr-x 4,555 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
#!/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

libdir = /usr/lib/$(DEB_HOST_MULTIARCH)
GAMES = blocks checkers sudoku
EXTRA_MFLAGS = OPTIM="$(CFLAGS) $(XCFLAGS)" STRIP=@:

PKG_CONFIG = /usr/bin/$(DEB_HOST_GNU_TYPE)-pkg-config
export PKG_CONFIG

%:
	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_auto_clean:
	[ -e configure ] || mv debian/configure.saved configure
	[ -e fltk.spec.saved ] || 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:
	rm -rf CMakeTmp
	dh_clean documentation/doxygen_sqlite3.db debian/common-build-stamp
	chmod +x debian/fix-fltk-targets-none

override_dh_auto_configure:
	[ -e fltk.spec.saved ] || mv fltk.spec fltk.spec.saved
ifneq "" "$(filter libfltk1.3-dev, $(shell dh_listpackages))"
	mkdir -p CMakeTmp
	dh_auto_configure -S cmake -B CMakeTmp -- -DOPTION_CAIRO:BOOL=ON \
	    -DOPTION_BUILD_SHARED_LIBS:BOOL=ON -DOPTION_CREATE_LINKS:BOOL=ON \
	    -DOPTION_BUILD_EXAMPLES:BOOL=OFF
	sed -e 's/ STATIC /_STATIC&/' \
	    CMakeTmp/CMakeFiles/Export/share/fltk/FLTK-Targets.cmake \
	    > CMakeTmp/etc/FLTK-Targets.cmake
	debian/fix-fltk-targets-none \
	    CMakeTmp/CMakeFiles/Export/share/fltk/FLTK-Targets-none.cmake \
	    > CMakeTmp/etc/FLTK-Targets-none.cmake
endif
	dh_auto_configure -- FTCONFIG="$(PKG_CONFIG) freetype2" \
            DSOFLAGS="$(filter-out -fPIE -pie,$(LDFLAGS))" \
	    --enable-shared --enable-cairo --enable-cp936 --with-links \
	    --with-optim=$(filter -O%,$(CXXFLAGS)) --libdir=$(libdir)
	mv fltk.spec.saved fltk.spec

override_dh_auto_build-arch:
	dh_auto_build -- $(EXTRA_MFLAGS) DIRS='$$(IMAGEDIRS) src cairo 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 cairo fluid test'
else
	dh_auto_build -- $(EXTRA_MFLAGS)
	$(MAKE) -C documentation html pdf
endif

override_dh_auto_install-arch:
	dh_auto_install -a -- DIRS='$$(IMAGEDIRS) src cairo fluid'
	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.3-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/src/$$game.man \
	      >debian/tmp/usr/share/man/man6/fl$$game.6 \
	    || exit 1; \
	done
## fluid
	$(MAKE) -C fluid install-linux DESTDIR=$(CURDIR)/debian/tmp
## libfltk1.3-dev
	cp debian/CMakeCache.txt CMakeTmp/etc/*.cmake \
	    CMake/FLTK-Functions.cmake debian/tmp/usr/lib/fltk
	sed -e 's/ -f[a-z]*-prefix-map=[^ ]*//' fltk-config \
	    > debian/tmp/usr/bin/fltk-config
	chmod +x debian/tmp/usr/bin/fltk-config

ifeq "" "$(filter nodoc,$(DEB_BUILD_OPTIONS))"
  override_dh_auto_install-indep:
	dh_auto_install -i -- DIRS='documentation test'
	mkdir -p debian/tmp/usr/share/doc/fltk1.3-doc
	cp documentation/latex/refman.pdf \
	    debian/tmp/usr/share/doc/fltk1.3-doc/fltk.pdf
endif

override_dh_install-arch:
## libfltk1.3-dev
	sed -e 's/ -f[a-z]*-prefix-map=[^ ]*//' 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:
	dh_makeshlibs  -V

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