rules 3.33 KB
Newer Older
Mike Gabriel's avatar
Mike Gabriel committed
1 2
#!/usr/bin/make -f

3
NULL =
Mike Gabriel's avatar
Mike Gabriel committed
4

5
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6 7
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
Mike Gabriel's avatar
Mike Gabriel committed
8

9 10 11
include /usr/share/dpkg/architecture.mk

export LIBDIR = "/usr/lib/$(DEB_HOST_MULTIARCH)"
12
export LIBEXECDIR = "$(LIBDIR)/nx/bin"
13
export INCLUDEDIR = "/usr/include/$(DEB_HOST_MULTIARCH)"
14

Mike Gabriel's avatar
Mike Gabriel committed
15
%:
16 17
	CONFIGURE="./configure --disable-silent-rules \
	                       --prefix=/usr \
18 19
	                       --libdir=$(LIBDIR) \
	                       --includedir=$(INCLUDEDIR) \
20 21
	                       --libexecdir=$(LIBEXECDIR) \
	                       --build=$(DEB_BUILD_GNU_TYPE) \
22
	                       --host=$(DEB_HOST_GNU_TYPE)"  dh $@ --no-parallel --with quilt
Mike Gabriel's avatar
Mike Gabriel committed
23 24 25

override_dh_auto_clean:
	rm -Rf nx-X11/.build-exports
26 27 28 29 30
	dh_auto_clean --no-parallel || dh_auto_clean

override_dh_clean:
	dh_clean
	rm -f nx-X11/config/cf/date.def
Mike Gabriel's avatar
Mike Gabriel committed
31

32 33
override_dh_install:

34
	# strip static libs and remove .la files
35 36 37 38 39 40
	rm debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libXcomp.la
	strip --strip-debug --remove-section=.comment --remove-section=.note debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libXcomp.a
	rm debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libXcompshad.la
	strip --strip-debug --remove-section=.comment --remove-section=.note debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libXcompshad.a
	rm debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libNX_X11.la
	strip --strip-debug --remove-section=.comment --remove-section=.note debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libNX_X11.a
41 42

	# remove extras, GL, and other unneeded headers
43 44 45 46 47 48 49
	rm -R debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/GL/
	rm -R debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/nx-X11/extensions/XK*.h
	rm -R debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/nx-X11/extensions/*Xv*.h
	rm -R debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/nx-X11/extensions/XRes*.h
	rm -R debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/nx-X11/extensions/XIproto.h
	rm -R debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/nx-X11/extensions/XI.h
	rm -R debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/nx-X11/Xtrans/
50

51 52 53 54
	dh_install

override_dh_missing:
	dh_missing --fail-missing
55

56
override_dh_auto_install:
57 58
	PREFIX='/usr' dh_auto_install --no-parallel -Smakefile || \
	PREFIX='/usr' dh_auto_install -Smakefile
59

Mike Gabriel's avatar
Mike Gabriel committed
60
override_dh_auto_build:
61
	debian/compat.sh
62 63
	PREFIX='/usr' dh_auto_build --no-parallel -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' || \
	PREFIX='/usr' dh_auto_build -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))'
Mike Gabriel's avatar
Mike Gabriel committed
64

65
override_dh_strip:
66 67 68 69 70
	dh_strip -plibnx-x11-6 --dbg-package=libnx-x11-6-dbg
	dh_strip -plibxcomp3 --dbg-package=libxcomp3-dbg
	dh_strip -plibxcompshad3 --dbg-package=libxcompshad3-dbg
	dh_strip -pnxagent --dbg-package=nxagent-dbg
	dh_strip -pnxproxy --dbg-package=nxproxy-dbg
71 72 73

override_dh_makeshlibs:
	dh_makeshlibs -n
74

75 76 77 78 79 80 81 82
# Needed for the libX11 RUNPATH/RPATH link-time hack.
# dh_shlibdeps will follow dependencies within binaries and choke
# on the libX11 dependency, since the SONAME (libX11.*) used while linking
# does not match the later detected SONAME (libNX_X11.*) obtained through
# the libX11 -> libNX_X11 compat symlink.
override_dh_shlibdeps:
	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

83 84
get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..