diff options
author | Kefu Chai <kchai@redhat.com> | 2015-03-23 07:08:16 +0100 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2015-03-24 05:36:41 +0100 |
commit | 301fe6cbf2c8b04d0650fe60de65c3cdc7a8ac95 (patch) | |
tree | 13b503dd449210a6856a63411d15aea6d6529918 | |
parent | Merge pull request #4099 from rajukv/xio-bugfix (diff) | |
download | ceph-301fe6cbf2c8b04d0650fe60de65c3cdc7a8ac95.tar.xz ceph-301fe6cbf2c8b04d0650fe60de65c3cdc7a8ac95.zip |
doc: generate man pages in man/Makefile
* move rst files from doc/man/8 into man/8
* extract man_pages setting for sphinx from doc/conf.py to man/conf.py
* generate all man pages in `make install`
* add python-sphinx to Build-Depends
* check for sphinx-build in `configure`
* run changed rst files through sphinx-build in `make check`
Signed-off-by: Kefu Chai <kchai@redhat.com>
-rw-r--r-- | ceph.spec.in | 1 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | doc/conf.py | 37 | ||||
-rw-r--r-- | man/8/ceph-authtool.rst (renamed from doc/man/8/ceph-authtool.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-clsinfo.rst (renamed from doc/man/8/ceph-clsinfo.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-conf.rst (renamed from doc/man/8/ceph-conf.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-debugpack.rst (renamed from doc/man/8/ceph-debugpack.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-dencoder.rst (renamed from doc/man/8/ceph-dencoder.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-deploy.rst (renamed from doc/man/8/ceph-deploy.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-disk.rst (renamed from doc/man/8/ceph-disk.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-fuse.rst (renamed from doc/man/8/ceph-fuse.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-mds.rst (renamed from doc/man/8/ceph-mds.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-mon.rst (renamed from doc/man/8/ceph-mon.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-osd.rst (renamed from doc/man/8/ceph-osd.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-post-file.rst (renamed from doc/man/8/ceph-post-file.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-rbdnamer.rst (renamed from doc/man/8/ceph-rbdnamer.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-rest-api.rst (renamed from doc/man/8/ceph-rest-api.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-run.rst (renamed from doc/man/8/ceph-run.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph-syn.rst (renamed from doc/man/8/ceph-syn.rst) | 0 | ||||
-rw-r--r-- | man/8/ceph.rst (renamed from doc/man/8/ceph.rst) | 0 | ||||
-rw-r--r-- | man/8/cephfs.rst (renamed from doc/man/8/cephfs.rst) | 0 | ||||
-rw-r--r-- | man/8/crushtool.rst (renamed from doc/man/8/crushtool.rst) | 0 | ||||
-rw-r--r-- | man/8/librados-config.rst (renamed from doc/man/8/librados-config.rst) | 0 | ||||
-rw-r--r-- | man/8/monmaptool.rst (renamed from doc/man/8/monmaptool.rst) | 0 | ||||
-rw-r--r-- | man/8/mount.ceph.rst (renamed from doc/man/8/mount.ceph.rst) | 0 | ||||
-rw-r--r-- | man/8/osdmaptool.rst (renamed from doc/man/8/osdmaptool.rst) | 0 | ||||
-rw-r--r-- | man/8/rados.rst (renamed from doc/man/8/rados.rst) | 0 | ||||
-rw-r--r-- | man/8/radosgw-admin.rst (renamed from doc/man/8/radosgw-admin.rst) | 0 | ||||
-rw-r--r-- | man/8/radosgw.rst (renamed from doc/man/8/radosgw.rst) | 0 | ||||
-rw-r--r-- | man/8/rbd-fuse.rst (renamed from doc/man/8/rbd-fuse.rst) | 0 | ||||
-rw-r--r-- | man/8/rbd-replay-many.rst (renamed from doc/man/8/rbd-replay-many.rst) | 0 | ||||
-rw-r--r-- | man/8/rbd-replay-prep.rst (renamed from doc/man/8/rbd-replay-prep.rst) | 0 | ||||
-rw-r--r-- | man/8/rbd-replay.rst (renamed from doc/man/8/rbd-replay.rst) | 0 | ||||
-rw-r--r-- | man/8/rbd.rst (renamed from doc/man/8/rbd.rst) | 0 | ||||
-rw-r--r-- | man/Makefile.am | 15 | ||||
-rw-r--r-- | man/conf.py | 42 |
37 files changed, 64 insertions, 37 deletions
diff --git a/ceph.spec.in b/ceph.spec.in index 61e350ad41c..7a390c69e8d 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -60,6 +60,7 @@ BuildRequires: python BuildRequires: python-argparse BuildRequires: python-nose BuildRequires: python-requests +BuildRequires: python-sphinx BuildRequires: python-virtualenv BuildRequires: util-linux BuildRequires: xfsprogs diff --git a/configure.ac b/configure.ac index 555ae99f675..66d1d20393e 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,11 @@ if test -d ".git" ; then fi AC_MSG_NOTICE([RPM_RELEASE='$RPM_RELEASE']) +AC_CHECK_PROG(SPHINX_BUILD, sphinx-build, yes, no) +if test x"$SPHINX_BUILD" = x"no"; then + AC_MSG_ERROR([sphinx-build not found (python-sphinx)]) +fi + AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SUBDIRS([src/gmock]) diff --git a/debian/control b/debian/control index 1fd68d21cba..3202f72eb06 100644 --- a/debian/control +++ b/debian/control @@ -46,6 +46,7 @@ Build-Depends: autoconf, python (>= 2.6.6-3~), python-argparse, python-nose, + python-sphinx, python-virtualenv, sdparm | hdparm, uuid-dev, diff --git a/doc/conf.py b/doc/conf.py index 99c66ed3849..f1fefe0bc7c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -32,43 +32,6 @@ extensions = [ ] todo_include_todos = True -def _get_manpages(): - import os - man_dir = os.path.join( - os.path.dirname(__file__), - 'man', - ) - sections = os.listdir(man_dir) - for section in sections: - section_dir = os.path.join(man_dir, section) - if not os.path.isdir(section_dir): - continue - for filename in os.listdir(section_dir): - base, ext = os.path.splitext(filename) - if ext != '.rst': - continue - if base == 'index': - continue - with file(os.path.join(section_dir, filename)) as f: - one = f.readline() - two = f.readline() - three = f.readline() - assert one == three - assert all(c=='=' for c in one.rstrip('\n')) - two = two.strip() - name, rest = two.split('--', 1) - assert name.strip() == base - description = rest.strip() - yield ( - os.path.join('man', section, base), - base, - description, - '', - section, - ) - -man_pages = list(_get_manpages()) - top_level = os.path.dirname( os.path.dirname( os.path.abspath(__file__) diff --git a/doc/man/8/ceph-authtool.rst b/man/8/ceph-authtool.rst index 0d3d6476b92..0d3d6476b92 100644 --- a/doc/man/8/ceph-authtool.rst +++ b/man/8/ceph-authtool.rst diff --git a/doc/man/8/ceph-clsinfo.rst b/man/8/ceph-clsinfo.rst index 6e180879554..6e180879554 100644 --- a/doc/man/8/ceph-clsinfo.rst +++ b/man/8/ceph-clsinfo.rst diff --git a/doc/man/8/ceph-conf.rst b/man/8/ceph-conf.rst index b682e035254..b682e035254 100644 --- a/doc/man/8/ceph-conf.rst +++ b/man/8/ceph-conf.rst diff --git a/doc/man/8/ceph-debugpack.rst b/man/8/ceph-debugpack.rst index c6bb782d97f..c6bb782d97f 100644 --- a/doc/man/8/ceph-debugpack.rst +++ b/man/8/ceph-debugpack.rst diff --git a/doc/man/8/ceph-dencoder.rst b/man/8/ceph-dencoder.rst index 61cb1a8af26..61cb1a8af26 100644 --- a/doc/man/8/ceph-dencoder.rst +++ b/man/8/ceph-dencoder.rst diff --git a/doc/man/8/ceph-deploy.rst b/man/8/ceph-deploy.rst index becc99db737..becc99db737 100644 --- a/doc/man/8/ceph-deploy.rst +++ b/man/8/ceph-deploy.rst diff --git a/doc/man/8/ceph-disk.rst b/man/8/ceph-disk.rst index 8b68061e2e3..8b68061e2e3 100644 --- a/doc/man/8/ceph-disk.rst +++ b/man/8/ceph-disk.rst diff --git a/doc/man/8/ceph-fuse.rst b/man/8/ceph-fuse.rst index 45189ed9c02..45189ed9c02 100644 --- a/doc/man/8/ceph-fuse.rst +++ b/man/8/ceph-fuse.rst diff --git a/doc/man/8/ceph-mds.rst b/man/8/ceph-mds.rst index 8b33ca5d9b8..8b33ca5d9b8 100644 --- a/doc/man/8/ceph-mds.rst +++ b/man/8/ceph-mds.rst diff --git a/doc/man/8/ceph-mon.rst b/man/8/ceph-mon.rst index 6395200fbe4..6395200fbe4 100644 --- a/doc/man/8/ceph-mon.rst +++ b/man/8/ceph-mon.rst diff --git a/doc/man/8/ceph-osd.rst b/man/8/ceph-osd.rst index 26163b4e80a..26163b4e80a 100644 --- a/doc/man/8/ceph-osd.rst +++ b/man/8/ceph-osd.rst diff --git a/doc/man/8/ceph-post-file.rst b/man/8/ceph-post-file.rst index 561209a1b99..561209a1b99 100644 --- a/doc/man/8/ceph-post-file.rst +++ b/man/8/ceph-post-file.rst diff --git a/doc/man/8/ceph-rbdnamer.rst b/man/8/ceph-rbdnamer.rst index ba187f5369d..ba187f5369d 100644 --- a/doc/man/8/ceph-rbdnamer.rst +++ b/man/8/ceph-rbdnamer.rst diff --git a/doc/man/8/ceph-rest-api.rst b/man/8/ceph-rest-api.rst index b736f637269..b736f637269 100644 --- a/doc/man/8/ceph-rest-api.rst +++ b/man/8/ceph-rest-api.rst diff --git a/doc/man/8/ceph-run.rst b/man/8/ceph-run.rst index 61802fb0ca3..61802fb0ca3 100644 --- a/doc/man/8/ceph-run.rst +++ b/man/8/ceph-run.rst diff --git a/doc/man/8/ceph-syn.rst b/man/8/ceph-syn.rst index 3387bbbdea0..3387bbbdea0 100644 --- a/doc/man/8/ceph-syn.rst +++ b/man/8/ceph-syn.rst diff --git a/doc/man/8/ceph.rst b/man/8/ceph.rst index 08d06bae387..08d06bae387 100644 --- a/doc/man/8/ceph.rst +++ b/man/8/ceph.rst diff --git a/doc/man/8/cephfs.rst b/man/8/cephfs.rst index 5db52ee070a..5db52ee070a 100644 --- a/doc/man/8/cephfs.rst +++ b/man/8/cephfs.rst diff --git a/doc/man/8/crushtool.rst b/man/8/crushtool.rst index 7a99eb12796..7a99eb12796 100644 --- a/doc/man/8/crushtool.rst +++ b/man/8/crushtool.rst diff --git a/doc/man/8/librados-config.rst b/man/8/librados-config.rst index 9c52574faa1..9c52574faa1 100644 --- a/doc/man/8/librados-config.rst +++ b/man/8/librados-config.rst diff --git a/doc/man/8/monmaptool.rst b/man/8/monmaptool.rst index 2396515734a..2396515734a 100644 --- a/doc/man/8/monmaptool.rst +++ b/man/8/monmaptool.rst diff --git a/doc/man/8/mount.ceph.rst b/man/8/mount.ceph.rst index 7e9ef5842f9..7e9ef5842f9 100644 --- a/doc/man/8/mount.ceph.rst +++ b/man/8/mount.ceph.rst diff --git a/doc/man/8/osdmaptool.rst b/man/8/osdmaptool.rst index 3a68fcc835e..3a68fcc835e 100644 --- a/doc/man/8/osdmaptool.rst +++ b/man/8/osdmaptool.rst diff --git a/doc/man/8/rados.rst b/man/8/rados.rst index a32d0d9b1ac..a32d0d9b1ac 100644 --- a/doc/man/8/rados.rst +++ b/man/8/rados.rst diff --git a/doc/man/8/radosgw-admin.rst b/man/8/radosgw-admin.rst index efa6108745d..efa6108745d 100644 --- a/doc/man/8/radosgw-admin.rst +++ b/man/8/radosgw-admin.rst diff --git a/doc/man/8/radosgw.rst b/man/8/radosgw.rst index 372bc72fd9e..372bc72fd9e 100644 --- a/doc/man/8/radosgw.rst +++ b/man/8/radosgw.rst diff --git a/doc/man/8/rbd-fuse.rst b/man/8/rbd-fuse.rst index b7aeca7a635..b7aeca7a635 100644 --- a/doc/man/8/rbd-fuse.rst +++ b/man/8/rbd-fuse.rst diff --git a/doc/man/8/rbd-replay-many.rst b/man/8/rbd-replay-many.rst index 310f52ea828..310f52ea828 100644 --- a/doc/man/8/rbd-replay-many.rst +++ b/man/8/rbd-replay-many.rst diff --git a/doc/man/8/rbd-replay-prep.rst b/man/8/rbd-replay-prep.rst index 3d4ce854867..3d4ce854867 100644 --- a/doc/man/8/rbd-replay-prep.rst +++ b/man/8/rbd-replay-prep.rst diff --git a/doc/man/8/rbd-replay.rst b/man/8/rbd-replay.rst index a26af106854..a26af106854 100644 --- a/doc/man/8/rbd-replay.rst +++ b/man/8/rbd-replay.rst diff --git a/doc/man/8/rbd.rst b/man/8/rbd.rst index c33593e95d6..c33593e95d6 100644 --- a/doc/man/8/rbd.rst +++ b/man/8/rbd.rst diff --git a/man/Makefile.am b/man/Makefile.am index 64f07cc8645..7f06a20f699 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -9,3 +9,18 @@ endif if ENABLE_SERVER include Makefile-server.am endif + +check-local: + sphinx-build -b man -d doctrees . $(top_builddir)/man + +# prevent `make` from running in parallel, sphinx runs better in batch mode. +.PHONY: sphinx-build.stamp + +$(dist_man_MANS): sphinx-build.stamp + +sphinx-build.stamp: + sphinx-build -Q -b man -d doctrees -c . . $(top_builddir)/man + +clean-local: + @rm -f *.8 + @rm -rf doctrees diff --git a/man/conf.py b/man/conf.py new file mode 100644 index 00000000000..4ba7317c3cc --- /dev/null +++ b/man/conf.py @@ -0,0 +1,42 @@ +import os + +project = u'Ceph' +copyright = u'2010-2014, Inktank Storage, Inc. and contributors. Licensed under Creative Commons BY-SA' +version = 'dev' +release = 'dev' + +exclude_patterns = ['**/.#*', '**/*~'] + +def _get_manpages(): + import os + man_dir = os.path.dirname(__file__) + sections = os.listdir(man_dir) + for section in sections: + section_dir = os.path.join(man_dir, section) + if not os.path.isdir(section_dir): + continue + for filename in os.listdir(section_dir): + base, ext = os.path.splitext(filename) + if ext != '.rst': + continue + if base == 'index': + continue + with file(os.path.join(section_dir, filename)) as f: + one = f.readline() + two = f.readline() + three = f.readline() + assert one == three + assert all(c=='=' for c in one.rstrip('\n')) + two = two.strip() + name, rest = two.split('--', 1) + assert name.strip() == base + description = rest.strip() + yield ( + os.path.join(section, base), + base, + description, + '', + section, + ) + +man_pages = list(_get_manpages()) |