File: rules

package info (click to toggle)
linuxcnc 2.9.0~pre1%2Bgit20230208.f1270d6ed7-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 274,984 kB
  • sloc: python: 142,166; ansic: 103,241; cpp: 99,140; tcl: 16,045; xml: 10,608; sh: 10,124; makefile: 1,229; javascript: 226; sql: 72; asm: 15
file content (142 lines) | stat: -rwxr-xr-x 6,095 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/make -f

# Copyright (C) 2006 Jeff Epler
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# When used to produce a debian package, this file is a script "used to
# control compilation and installation of the executable"

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

include /usr/share/dpkg/pkg-info.mk

# Support more robust code and makes code modifications more difficult
# Compare https://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Trigger other tools to use the timestamp from debian/changelog
# Compare https://reproducible-builds.org/docs/source-date-epoch/
export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)

# Set time & date to the most recent release, for repeatable builds.
TIMESTAMP=$(shell dpkg-parsechangelog -S timestamp)
export DATE=$(shell LANG=C date --date='@$(TIMESTAMP)' '+%d\ %b\ %Y')
export TIME=$(shell LANG=C date --date='@$(TIMESTAMP)' '+%T')

kernel_version = uspace
configure_realtime_arg = --with-realtime=uspace
enable_build_documentation = --enable-build-documentation=pdf
DESTDIR=$(CURDIR)/debian/tmp
DEV_PACKAGE_NAME=linuxcnc-uspace-dev

%:
	dh $@

override_dh_auto_configure:
	cd src && ./autogen.sh
	cd src && PYTHON=/usr/bin/python3 ./configure \
	    --prefix=/usr --sysconfdir=/etc \
	    --mandir=/usr/share/man \
	    $(configure_realtime_arg) \
	    $(enable_build_documentation) \
	    --disable-check-runtime-deps

override_dh_auto_build-arch:
	$(MAKE) PYTHON=/usr/bin/python3 -C src build-software

override_dh_auto_build-indep:
ifneq "$(enable_build_documentation)" ""
	$(MAKE) PYTHON=/usr/bin/python3 -C src manpages
	$(MAKE) PYTHON=/usr/bin/python3 -C src translateddocs
	$(MAKE) PYTHON=/usr/bin/python3 -C src docs
endif

override_dh_auto_clean:
	dh_auto_clean
	py3clean .
	if [ -r src/Makefile.inc -a -r src/config.status ]; then $(MAKE) -C src clean -s; fi
	rm -f Makefile.inc
	rm -f src/config.log src/config.status
	rm -f $(for i in $(find . -name "*.in"); do basename $i .in; done)
	dh_clean


