Commit d2bbc197 authored by Luca Giambonini's avatar Luca Giambonini

replace the roff documentation with an asciidoc source

added new cmake modules to automatically generate .gz man files
parent 8e5d7da7
#
# (c)2015 KiCad Developers
# (c)2015 Brian Sidebotham <brian.sidebotham@gmail.com>
#
# CMake module to find a2x (part of the asciidoc toolchain).
#
# Variables generated:
#
# A2X_FOUND true when A2X_COMMAND is valid
# A2X_COMMAND The command to run a2x (may be a list including an interpreter)
# A2X_VERSION The a2x version that has been found
#
# Have a go at finding a a2x executable
find_program( A2X_PROGRAM a2x )
# Found something, attempt to try and use it...
if( A2X_PROGRAM )
execute_process(
COMMAND ${A2X_PROGRAM} --version
OUTPUT_VARIABLE _OUT
ERROR_VARIABLE _ERR
RESULT_VARIABLE _RES
OUTPUT_STRIP_TRAILING_WHITESPACE )
# If it worked, set the A2X_COMMAND
if( _RES MATCHES 0 )
set( A2X_COMMAND "${A2X_PROGRAM}" )
endif()
endif()
# If nothing could be found, test to see if we can just find the script file,
# that we'll then run with the python interpreter
if( NOT A2X_COMMAND )
find_file( A2X_SCRIPT a2x.py )
if( A2X_SCRIPT )
# Find the python interpreter quietly
if( NOT PYTHONINTERP_FOUND )
find_package( PYTHONINTERP QUIET )
endif()
if( NOT PYTHONINTERP_FOUND )
# Python's not available so can't find a2x...
set( A2X_COMMAND "" )
else()
# Build the python based command
set( A2X_COMMAND "${PYTHON_EXECUTABLE}" "${A2X_SCRIPT}" )
execute_process(
COMMAND ${A2X_COMMAND} --version
OUTPUT_VARIABLE _OUT
ERROR_VARIABLE _ERR
RESULT_VARIABLE _RES
OUTPUT_STRIP_TRAILING_WHITESPACE )
# If it still can't be run, then give up
if( NOT _RES MATCHES 0 )
set( A2X_COMMAND "" )
endif()
endif()
endif()
endif()
# If we've found a command that works, check the version
if( A2X_COMMAND )
string(REGEX REPLACE ".*a2x[^0-9.]*\([0-9.]+\).*" "\\1" A2X_VERSION "${_OUT}")
endif()
# Generate the *_FOUND as necessary, etc.
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args(
A2X
REQUIRED_VARS A2X_COMMAND
VERSION_VAR A2X_VERSION )
find_package(A2X)
if (A2X_FOUND)
add_custom_target(man ALL)
function(add_manpage name section)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}
COMMAND ${A2X_COMMAND}
--no-xmllint
--doctype manpage
--format manpage
-D ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.adoc
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.adoc
COMMENT Generating manpage for ${name}.${section}
)
add_custom_target(man-${name}.${section}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}
)
add_dependencies(man
man-${name}.${section}
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man${section}
COMPONENT documentation
)
endfunction()
endif()
AKABEI-CLEAN-CACHE(8)
=====================
:doctype: manpage
:Author: Lisa Vitolo
:Email: <shainer@chakralinux.org>
:Date: 2018
NAME
----
akabei-clean-cache - Chakra package manager: cache cleaning tool
SYNOPSIS
--------
_akabei-clean-cache_ [actions] [options]
DESCRIPTION
-----------
akabei-clean-cache is the cache management tool of the Akabei suite. All packages downloaded by Akabei are saved in the cache directory and used in operations to speed up execution. However, if left unattended the cache will grow a lot in size, occupying vast regions of disk space. This tool allows you to delete the cached packages according to different criteria.
ACTIONS
-------
If run without arguments, the default behavior is to remove all the packages in cache. It is possible to prevent the removal of some specific package file using the --keep-package option. Other possible actions are:
*-o, --clean-old*::
Cleans only the oldest packages in cache, i.e., those present in the cache for more than 2 weeks.
*-u, --clean-unused*::
Cleans only the less used packages in cache, i.e., those not requested by any Akabei operation for more than 2 weeks.
*-u, --clean-not-installed*::
Cleans all not-installed packages from cache.
OPTIONS
-------
Together with the command-line options explained below, more configuration is possible using the [cache] section of the configuration file. See akabei.conf(5) for details on how the cache behavior can be changed.
*-c, --cachedir <dir path>*::
Sets a different path for the cache directory.
*-c, --databasedir <dir path>*::
Sets a different path for the database directory.
*-k, --keep-package <package name>*::
Instructs the cache to never delete the package file corresponding to the specified name, whatever is the action executed.
BUGS
----
Report any bug in the official Chakra BugTracker, https://code.chakralinux.org in the Akabei section. Try to include as much detail as possible in your explanation.
SEE ALSO
akabei.conf(5), akabei-config(8)
This diff is collapsed.
AKABEI.CONF(5)
==============
:doctype: manpage
:Author: Lisa Vitolo
:Email: <shainer@chakralinux.org>
:Date: 2018
NAME
----
akabei.conf - Chakra package manager: configuration file
SYNOPSIS
--------
_/etc/akabei.conf_
DESCRIPTION
-----------
Akabei will try to read configuration settings from this file at every invocation. The configuration file is divided into sections (also referred to as groups) plus special sections specifying repositories. For each group there is a set of options the user can set inside the group. Sections are started with a special line containing only [section name] (see the example below).
The configuration file can be modified manually, or automatically using the akabei-config(8) tool, or generated from a pacman.conf file using akabei-conf-import(8).
Quick note: most of the options explained below can be specified from the command line too. The command line always overrides whatever it’s written in the configuration file, but of course the new setting is valid only during the current akabei execution.
GENERAL SECTION
---------------
This section contains most of the Akabei options. Note: list elements must be separated with one blank space.
*RootDir = <path>*::
Set the default root directory akabei will run into. It is a required option.
*DatabaseDir = <path>*::
Overrides the default location akabei will look for its databases in. It is a required option: in most cases, you can keep it to the default value.
*CacheDir = <path>*::
Overrides the default location of the cache directory. It is a required option.
*LogFile = <file path>*::
Sets a different path for the log file. A typical default is /var/log/akabei.log.
*UseSyslog = <yes|no>*::
Instructs akabei to use the system logger to log information. Logs can be then displayed using dmesg(1). Default: no.
*NoUpgrade = <file list>*::
All files listed here will never be touched (i.e. replaced) during an install/upgrade; the new files will be saved with an _.akabeinew_ extension. The filenames refer to files inside package archives, so don’t include the leading slash (the root directory) in their path.
*NoExtract = <file list>*::
All files listed here will never be extracted from a package into the filesystem. This is useful when you don’t want to install all the files belonging to a certain package. The filenames refer to files inside package archives, so don’t include the leading slash (the root directory) in their path.
*HoldPkg = <package list>*::
If a package in this list is to be removed from the system, akabei will first ask for confirmation to the user.
*SyncFirst = <package list>*::
When upgrading the system, if a newer version of a package in this list is found, the user will be asked to update this one first: the choice is to either cancel the current operation to update the package and restart it later, or going on with the operation. It is important you keep at least akabei in this list (it’s there by default): if akabei has to be updated, we strongly suggest not to perform operations using the old version, risking inconsistencies in the package manager.
*IgnorePkg = <package list>*::
Instructs akabei to ignore every upgrade for packages in this list.
*IgnoreGroup = <group list>*::
Instructs akabei to ignore every upgrade for packages in at least one group of the list.
CACHE SECTION
-------------
*KeepPackages = <package list>*::
Packages in this list are never removed from the cache.
*MaxSize = <x>*::
If this option is specified, the cache cannot occupy more than x megabytes. See below for what happens when the cache exceeds this size.
*MaxSizePolicy = <CleanAll|CleanOld|CleanUnused>*::
Specifies the action to be performed when the cache exceeds the maximum size allowed.
• CleanAll: all the packages are removed.
• CleanOld: cleans only the oldest, i.e. those in cache for more than 2 weeks.
• CleanUnused: clean only the least used, i.e. those not accessed by akabei for more than 2 weeks.
If the user chooses CleanOld or CleanUnused, the cache size will be (at most) halved. CleanAll is the default behavior if the user sets a maximum size.
REPOSITORY SECTION(S)
---------------------
Each section here identifies a valid repository for akabei: a repository is defined by a name and at least one location where packages can be downloaded. Locations are defined by the *Server* directive, associated to an URL (remote or local as well), or by an *Include* directive, associated to the path to a file which must contain a list of server URLs.
EXAMPLE
-------
[source,text]
----
#
# akabei.conf
#
[General]
RootDir=/
CacheDir=/var/cache/akabei
DatabaseDir=/var/lib/akabei
SyncFirst=akabei
HoldPkg=akabei glibc
[cache]
MaxSize=30
[core]
Server = https://rsync.chakralinux.org/packages/core/x86_64
[testing]
Include=/etc/akabei/mirrorlist
----
BUGS
----
Report any bug in the official Chakra BugTracker, https://code.chakralinux.org in the Akabei section. Try to include as much detail as possible in your explanation.
SEE ALSO
akabei(8), akabei-config(8), akabei-conf-import(8)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment