forked from LinuxCNC/linuxcnc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.in
More file actions
150 lines (124 loc) · 5.62 KB
/
rules.in
File metadata and controls
150 lines (124 loc) · 5.62 KB
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
143
144
145
146
147
148
149
150
#!/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
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.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 = @KERNEL_VERSION@
configure_realtime_arg = @CONFIGURE_REALTIME_ARG@
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
enable_build_documentation = @ENABLE_BUILD_DOCUMENTATION@
endif
SRCDIR = $(CURDIR)/src
DESTDIR=$(CURDIR)/debian/tmp
DEV_PACKAGE_NAME=@MAIN_PACKAGE_NAME@-dev
export PYTHON=/usr/bin/python3
%:
dh $@ -D$(SRCDIR)
override_dh_auto_configure:
cd src && ./autogen.sh
cd src && ./configure \
--prefix=/usr --sysconfdir=/etc \
--mandir=/usr/share/man \
$(configure_realtime_arg) \
$(enable_build_documentation) \
--disable-check-runtime-deps
override_dh_auto_build-arch:
dh_auto_build -- build-software
override_dh_auto_build-indep:
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
ifneq "$(enable_build_documentation)" ""
dh_auto_build -- manpages
dh_auto_build -- translateddocs
dh_auto_build -- docs
endif
endif
override_dh_auto_clean:
if [ -r src/Makefile.inc -a -r src/config.status ]; then \
dh_auto_clean; \
py3clean .; \
fi
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
dh_auto_test
endif
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/@MAIN_PACKAGE_NAME@/examples/sample-configs/*/*position*.txt
override_dh_installdocs-arch:
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
# Sample configs go in `usr/share/doc/linuxcnc` (not `.../doc/@MAIN_PACKAGE_NAME@`)
# because that's where the `linuxcnc` launcher script looks for them,
# and that's inconvenient to change.
dh_installdocs --doc-main-package=@MAIN_PACKAGE_NAME@ --package=@MAIN_PACKAGE_NAME@
mkdir -p debian/@MAIN_PACKAGE_NAME@/usr/share/doc/linuxcnc
mv debian/@MAIN_PACKAGE_NAME@/usr/share/doc/@MAIN_PACKAGE_NAME@/examples debian/@MAIN_PACKAGE_NAME@/usr/share/doc/linuxcnc
dh_installdocs --doc-main-package=@MAIN_PACKAGE_NAME@ --package=@MAIN_PACKAGE_NAME@-dev
endif
override_dh_auto_install-indep:
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
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
endif
override_dh_installdocs-indep:
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
# The G-code quick reference html docs are built as `docs/html/${LANG}/gcode.html`.
# We install them into `/usr/share/doc/@MAIN_PACKAGE_NAME@/` in each # linuxcnc-doc-${LANG} package,
# then rename them there (except for the English one) to include the language in the filename,
# so they do not collide when we install all the doc debs.
#
# Rename the "main" doc directories from
# `usr/share/doc/@MAIN_PACKAGE_NAME@` 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=@MAIN_PACKAGE_NAME@ --package=linuxcnc-doc-en
mv debian/linuxcnc-doc-en/usr/share/doc/@MAIN_PACKAGE_NAME@ debian/linuxcnc-doc-en/usr/share/doc/linuxcnc
# Remove files for translations created where we do not want Debian packages.
for l in ar es fr ru zh_CN; do \
$(RM) debian/tmp/usr/share/doc/linuxcnc/LinuxCNC_*_$$l.pdf; \
done
$(RM) debian/tmp/usr/share/doc/linuxcnc/*_es.adoc
else
# Avoiding error message because of examples
$(RM) -fr debian/tmp/usr/share/doc/
endif
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 [ -x "$(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/@MAIN_PACKAGE_NAME@/DEBIAN/shlibs debian/shlibs.pre > debian/shlibs.local
dh_shlibdeps -u--warnings=0 -l debian/@MAIN_PACKAGE_NAME@/usr/lib