summaryrefslogtreecommitdiffstats
path: root/packaging/ubuntu/debian/rules
blob: e1ad26a3d13fa658d73a03b0b319026a4e1a9ac0 (plain) (blame)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export DEB_BUILD_OPTIONS+=nocheck
export DEB_CMAKE_INSTALL_PREFIX=/usr

%:
	dh $@ --buildsystem=cmake --builddirectory=subsurface-build --parallel

override_dh_auto_clean:
	(cd libdivecomputer ; make clean || true)
	make clean || true
	rm -rf libgit2/build
	rm -rf marble-build
	rm -f ssrf-version.h
	rm -f subsurface
	rm -f Makefile

override_dh_auto_configure:
	(cd libdivecomputer ; autoreconf --install ; ./configure --disable-shared ; make -j8 )
	(mkdir libgit2/build ; cd libgit2/build ; \
		cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_CLAR=OFF -DBUILD_EXAMPLES=OFF .. ; \
		sed -i 's/.so$/.a/' CMakeCache.txt ; make -j8 )
	(mkdir marble-build ; cd marble-build ; \
		cmake -DQTONLY=ON -DQT5BUILD=ON \
			-DBUILD_MARBLE_APPS=OFF -DBUILD_MARBLE_EXAMPLES=OFF \
			-DBUILD_MARBLE_TESTS=OFF -DBUILD_MARBLE_TOOLS=OFF \
			-DBUILD_TESTING=OFF -DWITH_DESIGNER_PLUGIN=OFF \
			-DBUILD_WITH_DBUS=OFF ../marble-source ; \
		make -j8 ; \
		ln -s src/lib/marble lib ; \
		mkdir include ; cd include ; for i in `find ../../marble-source -name \*.h` ; do ln -s $$i . ; done ; \
		ln -s . marble )
	(mkdir subsurface-build ; cd subsurface-build ; \
		cmake -DCMAKE_BUILD_TYPE=Release \
			-DPREFER_GIT_FROMSOURCE=1 \
			-DLIBGIT2_INCLUDE_DIR=$$(pwd)/../libgit2/include \
			-DLIBGIT2_LIBRARIES=$$(pwd)/../libgit2/build/libgit2.a \
			-DLIBDIVECOMPUTER_INCLUDE_DIR=$$(pwd)/../libdivecomputer/include \
			-DLIBDIVECOMPUTER_LIBRARIES=$$(pwd)/../libdivecomputer/src/.libs/libdivecomputer.a \
			-DMARBLE_INCLUDE_DIR=$$(pwd)/../marble-build/include \
			-DMARBLE_LIBRARIES=$$(pwd)/../marble-build/lib/libssrfmarblewidget.so \
			$$(pwd)/.. ; )

override_dh_installchangelogs:
	dh_installchangelogs
	dh_installchangelogs ReleaseNotes/ReleaseNotes.txt
	txt2html Documentation/user-manual.txt > Documentation/user-manual.html
	mkdir -p debian/subsurface/usr/share/doc/subsurface
	cp Documentation/user-manual.txt debian/subsurface/usr/share/doc/subsurface/
	cp Documentation/user-manual.html debian/subsurface/usr/share/doc/subsurface/html