Commit Graph

33 Commits

Author SHA1 Message Date
Qu Wenruo 40588d4aa9 btrfs-progs: docs: fix build due to phony contents.rst
[BUG]
Since commit 8049446bb0 ("btrfs-progs: docs: placeholder for
contents.rst file on older sphinx version"), on systems with much newer
sphinx-build, "make" would not work for Documentation directory:

  $ make clean-all && ./autogen.sh && ./configure --prefix=/usr/ && make -j12
  $ ls -alh Documentation/_build
  ls: cannot access 'Documentation/_build': No such file or directory

The sphinx-build has a much newer version:

  $ sphinx-build --version
  sphinx-build 7.2.6

[CAUSE]
On systems which don't need the workaround, the phony target of
contents.rst seems to cause a dependency loop:

  GNU Make 4.4.1
  Built for x86_64-pc-linux-gnu
  Copyright (C) 1988-2023 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  Reading makefiles...
  Reading makefile 'Makefile'...
  Updating makefiles....
   Considering target file 'Makefile'.
    Looking for an implicit rule for 'Makefile'.
     Trying pattern rule '%:' with stem 'Makefile'.
    Found implicit rule '%:' for 'Makefile'.
   Finished prerequisites of target file 'Makefile'.
   No need to remake target 'Makefile'.
  Updating goal targets....
  Considering target file 'contents.rst'.
   File 'contents.rst' does not exist.
  Finished prerequisites of target file 'contents.rst'.
  Must remake target 'contents.rst'.
  Makefile:35: update target 'contents.rst' due to: target is .PHONY
  if [ "$(sphinx-build --version | cut -d' ' -f2)" \< "1.7.7" ]; then \
  	touch contents.rst; \
  fi
  Putting child 0x64ee81960130 (contents.rst) PID 66833 on the chain.
  Live child 0x64ee81960130 (contents.rst) PID 66833
  Reaping winning child 0x64ee81960130 PID 66833
  Removing child 0x64ee81960130 PID 66833 from chain.
  Successfully remade target file 'contents.rst'.

All the default make doing is just try to generate contents.rst, but
since we have much newer version, we won't generate the file at all.

[FIX]
Instead of a phony target, just move the contents.rst generation into
man page target so that we won't cause loop target on contents.rst.

Fixes: 8049446bb0 ("btrfs-progs: docs: placeholder for contents.rst file on older sphinx version")
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-04-30 21:49:15 +02:00
Anand Jain 8049446bb0 btrfs-progs: docs: placeholder for contents.rst file on older sphinx version
Older versions of sphinx require the contents.rst file otherwise the
build fails, while new versions don't need it and use index.rst.

Sphinx error:

master file btrfs-progs/Documentation/contents.rst not found
make[1]: *** [Makefile:37: man] Error 2
make: *** [Makefile:502: build-Documentation] Error 2

This build error is seen on version 1.7.6-3.

To make it work on old and new versions create a placeholder empty file
but make it a phony build target so new sphinx does not see it and
report as not in any TOC.

[ci skip]

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-01-11 17:04:48 +01:00
David Sterba 99a7f7988f btrfs-progs: docs: convert btrfs-ioctl.asciidoc to RST
Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-18 13:28:35 +02:00
David Sterba f1e54a0c09 btrfs-progs: build: use rm for cleaning build directory
'make clean' can fail in case the _build directory is not present, can
be observed with the build-tests.sh. Use plain 'rm -fd'.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-03-08 18:11:40 +01:00
David Sterba e841c811d6 btrfs-progs: docs: generate section 5 to final name directly
There was a workaround for asciidoc/xmlto build because page btrfs.5 and
btrfs.8 used the same intermediate file. To avoid clash for the section
5 page it is part of the name, this is still needed, but for sphinx we
can use the final name as it will get the right suffix. This affects
only the generated manual pages.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba f5d6bfaed0 btrfs-progs: docs: remove asciidoc build support
Remove asciidoc makefile support and config files.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba 45d4edaf97 btrfs-progs: build: drop asciidoc detection, default to sphinx
Make sphinx the default build tool, remove asciidoc target selection.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba 2e0c6ca308 btrfs-progs: docs: add remaining targets for sphinx build
Update sphinx build so that by default it now builds the manual pages,
in quiet mode. 'make html' builds the html, other sphinx targets are
available, see 'make help'. Installation now works as well.

Note: sphinx is still conditional and must be selected by
ASCIIDOOC_TOOL=sphinx ./configure

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba 4a50f64614 btrfs-progs: docs: integrate sphinx build
Make it possible to select sphinx doc generator instead of asciidoc so
we don't have two makefiles for that. It's still a bit crude and does
not support installing the files.

The required package is python-Sphinx (or similar name), built by
'sphinx-build'.

Configure:

  $ ASCIIDOC_TOOL=sphinx ./configure
  ...
            doc generator:      sphinx
  ...

Generate:

  $ cd Documentation/
  $ make man
  $ make html
  $ make info           # yes we can have info pages too

There are several more targets provided by sphinx, run 'make' to list
them.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-18 10:17:21 +01:00
A. Wilcox 2a064d77a7 btrfs-progs: docs: Don't erase XMLTO_EXTRA contents, fix docbook5 build
XMLTO_EXTRA is defined above, and then appended to if `asciidoctor` is
used to generate the manual pages.  The second definition was clearing
the value of this variable, which caused builds with asciidoctor to
fail with:

```
    [XMLTO]  btrfs-ioctl.3
xmlto: /usr/src/packages/user/btrfs-progs/src/btrfs-progs-v5.4/Documentation/btrfs-ioctl.xml does not validate (status 3)
xmlto: Fix document syntax or use --skip-validation option
validity error : no DTD found!
Document /usr/src/packages/user/btrfs-progs/src/btrfs-progs-v5.4/Documentation/btrfs-ioctl.xml does not validate
make[1]: *** [Makefile:114: btrfs-ioctl.3] Error 13
```

Fixes: 669f56177 ("btrfs-progs: docs: use docbook5 backend for asciidoctor")
Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-01-09 14:28:52 +01:00
Dimitri John Ledkov 669f561775 btrfs-progs: docs: use docbook5 backend for asciidoctor
Switch backend to docbook5 for asciidoctor and disable validation as v5
does not use DTBs.

Pull-request: #203
Issue: #201
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-10-14 17:28:09 +02:00
David Sterba 51074d2f78 btrfs-progs: docs: update clean target file masks
There's a regular manual page that matches the file glob mask *.8 so we
have to be more careful and remove only the known intermediate files.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
David Sterba 678d6c9c0f btrfs-progs: build: remove gzip dependency
The manual pages are not compressed anymore and we can remove gzip from
build dependencies and build steps.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
Mike Gilbert 14357b3e34 btrfs-progs: docs: install uncompressed manual pages
Build systems do not typically compress man pages when installing them.
This is generally left to distro packaging mechanisms, which may end up
recompressing them using a different compressor.

Author: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
David Sterba c0bf61709b btrfs-progs: docs: use manual page link instead of symlink
In order to install uncompressed manual pages we can't use the symlink
for the deprecated btrfsck page. Replace it by source command provided
by the manual page format.

Old: man8/btrfsck.8.gz (symlink)
New: man8/btrfsck.8 (file)

Reported-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
Nikolay Borisov 5a87a95115 btrfs-progs: Remove deprecated btrfs-show-super
Its function has been superseded by btrfs inspect-internal show-super.
Furthermore the tools is currently not built by default. Just remove it.

Deprecated since 4.8.

Issue: #97
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-04-24 13:00:10 +02:00
Nikolay Borisov df9158f20d btrfs-progs: Remove deprecated btrfs-zero-log standalone tool
Its function has been subsumed by "btrfs rescue zero-log". Remove its
source file and adjust make/tests soruces accordingly.

Deprecated since 4.0.

Issue: #97
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-04-24 13:00:10 +02:00
Nikolay Borisov de34a33a82 btrfs-progs: Remove btrfs-debug-tree command
There is already a replacement in the face of btrfs inspect-internal
dump-tree. And this command is just a simple wrapper around it. Just
remove it and adjust the show-blocks script to call the main btrfs
binary to achieve the same effect.

Informally deprecated since 4.4.

Issue: #97
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-04-24 13:00:10 +02:00
David Sterba 652544f4c0 btrfs-progs: build: add support for asciidoctor doc generator
We've been using asciidoc that's written in python2, which is going to
be phased out and deprecated next year. There's a replacement,
asciidoctor. Add a configure-time detection which tool is available,
update Documentation/Makefile.in.

The original asciidoc tool is still preferred as it produces slightly
better output. The file asciidoc.conf does not have a direct equivalten
in asciidoct and would need to be replaced by extension written in ruby.

The differences:

- the <literal> are not automatically underlined and are less visible in
  the generated manual page, but it's still acceptable
- the inline CSS for the html output looks subjectively worse, is less
  compact and colourful

Issue: #89
Signed-off-by: David Sterba <dsterba@suse.com>
2018-02-02 21:02:13 +01:00
David Sterba 30bce43dfd btrfs-progs: docs: clean all generated files
The section 3 manual page btrfs-ioctl was not deleted.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-31 15:14:03 +01:00
David Sterba bc2c60ad31 btrfs-progs: docs: start ioctl documentation manual page
Start documenting the ioctl interface to btrfs. The overall structure
should be settled, the formatting of the ioctl description may change in
the future, newly added ioctl descriptions should follow the examples of
BTRFS_IOC_SUBVOL_CREATE.

The document is not finished yet and will not be installed until most of
ioctls' details are filled in.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-25 15:18:09 +02:00
David Sterba 2920c8d526 btrfs-progs: build: remove unused variables from docs makefile
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 80414d6939 btrfs-progs: remove btrfs-show-super manual page and point to inspect-internal
Signed-off-by: David Sterba <dsterba@suse.com>
2016-03-15 17:27:34 +01:00
David Sterba 83ad1dcbb0 btrfs-progs: remove btrfs-debug-tree manual page and point to inspect-internal
Signed-off-by: David Sterba <dsterba@suse.com>
2016-03-14 13:42:47 +01:00
David Sterba 32c063ccb7 btrfs-progs: docs: rename btrfs-mount to btrfs-man5
The page does will not contain only mount options but other stuff.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:53 +01:00
David Sterba 4ee3d2e94d btrfs-progs: docs: add html build target
We can easily build the documentation in html format:

 $ make html

in the Documentation directory.

Signed-off-by: David Sterba <dsterba@suse.com>
2015-11-02 09:35:00 +01:00
Adam Borowski 13be89d82e btrfs-progs: doc: document btrfs-select-super(8)
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
2015-09-02 18:56:54 +02:00
David Sterba 49eab99172 btrfs-progs: add zero-log to rescue command
Copy the functionality of standalone btrfs-zero-log to the main tool.
Delete man page for btrfs-zero-log and copy the relevant parts into
btrfs-rescue(8).  The standalone utility will be removed later.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-04-22 18:21:48 +02:00
David Sterba 7ffccaf0c3 btrfs-progs: Documentaion: rename to .asciidoc
A few minor benefits:

* editors set highliting according to the extensions
* web access to the git repository (github) renders the .asciidoc
  files:
  * we can link to them from the wiki
  * the files are editable via browser and such editations can be
    submitted for merge easily

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-04-14 17:41:27 +02:00
David Sterba e1f0d9d446 btrfs-progs: autoconf: detect tools to build docs
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-03 16:06:52 +01:00
David Sterba 505669320b btrfs-progs: build, fix version macro name
Autoconf changed it to PACKAGE_VERSION and moved to config.h.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-03 16:03:30 +01:00
David Sterba 52e65ab121 btrfs-progs: autoconf: use variable substitutions in doc makefile
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-03 16:03:28 +01:00
David Sterba d90978c9cc btrfs-progs: autoconf: generate documentation makefile as well
This is plain move to .in.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-03 15:42:34 +01:00