File: rules

package info (click to toggle)
cgal 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144,952 kB
  • sloc: cpp: 811,597; ansic: 208,576; sh: 493; python: 411; makefile: 286; javascript: 174
file content (129 lines) | stat: -rwxr-xr-x 5,013 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/make -f

# export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

# See http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS   := $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
LDFLAGS  := $(shell dpkg-buildflags --get LDFLAGS)

export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

COMMA = ,
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
  NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
endif

OPENGL_ES_ARCHITECTURES := armel armhf
ifneq (,$(findstring $(DEB_HOST_ARCH), $(OPENGL_ES_ARCHITECTURES)))
  DEBHELPER_QT6 := -Nlibcgal-qt6-dev
  CMAKE_QT6 := -DWITH_CGAL_Qt6=OFF
endif

%:
	dh $@ $(DEBHELPER_QT6)

override_dh_auto_clean:
	dh_auto_clean $(DEBHELPER_QT6)
	rm -fr build
	$(MAKE) -C debian/tests clean

override_dh_auto_configure-arch:
	QTDIR= dh_auto_configure --builddirectory=build -- \
	  -DCMAKE_BUILD_TYPE=Release \
	  -DWITH_demos=OFF -DWITH_examples=OFF \
	  -DCGAL_INSTALL_CMAKE_DIR=lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL $(CMAKE_QT6)
	QTDIR= dh_auto_configure --builddirectory=build/demo/CGAL_ipelets --sourcedirectory=demo/CGAL_ipelets -- \
	  -DCMAKE_BUILD_TYPE=Release \
	  -DCGAL_DIR=$(CURDIR)/build

override_dh_auto_configure-indep:
	# empty

override_dh_auto_build-arch:
	$(MAKE) $(NJOBS) -C build
	$(MAKE) $(NJOBS) -C build/demo/CGAL_ipelets

override_dh_auto_build-indep:
	# empty

override_dh_auto_test-arch:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C debian/tests rounding_modes_simple
	debian/tests/rounding_modes_simple
	$(MAKE) -C debian/tests rounding_math_simple
	debian/tests/rounding_math_simple
	$(MAKE) -C debian/tests rounding_modes_cgal
	debian/tests/rounding_modes_cgal
endif

override_dh_auto_test-indep:
	# empty

override_dh_install-arch:
	# install files into debian/tmp
	$(MAKE) -C build DESTDIR=$(CURDIR)/debian/tmp install
	$(MAKE) -C build/demo/CGAL_ipelets DESTDIR=$(CURDIR)/debian/tmp install

	# remove -fdebug-prefix-map, -ffile-prefix-map, and -fmacro-prefix-map settings
	# from CGALConfig.cmake to avoid false positives in reproducible builds report
	sed -i 's/-f\(debug\|file\|macro\)-prefix-map=[^ ]* //' \
	  debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL/CGALConfig.cmake

	# tweak installed documentation files
	mv debian/tmp/usr/share/doc/CGAL debian/tmp/usr/share/doc/cgal
	mv debian/tmp/usr/share/doc/cgal/CHANGES.md debian/tmp/usr/share/doc/cgal/changelog
	rm debian/tmp/usr/share/doc/cgal/LICENSE*
	rm debian/tmp/usr/share/doc/cgal/AUTHORS

	dh_install --sourcedir=debian/tmp
	dh_missing --list-missing

ifeq (,$(findstring $(DEB_HOST_ARCH), $(OPENGL_ES_ARCHITECTURES)))
	# move Qt header and cmake files into libcgal-qt6-dev package
	mkdir -p  debian/libcgal-qt6-dev/usr/include/CGAL
	mv debian/libcgal-dev/usr/include/CGAL/Qt debian/libcgal-qt6-dev/usr/include/CGAL
	mkdir -p debian/libcgal-qt6-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL
	mv debian/libcgal-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL/CGAL_Qt6* \
	  debian/libcgal-qt6-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL
else
	# remove Qt header and cmake files
	# use -f to avoid build failures if the files should disappear again in future releases
	rm -rf debian/libcgal-dev/usr/include/CGAL/Qt
	rm -f debian/libcgal-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL/CGAL_Qt6*
endif

	# create symlinks to /usr/share/doc/libcgal-dev
ifeq (,$(findstring $(DEB_HOST_ARCH), $(OPENGL_ES_ARCHITECTURES)))
	mkdir -p debian/libcgal-qt6-dev/usr/share/doc
	ln -s libcgal-dev debian/libcgal-qt6-dev/usr/share/doc/libcgal-qt6-dev
endif

override_dh_install-indep:
	mkdir -p debian/tmp/usr/share/doc/cgal
	# patches affecting the demos or examples will change the timestamps of affected files
	# use timestamp of debian/changelog to improve reproducibility
	tar cf - --sort=name --mode u=rwX,g=rX,o=rX --owner root --group root --mtime=$(CURDIR)/debian/changelog data | \
	  gzip --no-name --best >debian/tmp/usr/share/doc/cgal/data.tar.gz
	tar cf - --sort=name --mode u=rwX,g=rX,o=rX --owner root --group root --mtime=$(CURDIR)/debian/changelog demo | \
	  gzip --no-name --best >debian/tmp/usr/share/doc/cgal/demo.tar.gz
	tar cf - --sort=name --mode u=rwX,g=rX,o=rX --owner root --group root --mtime=$(CURDIR)/debian/changelog examples | \
	  gzip --no-name --best >debian/tmp/usr/share/doc/cgal/examples.tar.gz

	dh_install --sourcedir=debian/tmp
	dh_missing --list-missing

	mkdir -p debian/libcgal-demo/usr/share/doc
	ln -s libcgal-dev debian/libcgal-demo/usr/share/doc/libcgal-demo

override_dh_installdocs:
	dh_installdocs -plibcgal-dev -plibcgal-ipelets debian/copyright

override_dh_installchangelogs:
	dh_installchangelogs -plibcgal-dev -plibcgal-ipelets

override_dh_gencontrol:
	dh_gencontrol -- -VIpe-Version=`dpkg-awk 'Package:^ipe$$' -- Version | grep Version | sed 's/Version: //;s/-[^-]*$$//'`