Commit 9e25dabe authored by Cyril Roelandt's avatar Cyril Roelandt
Browse files

Add a manpage.

parent 31afaffd
......@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
Based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- A man page is now available
## [0.9] - 2019-06-19
### Added
- licenses: Add new licenses
......
......@@ -46,3 +46,7 @@ backends =
upt-guix
upt-nix
upt-openbsd
[options.data_files]
share/man/man1 =
upt.1
# Copyright 2018 Cyril Roelandt
# Copyright 2018-2019 Cyril Roelandt
#
# Licensed under the 3-clause BSD license. See the LICENSE file.
import configparser
import datetime
import subprocess
from setuptools import setup
from setuptools.command.sdist import sdist
from wheel.bdist_wheel import bdist_wheel
def generate_manpage():
# This function is a bit ugly, but we can live with it.
# No error handling: if something goes wrong, we want to abort ASAP.
print('Generating manpage')
# First, generate the man page from our Markdown.
cmd = 'pandoc -s -t man upt.1.md -o upt.1'
subprocess.check_call(cmd.split(' '))
# Then, insert the date and the version
date = datetime.datetime.strftime(datetime.date.today(), '%-d %B %Y')
parser = configparser.ConfigParser()
parser.read('setup.cfg')
version = parser['metadata']['version']
cmd = [
'sed', '-i',
f's/DATEPLACEHOLDER".*/{date}" "upt {version}"/',
'upt.1'
]
subprocess.check_call(cmd)
class SdistCommand(sdist):
def run(self):
generate_manpage()
sdist.run(self)
class BdistwheelCommand(bdist_wheel):
def run(self):
generate_manpage()
bdist_wheel.run(self)
setup()
setup(
cmdclass={
'sdist': SdistCommand,
'bdist_wheel': BdistwheelCommand,
},
)
---
title: UPT(1)
author: Cyril Roelandt <upt@framalistes.org>
date: DATEPLACEHOLDER
---
# NAME
upt - Universal Packaging Tool
# SYNOPSIS
upt list-backends
upt list-frontends
upt package [-f FRONTEND] [-b BACKEND] [-o OUTPUT] [\--debug] [\--quiet] PACKAGE
# DESCRIPTION
Create a package for a distribution (such as OpenBSD, Fedora, etc.) from a
language-specific package archive (such as the Python Package Index, the
Comprehensive Perl Archive Network, etc.).
Upt works with two kinds of modules:
- frontends, which parse package metadata from a software archive;
- backends, which create package definitions suitable for inclusion in your
favorite distribution.
The following subcommands are available:
**list-backends**
: List all installed backends.
**list-frontends**
: List all installed frontends.
**package [options...] \<package>**
: Package the given package. This usually requires options, described below.
# OPTIONS
-b *BACKEND*, \--backend *BACKEND*
: Specify backend to use. Must be one of the values returned by "upt
list-backends". At least one backend must be installed. If only one backend is
installed, this is optional; otherwise it is required. See BACKENDS.
\--debug
: Print debug messages. Cannot be used with \--quiet.
-f *FRONTEND*, \--frontend *FRONTEND*
: Specify frontend to use. Must be one of the values returned by "upt
list-frontends". At least one frontend must be installed. If only one frontend
is installed, this is optional; otherwise it is required. See FRONTENDS.
-h, \--help
: Show help and return.
-o, \--output *OUTPUT*
: Specify an output file or directory. If this option is not specified, stdout
will be used (if possible). The exact meaning of this option may vary depending
on the backend: it should do the most natural thing.
-q, \--quiet
: Suppress all logging output. Cannot be used with \--debug.
# BACKENDS
**upt-fedora**
: Create packages for Fedora
**upt-freebsd**
: Create packages for FreeBSD
**upt-guix**
: Create packages for GNU Guix
**upt-macports**
: Create packages for MacPorts
**upt-nix**
: Create packages for Nix
**upt-openbsd**
: Create packages for OpenBSD
# FRONTENDS
**upt-cpan**
: Gather metadata about packages hosted on cpan.org
**upt-pypi**
: Gather metadata about packages hosted on pypi.org
**upt-rubygems**
: Gather metadata about packages hosted on rubygems.org
# EXAMPLES
**List installed frontends**
: upt list-frontends
**List installed backends**
: upt list-backends
**Package "requests" from PyPI, for use in GNU Guix**
: upt package -f pypi -b guix requests
**Same, omitting "-b" when there is only one installed backend**
: upt package -f pypi requests
**Same, omitting "-f" when there is only one installed frontend**
: upt package requests
# BUGS
Bugs can be reported to upt@framalistes.org. A web interface is also available
at https://framagit.org/upt (one may sign in using their
github.com/gitlab.com/bitbucket.org credentials). Feel free to suggest new
backends and frontends.
Users are also welcome in the #upt-packaging channel on Freenode.
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