File: rules

package info (click to toggle)
newt 0.52.21-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,944 kB
  • sloc: ansic: 9,316; python: 713; makefile: 253; sh: 37; xml: 7
file content (80 lines) | stat: -rwxr-xr-x 2,643 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/make -f
#
# Created 20 December 1997 by Enrique Zanardi <ezanardi@ull.es>
# Modified 2002-2011 by Alastair McKinstry, <mckinstry@debian.org>
#
# Copying and modification is unlimited, provided that the modified
# version is marked as being modified.

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

# Magic debhelper rule.
%:
ifeq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
	dh $@ --with python3
else
	dh $@ 
endif

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
DEB_HOST_ARCH_OS  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
PY3VERS:=$(shell py3versions --supported)

AM_VERS:=$(strip $(shell dpkg-query -f '$${source:Upstream-Version}' -W automake | egrep -o '^[0-9]+\.[0-9]+'))

ifeq ($(DEB_HOST_ARCH_OS),hurd)
GPMSUPPORT=
else
GPMSUPPORT= --with-gpm-support
endif

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
NOSTRIP=--with-nostrip=no
else
NOSTRIP=--with-nostrip=yes
endif

COLORSFILE = --with-colorsfile=/etc/newt/palette

override_dh_auto_clean:
	dh_auto_clean
	# remove autogenerated files
	rm -rf Makefile config.h* config.log config.status .depend libnewt.pc \
	   configure install-sh po/*.mo python* tutorial libnewt_pic.a po/newt.pot
	rm -f debian/shlibs.local

override_dh_auto_configure:
	# Nasty hack. why is it necessary?
	cp /usr/share/automake-$(AM_VERS)/install-sh ./install-sh
	dh_auto_configure  -- $(GPMSUPPORT) $(NOSTRIP) $(COLORSFILE) CFLAGS='-I/usr/include/tcl8.6 $(CFLAGS) -DMARCH=\"$(DEB_HOST_MULTIARCH)\" '  \
		CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" FFLAGS="$(FFLAGS)" 

override_dh_auto_build:
	dh_auto_build
	sgmltools --backend html tutorial.sgml
	ar cqv libnewt_pic.a shared/*.o

override_dh_auto_install:
	dh_auto_install 
ifeq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
	for v in $(PY3VERS); do \
               pylib=usr/lib/python3/dist-packages ; \
               abitag=.$$($$v -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \
               mkdir -p debian/python3-newt/$$pylib ; \
               if echo x$$abitag | grep -q "$(DEB_HOST_MULTIARCH)"; then \
                mv $$v/_snack.so $$v/_snack$$abitag.so; \
              else \
                 mv $$v/_snack.so $$v/_snack$$abitag-$(DEB_HOST_MULTIARCH).so; \
              fi; \
               cp snack.py $$v/* debian/python3-newt/$$pylib; \
        done
	-find debian/python-* debian/python3-* -name '*.o' | xargs rm -f
endif
	dh_install -p libnewt-dev libnewt.a $(LIBDIR)
	mkdir -p debian/libnewt-pic/$(LIBDIR)
	cp newt*.ver debian/libnewt-pic/$(LIBDIR)/libnewt_pic.map

override_dh_makeshlibs:
	dh_makeshlibs -a -V