From 5c68db3971da41a882016fd228f2782c487b6878 Mon Sep 17 00:00:00 2001 From: Hank Greenburg Date: Tue, 3 Jun 2025 10:39:25 -0700 Subject: [PATCH] =?UTF-8?q?build:=20Add=20manpages=20to=20distribution=20?= =?UTF-8?q?=F0=9F=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index aeb1a6b..9f0584e 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,34 @@ # -*- coding: utf-8 -*- from setuptools import find_packages, setup +import os with open("README.md", encoding="utf-8") as f: long_description = f.read() + +def get_manpages(): + """ + This function goes and gets all the man pages so they can be installed when + the package is installed. + """ + man_pages = [] + for root, _, files in os.walk("docs/man"): + for file in files: + if file.endswith((".1", ".5", ".8")): + man_section = file.split(".")[-1] + dest_dir = os.path.join("share", "man", f"man{man_section}") + man_pages.append((dest_dir, [os.path.join(root, file)])) + return man_pages + + setup( name="pantalaimon", version="0.10.5", url="https://github.com/matrix-org/pantalaimon", author="The Matrix.org Team", author_email="poljar@termina.org.uk", - description=("A Matrix proxy daemon that adds E2E encryption " "capabilities."), + description=("A Matrix proxy daemon that adds E2E encryption capabilities."), long_description=long_description, long_description_content_type="text/markdown", license="Apache License, Version 2.0", @@ -45,4 +62,5 @@ setup( ], }, zip_safe=False, + data_files=get_manpages(), )