suricata/doc/userguide/Makefile.am
Jason Ish 2defd5ae5a userguide/Makefile: don't add "install" to EXTRA_DIST
Adding the directory "install" to EXTRA_DIST, actually triggers make
to run "make install", which is not what we want. Instead, avoid this
magic keyword and list the files in the install directory
individually.

If the user doesn't have permission to install files to the prefix,
like "/usr", then "make dist" can fail. Worse, even they do have
permission to write into the prefix, a "make dist" will install files
there when it shouldn't.

Ticket: #8279
2026-02-13 13:34:26 +00:00

113 lines
2.9 KiB
Makefile

# Don't simply use the directory "install" to include the files in
# install/. That name in EXTRA_DIST triggers "make dist" to run "make
# install". Which can lead to a permission denied error, or worse,
# files actually installed when they shouldn't be.
EXTRA_DIST = \
_generated \
_static \
3rd-party-integration \
acknowledgements.rst \
appendix \
capture-hardware \
command-line-options.rst \
conf.py \
configuration \
devguide \
file-extraction \
firewall \
generate-evedoc.sh \
index.rst \
upgrade \
upgrade.rst \
initscripts.rst \
install.rst \
install/debian.rst \
install/other.rst \
install/rpm.rst \
install/ubuntu.rst \
install/windows.rst \
ips \
licenses \
lua \
make-sense-alerts.rst \
manpages \
output \
partials \
performance \
plugins \
protocols \
public-data-sets.rst \
quickstart.rst \
reputation \
rule-management \
rules \
security.rst \
support-status.rst \
unix-socket.rst \
what-is-suricata.rst \
verifying-source-files.rst
if HAVE_SURICATA_MAN
dist_man1_MANS = suricata.1 suricatasc.1 suricatactl.1 suricatactl-filestore.1
endif
if SPHINX_BUILD
dist_man1_MANS = suricata.1 suricatasc.1 suricatactl.1 suricatactl-filestore.1
if HAVE_PDFLATEX
EXTRA_DIST += userguide.pdf
endif
SPHINX_BUILD = sphinx-build -q
html: _generated
sysconfdir=$(sysconfdir) \
localstatedir=$(localstatedir) \
version=$(PACKAGE_VERSION) \
$(SPHINX_BUILD) -W -b html -d _build/doctrees \
$(top_srcdir)/doc/userguide _build/html
_build/latex/Suricata.pdf: _generated
sysconfdir=$(sysconfdir) \
localstatedir=$(localstatedir) \
version=$(PACKAGE_VERSION) \
$(SPHINX_BUILD) -W -b latex -d _build/doctrees \
$(top_srcdir)/doc/userguide _build/latex
# The Sphinx generated Makefile is GNU Make specific, so just do what
# it does here - yes, multiple passes of pdflatex is required.
cd _build/latex && pdflatex Suricata.tex
cd _build/latex && pdflatex Suricata.tex
cd _build/latex && pdflatex Suricata.tex
cd _build/latex && makeindex -s python.ist Suricata.idx
cd _build/latex && pdflatex Suricata.tex
cd _build/latex && pdflatex Suricata.tex
userguide.pdf: _build/latex/Suricata.pdf
cp _build/latex/Suricata.pdf userguide.pdf
pdf: userguide.pdf
_build/man: _generated manpages/suricata.rst manpages/suricatasc.rst manpages/suricatactl.rst manpages/suricatactl-filestore.rst
RELEASE_DATE=$(RELEASE_DATE) \
sysconfdir=$(sysconfdir) \
localstatedir=$(localstatedir) \
version=$(PACKAGE_VERSION) \
$(SPHINX_BUILD) -W -b man -d _build/doctrees \
$(top_srcdir)/doc/userguide _build/man
touch _build/man
$(dist_man1_MANS): _build/man
cp _build/man/$@ .
man: $(dist_man1_MANS)
# Remove build artifacts that aren't tracked by autotools.
clean-local:
rm -rf $(top_builddir)/doc/userguide/_build
rm -f $(top_builddir)/doc/userguide/suricata*.1
rm -f $(top_builddir)/doc/userguide/userguide.pdf
endif # SPHINX_BUILD
_generated:
./generate-evedoc.sh