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](
## [Unreleased]
### Added
- A man page is now available
## [0.9] - 2019-06-19
### Added
- licenses: Add new licenses
......@@ -46,3 +46,7 @@ backends =
share/man/man1 =
# 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 -o upt.1'
subprocess.check_call(cmd.split(' '))
# Then, insert the date and the version
date = datetime.datetime.strftime(, '%-d %B %Y')
parser = configparser.ConfigParser()'setup.cfg')
version = parser['metadata']['version']
cmd = [
'sed', '-i',
f's/DATEPLACEHOLDER".*/{date}" "upt {version}"/',
class SdistCommand(sdist):
def run(self):
class BdistwheelCommand(bdist_wheel):
def run(self):
'sdist': SdistCommand,
'bdist_wheel': BdistwheelCommand,
title: UPT(1)
author: Cyril Roelandt <>
upt - Universal Packaging Tool
upt list-backends
upt list-frontends
upt package [-f FRONTEND] [-b BACKEND] [-o OUTPUT] [\--debug] [\--quiet] PACKAGE
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 all installed backends.
: List all installed frontends.
**package [options...] \<package>**
: Package the given package. This usually requires options, described below.
-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.
: 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.
: Create packages for Fedora
: Create packages for FreeBSD
: Create packages for GNU Guix
: Create packages for MacPorts
: Create packages for Nix
: Create packages for OpenBSD
: Gather metadata about packages hosted on
: Gather metadata about packages hosted on
: Gather metadata about packages hosted on
**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 can be reported to A web interface is also available
at (one may sign in using their 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