Skip to content

Commit 74a1af0

Browse files
authored
Merge pull request #2647 from smoe/debian_nocheck
debian: introducing nodocs and nocheck DEB_BUILD_OPTIONS (smoe:debian_nocheck)
2 parents fc685e0 + 5acd111 commit 74a1af0

File tree

5 files changed

+95
-44
lines changed

5 files changed

+95
-44
lines changed

debian/changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ linuxcnc (1:2.10.0~pre0) UNRELEASED; urgency=medium
88
depend on defaults passed by dpkg-buildflags on
99
Ubuntu and Debian (LP: #2104012)
1010

11+
[ Steffen Moeller ]
12+
* Introducing DEB_BUILD_OPTIONS to d/rules.
13+
1114
-- Pushkar Kulkarni <[email protected]> Mon, 24 Mar 2025 20:50:08 +0530
1215

1316
linuxcnc (1:2.9.4-2) unstable; urgency=medium

debian/configure

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,25 @@ set -e
1414

1515
usage () {
1616
P=${0##*/}
17-
cat <<EOF
17+
cat 1>&2 <<EOF
1818
$P: Set up debian/ files to build for a particular kernel
1919
2020
Usage:
2121
$P [no-docs]
2222
2323
Extra options:
24-
no-docs
25-
Skip building documentation
24+
25+
no-docs|nodocs
26+
Skip building documentation.
27+
Debian packaging will not know about documentation to exist at all.
28+
If configured regularly but with the intent not to build the docs,
29+
run "DEB_BUILD_OPTIONS=nodocs dpkg-buildpackage".
30+
31+
sim|uspace|noauto
32+
Accepted for compatibility, but now ignored.
33+
34+
-h|--help|help
35+
Show this help.
2636
EOF
2737
}
2838

@@ -47,8 +57,12 @@ ENABLE_BUILD_DOCUMENTATION=--enable-build-documentation=pdf
4757
while test $# -ne 0; do
4858
case "$1" in
4959
sim|uspace|noauto) echo "$1 is accepted for compatibility, but ignored";;
50-
no-docs) unset ENABLE_BUILD_DOCUMENTATION ;;
51-
*) echo 1>&2 "Unknown option: $1"; exit 99 ;;
60+
help|-h|--help) usage; exit 0 ;;
61+
no-docs|nodocs) unset ENABLE_BUILD_DOCUMENTATION ;;
62+
*) echo 1>&2 "Unknown option: $1"
63+
echo 1>&2
64+
usage
65+
exit 99 ;;
5266
esac
5367
shift
5468
done
@@ -195,4 +209,15 @@ fi
195209

196210

197211
rm -f ../build-stamp
198-
echo "successfully configured for '$DISTRIB_NAME'.."
212+
echo "I: Successfully configured for '$DISTRIB_NAME'."
213+
214+
echo "I: You can now start the build of LinuxCNC Debian packages."
215+
echo " To build and test everything: fakeroot debian/rules binary"
216+
echo " To build the executables and man pages only: fakeroot debian/rules binary-arch"
217+
echo " To avoid tests: DEB_BUILD_OPTIONS=nocheck debian/rules binary"
218+
if [ -n "$ENABLE_BUILD_DOCUMENTATION" ]; then
219+
echo " To avoid documentation: DEB_BUILD_OPTIONS=nodocs fakeroot debian/rules binary"
220+
else
221+
echo " Building of documentation is disabled."
222+
fi
223+
echo " The DEB_BUILD_OPTIONS environment variable also works with dpkg-buildpackage."

debian/control.top.in

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Build-Depends:
1212
@KERNEL_HEADERS@,
1313
@MODUTILS_DEPENDS@,
1414
@EXTRA_BUILD@,
15-
docbook-xsl,
15+
docbook-xsl <!nodocs>,
1616
asciidoc,
17-
ghostscript,
18-
groff-base,
19-
imagemagick,
20-
asciidoc-dblatex,
17+
ghostscript <!nodocs>,
18+
groff-base <!nodocs>,
19+
imagemagick <!nodocs>,
20+
asciidoc-dblatex <!nodocs>,
2121
autoconf,
2222
automake,
2323
bwidget (>= 1.7),
@@ -37,7 +37,7 @@ Build-Depends:
3737
libxmu-dev,
3838
netcat-traditional | netcat-openbsd | netcat,
3939
netpbm,
40-
po4a,
40+
po4a <!nodocs>,
4141
procps,
4242
psmisc,
4343
python3,
@@ -51,8 +51,10 @@ Build-Depends:
5151
yapps2
5252
Build-Depends-Indep:
5353
@DOC_DEPENDS@,
54-
Build-Conflicts: libjpeg8-dev, libtiff4-dev
55-
Standards-Version: 4.7.0
54+
Build-Conflicts-Arch:
55+
libjpeg8-dev,
56+
libtiff4-dev
57+
Standards-Version: 4.7.2
5658
Homepage: https://linuxcnc.org/
5759
Vcs-Browser: https://github.com/LinuxCNC/linuxcnc
5860
Vcs-Git: https://github.com/LinuxCNC/linuxcnc.git
@@ -72,23 +74,23 @@ Section: devel
7274
Description: PC based motion controller for real-time Linux
7375
LinuxCNC is a fully-realised CNC machine controller that can interpret
7476
machine-control programs (such as G-code), plan trajectories and finally
75-
output low-level signals to machine control hardware
77+
output low-level signals to machine control hardware.
7678
.
77-
LinuxCNC is modular and in principle the HAL (hardware abstraction layer),
78-
pluggable interpreters and variety of hardware drivers mean that it can
79-
control almost any software-defined physical system.
79+
LinuxCNC is modular, thus in principle its HAL (hardware abstraction
80+
layer) together with pluggable interpreters and variety of hardware
81+
drivers can control almost any software-defined physical system.
8082
.
8183
LinuxCNC relies on a realtime kernel to support real-time motion control,
82-
typically updating the position waypoints every 1mS and reacting to
83-
input within tens of microseconds.
84+
typically updating the position waypoints every millisecond and reacting
85+
to input within tens of microseconds.
8486
.
8587
Modules exist to use the low-level parts of LinuxCNC as a motion-control
8688
client for OpenPnP. Interfaces exist for ROS (the Robot Operating System)
8789
with which LinuxCNC has considerable overlap.
8890
.
8991
LinuxCNC supports arbitrary kinematics (the mapping between coordinate
90-
space and actuator space) and can control both parallel (eg Stewart
91-
platform) and serial (eg robot arm) systems in addition to conventional
92+
space and actuator space) and can control both parallel (e.g., Stewart
93+
platform) and serial (e.g., robot arm) systems in addition to conventional
9294
cartesian machine tools.
9395
.
9496
LinuxCNC supports 9 cartesian axes and 16 "Joints" (individual actuators)

debian/rules.in

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export TIME=$(shell LANG=C date --date='@$(TIMESTAMP)' '+%T')
3232

3333
kernel_version = @KERNEL_VERSION@
3434
configure_realtime_arg = @CONFIGURE_REALTIME_ARG@
35+
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
3536
enable_build_documentation = @ENABLE_BUILD_DOCUMENTATION@
37+
endif
3638
SRCDIR = $(CURDIR)/src
3739
DESTDIR=$(CURDIR)/debian/tmp
3840
DEV_PACKAGE_NAME=@MAIN_PACKAGE_NAME@-dev
@@ -55,18 +57,25 @@ override_dh_auto_build-arch:
5557
dh_auto_build -- build-software
5658

5759
override_dh_auto_build-indep:
60+
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
5861
ifneq "$(enable_build_documentation)" ""
5962
dh_auto_build -- manpages
6063
dh_auto_build -- translateddocs
6164
dh_auto_build -- docs
6265
endif
66+
endif
6367

6468
override_dh_auto_clean:
6569
if [ -r src/Makefile.inc -a -r src/config.status ]; then \
6670
dh_auto_clean; \
6771
py3clean .; \
6872
fi
6973

