From 94d295070e530e1d0135acfbbfc07830aa6fdf15 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 23 Feb 2013 15:59:54 +0200 Subject: [PATCH] Created a man page. --- install_meson.py | 16 +++++++++++++--- man/meson.1 | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 man/meson.1 diff --git a/install_meson.py b/install_meson.py index 8a2c48da5..33378358e 100755 --- a/install_meson.py +++ b/install_meson.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, sys, glob, shutil +import os, sys, glob, shutil, gzip from optparse import OptionParser from meson import version @@ -51,6 +51,9 @@ script_dir = os.path.join(install_root, 'share/meson-' + version) bin_dir = os.path.join(install_root, 'bin') bin_script = os.path.join(script_dir, 'meson.py') bin_name = os.path.join(bin_dir, 'meson') +man_dir = os.path.join(install_root, 'share/man/man1') +in_manfile = 'man/meson.1' +out_manfile = os.path.join(man_dir, 'meson.1.gz') symlink_value = os.path.relpath(bin_script, os.path.dirname(bin_name)) @@ -62,11 +65,18 @@ files = [x for x in files if x not in noinstall] os.makedirs(script_dir, exist_ok=True) os.makedirs(bin_dir, exist_ok=True) +os.makedirs(man_dir, exist_ok=True) for f in files: - print('Installing %s to %s' %(f, script_dir)) + print('Installing %s to %s.' %(f, script_dir)) outfilename = os.path.join(script_dir, f) shutil.copyfile(f, outfilename) shutil.copystat(f, outfilename) - +try: + os.remove(bin_name) +except OSError: + pass +print('Creating symlink %s.' % bin_name) os.symlink(symlink_value, bin_name) +print('Installing manfile to %s.' % man_dir) +open(out_manfile, 'wb').write(gzip.compress(open(in_manfile, 'rb').read())) diff --git a/man/meson.1 b/man/meson.1 new file mode 100644 index 000000000..813ede29e --- /dev/null +++ b/man/meson.1 @@ -0,0 +1,14 @@ +.TH MESON "1" "February 2013" "meson 0.1.0" "User Commands" +.SH NAME +meson - an experimental build system +.SH DESCRIPTION +usage: meson [options] [source directory] [build directory] +.SS "options:" +.TP +\fB\-\-version\fR +print version number +.TP +\fB\-\-help\fR +print command line help +.SH SEE ALSO +https://sourceforge.net/p/meson