override_dh_auto_install-arch:
	# Install all architecture-dependent libraries and executables
	# in DESTDIR (the staging dir for the main package).
	DESTDIR=$(DESTDIR) $(MAKE) -C src install-software
	py3clean .

	desktop-file-validate $(shell find debian/extras/ share/applications/ -name *.desktop);
	
	# some clean-up
	rm -f $(DESTDIR)/usr/share/doc/linuxcnc-uspace/examples/sample-configs/*/*position*.txt

override_dh_installdocs-arch:
	# Sample configs go in `usr/share/doc/linuxcnc` (not
	# `.../doc/linuxcnc-uspace`) because that's where the
	# `linuxcnc` launcher script looks for them, and that's
	# inconvenient to change.
	dh_installdocs --doc-main-package=linuxcnc-uspace --package=linuxcnc-uspace
	mkdir -p debian/linuxcnc-uspace/usr/share/doc/linuxcnc
	mv debian/linuxcnc-uspace/usr/share/doc/linuxcnc-uspace/examples debian/linuxcnc-uspace/usr/share/doc/linuxcnc
	
	dh_installdocs --doc-main-package=linuxcnc-uspace --package=linuxcnc-uspace-dev


override_dh_auto_install-indep:
	DESTDIR=$(DESTDIR) $(MAKE) -C src install-docs install-doc
	# Remove the docs we just built that we don't have debs for yet...
	rm -f $(DESTDIR)/usr/share/doc/linuxcnc/*_nb.pdf

override_dh_installdocs-indep:
	# The G-code quick reference html docs are built as
	# `docs/html/${LANG}/gcode.html`.  We install them
	# into `/usr/share/doc/linuxcnc-uspace/` in each
	# linuxcnc-doc-${LANG} package, then rename them there (except
	# for the English one) to include the language in the filename,
	# so they don't collide when we install all the doc debs.
	#
	# Rename the "main" doc directories from
	# `usr/share/doc/linuxcnc-uspace` to `usr/share/doc/linuxcnc`,
	# because that's where the `.desktop` files look for the docs.
	dh_installdocs --doc-main-package=linuxcnc-uspace --package=linuxcnc-doc-de
	mv debian/linuxcnc-doc-de/usr/share/doc/linuxcnc-uspace/gcode.html debian/linuxcnc-doc-de/usr/share/doc/linuxcnc-uspace/gcode_de.html
	mv debian/linuxcnc-doc-de/usr/share/doc/linuxcnc-uspace debian/linuxcnc-doc-de/usr/share/doc/linuxcnc
	
	dh_installdocs --doc-main-package=linuxcnc-uspace --package=linuxcnc-doc-en
	mv debian/linuxcnc-doc-en/usr/share/doc/linuxcnc-uspace debian/linuxcnc-doc-en/usr/share/doc/linuxcnc
	
	dh_installdocs --doc-main-package=linuxcnc-uspace --package=linuxcnc-doc-es
	mv debian/linuxcnc-doc-es/usr/share/doc/linuxcnc-uspace/gcode.html debian/linuxcnc-doc-es/usr/share/doc/linuxcnc-uspace/gcode_es.html
	mv debian/linuxcnc-doc-es/usr/share/doc/linuxcnc-uspace debian/linuxcnc-doc-es/usr/share/doc/linuxcnc
	
	dh_installdocs --doc-main-package=linuxcnc-uspace --package=linuxcnc-doc-fr
	mv debian/linuxcnc-doc-fr/usr/share/doc/linuxcnc-uspace/gcode.html debian/linuxcnc-doc-fr/usr/share/doc/linuxcnc-uspace/gcode_fr.html
	mv debian/linuxcnc-doc-fr/usr/share/doc/linuxcnc-uspace debian/linuxcnc-doc-fr/usr/share/doc/linuxcnc
	
	dh_installdocs --doc-main-package=linuxcnc-uspace --package=linuxcnc-doc-zh-cn
	mv debian/linuxcnc-doc-zh-cn/usr/share/doc/linuxcnc-uspace/gcode.html debian/linuxcnc-doc-zh-cn/usr/share/doc/linuxcnc-uspace/gcode_zh_CN.html
	mv debian/linuxcnc-doc-zh-cn/usr/share/doc/linuxcnc-uspace debian/linuxcnc-doc-zh-cn/usr/share/doc/linuxcnc


override_dh_compress:
	dh_compress -X.pdf -X.txt -X.hal -X.ini -X.clp -X.var -X.nml -X.tbl -X.xml -Xsample-configs

override_dh_fixperms:
	dh_fixperms -X/linuxcnc_module_helper -X/rtapi_app
	# In case that only the indep packages are built
	if [ -r  "$(DESTDIR)/usr/lib/tcltk/linuxcnc/linuxcnc.tcl" ]; then \
		chmod -x $(DESTDIR)/usr/lib/tcltk/linuxcnc/linuxcnc.tcl; \
	fi
	# override_dh_python3: # not executed, so we attach it to fixperms
	DEB_HOST_ARCH=`dpkg-architecture -qDEB_HOST_ARCH` dh_python3

override_dh_shlibdeps:
	cat debian/linuxcnc-uspace/DEBIAN/shlibs debian/shlibs.pre > debian/shlibs.local
	dh_shlibdeps -u--warnings=0 -l debian/linuxcnc-uspace/usr/lib