File: rules

package info (click to toggle)
orthanc-postgresql 3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,180 kB
  • sloc: ansic: 13,800; cpp: 8,283; sql: 275; python: 58; makefile: 39; sh: 38
file content (56 lines) | stat: -rwxr-xr-x 2,013 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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk   # To access the "DEB_VERSION" variable

export UPSTREAM_VERSION := $(shell echo "$(DEB_VERSION)" | cut -d '+' -f 1)
export TARGET_INDEX := libOrthancPostgreSQLIndex.so
export TARGET_STORAGE := libOrthancPostgreSQLStorage.so

export DEB_BUILD_MAINT_OPTIONS := hardening=+all

# Disable assert() checking from upstream project, for best performance
# https://lists.debian.org/debian-med/2018/04/msg00132.html
export DEB_CFLAGS_MAINT_APPEND=-DNDEBUG
export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG

%:
	dh $@ --builddirectory=Build

CMAKE_EXTRA_FLAGS += \
	-DCMAKE_SKIP_RPATH:BOOL=ON \
	-DSTATIC_BUILD:BOOL=OFF \
        -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE:BOOL=ON \
	-DUSE_SYSTEM_ORTHANC_SDK:BOOL=OFF \
	-DORTHANC_FRAMEWORK_VERSION:STRING=1.5.4 \
	-DORTHANC_FRAMEWORK_SOURCE:STRING=web \
        -DDEB_VERSION=$(DEB_VERSION) \
        -DCMAKE_BUILD_TYPE=None  # The build type must be set to None, see #711515

override_dh_auto_configure:
        # Put 3rd party packages where the cmake build system expects them
	mkdir -p PostgreSQL/ThirdPartyDownloads
	( cd PostgreSQL/ThirdPartyDownloads && \
	  cp ../../debian/ThirdPartyDownloads/Orthanc-1.5.4.tar.gz . )

	mkdir Build
	dh_auto_configure --builddirectory=Build \
			  --sourcedirectory=PostgreSQL \
			  -- $(CMAKE_EXTRA_FLAGS)

override_dh_clean:
	rm -rf PostgreSQL/ThirdPartyDownloads/
	dh_clean

override_dh_auto_install:
	cp Build/${TARGET_INDEX} Build/${TARGET_INDEX}.${UPSTREAM_VERSION}
	cp Build/${TARGET_STORAGE} Build/${TARGET_STORAGE}.${UPSTREAM_VERSION}

	dh_install Build/${TARGET_INDEX}.${UPSTREAM_VERSION} usr/lib/orthanc
	dh_install Build/${TARGET_STORAGE}.${UPSTREAM_VERSION} usr/lib/orthanc

override_dh_link:
	dh_link usr/lib/orthanc/${TARGET_INDEX}.${UPSTREAM_VERSION} usr/share/orthanc/plugins/${TARGET_INDEX}
	dh_link usr/lib/orthanc/${TARGET_STORAGE}.${UPSTREAM_VERSION} usr/share/orthanc/plugins/${TARGET_STORAGE}

override_dh_installchangelogs:
	dh_installchangelogs -k PostgreSQL/NEWS