74+
override_dh_auto_test:
75+
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
76+
dh_auto_test
77+
endif
78+
7079
override_dh_auto_install-arch:
7180
# Install all architecture-dependent libraries and executables
7281
# in DESTDIR (the staging dir for the main package).
@@ -79,6 +88,7 @@ override_dh_auto_install-arch:
7988
rm -f $(DESTDIR)/usr/share/doc/@MAIN_PACKAGE_NAME@/examples/sample-configs/*/*position*.txt
8089

8190
override_dh_installdocs-arch:
91+
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
8292
# Sample configs go in `usr/share/doc/linuxcnc` (not `.../doc/@MAIN_PACKAGE_NAME@`)
8393
# because that's where the `linuxcnc` launcher script looks for them,
8494
# and that's inconvenient to change.
@@ -87,19 +97,21 @@ override_dh_installdocs-arch:
8797
mv debian/@MAIN_PACKAGE_NAME@/usr/share/doc/@MAIN_PACKAGE_NAME@/examples debian/@MAIN_PACKAGE_NAME@/usr/share/doc/linuxcnc
8898

8999
dh_installdocs --doc-main-package=@MAIN_PACKAGE_NAME@ --package=@MAIN_PACKAGE_NAME@-dev
90-
100+
endif
91101

92102
override_dh_auto_install-indep:
103+
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
93104
DESTDIR=$(DESTDIR) $(MAKE) -C src install-docs install-doc
94105
# Remove the docs we just built that we don't have debs for yet...
95106
rm -f $(DESTDIR)/usr/share/doc/linuxcnc/*_nb.pdf
107+
endif
96108

97109
override_dh_installdocs-indep:
110+
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
98111
# The G-code quick reference html docs are built as `docs/html/${LANG}/gcode.html`.
99-
# We install them into `/usr/share/doc/@MAIN_PACKAGE_NAME@/` in each
100-
# linuxcnc-doc-${LANG} package, then rename them there (except
101-
# for the English one) to include the language in the filename,
102-
# so they don't collide when we install all the doc debs.
112+
# We install them into `/usr/share/doc/@MAIN_PACKAGE_NAME@/` in each # linuxcnc-doc-${LANG} package,
113+
# then rename them there (except for the English one) to include the language in the filename,
114+
# so they do not collide when we install all the doc debs.
103115
#
104116
# Rename the "main" doc directories from
105117
# `usr/share/doc/@MAIN_PACKAGE_NAME@` to `usr/share/doc/linuxcnc`,
@@ -116,8 +128,10 @@ override_dh_installdocs-indep:
116128
$(RM) debian/tmp/usr/share/doc/linuxcnc/LinuxCNC_*_$$l.pdf; \
117129
done
118130
$(RM) debian/tmp/usr/share/doc/linuxcnc/*_es.adoc
119-
120-
131+
else
132+
# Avoiding error message because of examples
133+
$(RM) -fr debian/tmp/usr/share/doc/
134+
endif
121135

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

docs/src/code/building-linuxcnc.adoc

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ $ git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-source-dir
6060
This is called a "clone" of the LinuxCNC repository.
6161
The advantage is that this local clone supports the communication about changes you may decide to perform on the source tree.
6262

63-
GitHub is an infrastructure on its own and explained in depth elsewhere. Just to get you motivated if you do not know it already.offers to perform a clone for you and have that instance made publicly available.
63+
GitHub is an infrastructure on its own and explained in depth elsewhere.
64+
Just to get you motivated if you do not know it already.offers to perform a clone for you and have that instance made publicly available.
6465
GitHub refers to such an additional instance of another repository as a "fork".
6566
You can easily (and at no cost) create a fork of the LinuxCNC git repository at GitHub, and use that to track and publish your changes.
6667
After creating your own GitHub fork of LinuxCNC, clone it to your development machine and proceed with your hacking as usual.
@@ -88,9 +89,9 @@ Especially the section on <<Satisfying-Build-Dependencies,Satisfying Build Depen
8889
If you are running on a realtime-capable system (such as an install from the LinuxCNC Live/Install Image,
8990
see the <<sub:realtime,Realtime>> section below), one extra build step is needed at this time:
9091

91-
-----
92+
----
9293
$ sudo make setuid
93-
-----
94+
----
9495

9596
After you have successfully built LinuxCNC it is time to run the tests:
9697

@@ -163,10 +164,10 @@ The `src/configure` script configures how the source code will be compiled.
163164
It takes many optional arguments.
164165
List all arguments to `src/configure` by running this:
165166

166-
-----
167+
----
167168
$ cd linuxcnc-source-dir/src
168169
$ ./configure --help
169-
-----
170+
----
170171

171172
The most commonly used arguments are:
172173

@@ -210,10 +211,10 @@ Building just a specific target::
210211
If you want to build just a specific part of LinuxCNC, you can name the thing you want to build on the `make` command line.
211212
For example, if you are working on a component named `froboz`, you can build its executable by running:
212213
+
213-
-----
214+
----
214215
$ cd linuxcnc-source-dir/src
215216
$ make ../bin/froboz
216-
-----
217+
----
217218

218219
=== Building Debian Packages
219220

@@ -232,10 +233,16 @@ delivery to end users, and when building the software for a machine
232233
that does not have the build environment installed, or that does not have
233234
internet access.
234235

235-
To build packages is primarily useful when packaging the software for delivery to end users.
236-
Developers among themselves exchange only the source code, likely supported by the LinuxCNC GitHub repository referenced below.
237-
Also, when building the software for a machine that doesn't have the build environment installed,
238-
or that doesn't have internet access, one happily accepts a prebuilt package.
236+
For the impatient, try this:
237+
238+
----
239+
$ sudo apt-get install build-essential
240+
$ git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-source-dir
241+
$ cd linuxcnc-source-dir/src
242+
$ ./debian/configure
243+
$ sudo apt-get build-dep .
244+
$ DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -uc -B
245+
----
239246

240247
Building Debian packages is performed with the `dpkg-buildpackage` tool that is
241248
provided by the `dpkg-dev` package. Its execution comes with a series of prerequisites
@@ -368,9 +375,9 @@ what's missing.
368375

369376
First, install the `dpkg-checkbuilddeps` program by running:
370377

371-
-----
378+
----
372379
$ sudo apt-get install dpkg-dev
373-
-----
380+
----
374381

375382
This generates the file `debian/control` in a user-readable yaml-format
376383
which lists the build-dependencies close to the top.
@@ -387,9 +394,9 @@ If you are new to Linux and git version management, a clean start may be prefera
387394
The `dpkg-checkbuilddeps` (also from the dpkg-dev package that is installed as part of the build-essential dependencies) program
388395
can be asked to do its job (note that it needs to run from the `linuxcnc-source-dir` directory, *not* from `linuxcnc-source-dir/debian`):
389396

390-
-----
397+
----
391398
$ dpkg-checkbuilddeps
392-
-----
399+
----
393400

394401
It will emit a list of packages that are required to build LinuxCNC on your system but are not installed, yet.
395402
You can now install missing build-dependencies

0 commit comments

Comments
 (0)