File: rules

package info (click to toggle)
primus 0~20150328-13
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 388 kB
  • sloc: cpp: 3,651; makefile: 117; sh: 13
file content (59 lines) | stat: -rwxr-xr-x 2,099 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

nv_libs_Debian	+= nvidia-driver-libs				[!armhf !ppc64el] |
nv_libs_Debian	+= nvidia-driver-libs-nonglvnd			[!linux-any] |
nv_libs_Debian	+= nvidia-tesla-450-driver-libs			[amd64 i386 arm64 ppc64el] |
nv_libs_Debian	+= nvidia-tesla-440-driver-libs			[amd64 i386 ppc64el] |
nv_libs_Debian	+= nvidia-tesla-418-driver-libs			[amd64 i386 ppc64el] |
nv_libs_Debian	+= nvidia-tesla-418-driver-libs-nonglvnd	[amd64 i386 ppc64el] |
nv_libs_Debian	+= nvidia-legacy-390xx-driver-libs		[amd64 i386 armhf] |
nv_libs_Debian	+= nvidia-legacy-390xx-driver-libs-nonglvnd	[amd64 i386 armhf] |
nv_libs_Debian	+= nvidia-driver-libs-any |
nv_libs_Debian	+= bumblebee-nvidia |

nv_libs_Ubuntu	+= bumblebee-nvidia |

VENDOR		:= $(shell dpkg-vendor --derives-from Ubuntu && echo Ubuntu || echo Debian)

DPKG_EXPORT_BUILDFLAGS = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/default.mk

include /usr/share/dpkg/architecture.mk

ifeq ($(VENDOR),Ubuntu)
	PRIMUS_libGLa=/usr/lib/$(DEB_HOST_MULTIARCH)/mesa/libGL.so.1
	PRIMUS_libGLd=/usr/lib/$(DEB_HOST_MULTIARCH)/mesa/libGL.so.1
else
	PRIMUS_libGLa=/usr/lib/$(DEB_HOST_MULTIARCH)/libGL.so.1
	PRIMUS_libGLd=/usr/lib/$(DEB_HOST_MULTIARCH)/libGL.so.1
endif

# Where to put the resulting library during build
BUILD_LIBDIR ?= lib

%:
	dh $@

execute_after_dh_auto_clean:
	rm -rf $(BUILD_LIBDIR)

override_dh_auto_build:
	dh_auto_build -- LIBDIR=$(BUILD_LIBDIR) \
	    PRIMUS_libGLd=$(PRIMUS_libGLd) \
	    PRIMUS_libGLa=$(PRIMUS_libGLa)

execute_after_dh_install:
	install -d debian/primus/usr/bin/
	install -m 0755 primusrun debian/primus/usr/bin/
	install -d debian/primus-libs/usr/lib/$(DEB_HOST_MULTIARCH)/primus/
	cp -r $(BUILD_LIBDIR)/* debian/primus-libs/usr/lib/$(DEB_HOST_MULTIARCH)/primus/
	install -d debian/primus/usr/share/bash-completion/completions/
	install -m 0644 -T primus.bash-completion debian/primus/usr/share/bash-completion/completions/primus

override_dh_gencontrol:
	dh_gencontrol -- -V'nvidia:Depends=$(nv_libs_$(VENDOR))'