Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 81208d0b rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Rules to build manpages and script update

parent ef2b758b
Branches
Étiquettes
1 requête de fusion!69Resolve "Man pages"
...@@ -138,6 +138,23 @@ if dep_sdl.found() and dep_mpv.found() ...@@ -138,6 +138,23 @@ if dep_sdl.found() and dep_mpv.found()
, install_dir: 'lib/lektor' ) , install_dir: 'lib/lektor' )
endif endif
# Man pages
man_sh = find_program('scripts/man.sh')
man_header = run_command('realpath', 'doc/header').stdout().strip()
man_footer = run_command('realpath', 'doc/footer').stdout().strip()
man_files = [ [ 'lektord', '1' ]
]
foreach man: man_files
man_name = man.get(0)
man_section = man.get(1, '1')
custom_target( '@0@.@1@'.format(man_name, man_section)
, input: 'doc/@0@.@1@'.format(man_name, man_section)
, output: '@0@.@1@'.format(man_name, man_section)
, command: [ man_sh, '@INPUT@', '@OUTPUT@', man_header, man_footer ]
, install: true
, install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section)) )
endforeach
# Install # Install
install_man('doc/lektord.1')
meson.add_install_script('scripts/install.sh') meson.add_install_script('scripts/install.sh')
...@@ -3,12 +3,16 @@ ...@@ -3,12 +3,16 @@
# $0: script name # $0: script name
# $1: input # $1: input
# $2: output # $2: output
[ $# -ne 2 ] && exit 1 # $3: header
# $4: footer
[ $# -ne 4 ] && exit 1
[ "$1" == "$2" ] && exit 2 [ "$1" == "$2" ] && exit 2
# Global variables # Global variables
HEADER="doc/header" HEADER="$3"
FOOTER="doc/footer" FOOTER="$4"
INPUT="$1"
OUTPUT="$2"
# Functions # Functions
function the_day() { function the_day() {
...@@ -37,5 +41,5 @@ function mk_manpage() { ...@@ -37,5 +41,5 @@ function mk_manpage() {
the_page "$2" '___PAGE___' the_page "$2" '___PAGE___'
} }
mk_manpage "$1" "$2" mk_manpage "$INPUT" "$OUTPUT"
exit 0 exit 0
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter