From 95e9ee43cfa16f8964d6c0917416e5dfa02b8c34 Mon Sep 17 00:00:00 2001 From: Himadri Sekhar Basu Date: Sat, 19 Oct 2024 21:22:31 +0530 Subject: [PATCH] Build and add docs to deb packaging - Build unix manual from argparse options - Build html docs from argparse options - Add python3-docutils, python3-sphinx and python3-sphinx-argparse as build dependencies - Fix post install and remove scripts --- debian/control | 6 +++++- debian/install | 1 + debian/leaptime-manager.doc-base | 13 +++++++++++++ debian/postinst | 4 ++++ debian/postrm | 4 ++++ debian/rules | 20 ++++++++++---------- 6 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 debian/install create mode 100644 debian/leaptime-manager.doc-base diff --git a/debian/control b/debian/control index cf974a1..462034a 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,9 @@ Build-Depends: debhelper-compat (= 13), meson, python3-all, pybuild-plugin-pyproject, + python3-docutils, + python3-sphinx, + python3-sphinx-argparse Standards-Version: 4.6.0 Homepage: https://hsbasu.github.io/leaptime-manager #Vcs-Browser: https://salsa.debian.org/debian/leaptime-manager @@ -24,7 +27,8 @@ Depends: gir1.2-xapp-1.0, python3-apt, python3-aptdaemon.gtk3widgets, ${python3:Depends}, - ${misc:Depends} + ${misc:Depends}, + ${sphinxdoc:Depends} Description: All-in-one Backup Manager Aiming to be an all-in-one, friendly to new-users, GUI based backup manager for Debian/Ubuntu based systems. diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..73752c9 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +usr diff --git a/debian/leaptime-manager.doc-base b/debian/leaptime-manager.doc-base new file mode 100644 index 0000000..9a80769 --- /dev/null +++ b/debian/leaptime-manager.doc-base @@ -0,0 +1,13 @@ +Document: leaptime-manager +Title: Debian LeapTime Manager Manual +Author: +Abstract: This manual describes what + LeapTime Manager is and how it can be + used to backup and restore different + system components like packages, user + settings, and system and user files. +Section: System/Administration + +Format: HTML +Index: /usr/share/doc/leaptime-manager/html/index.html +Files: /usr/share/doc/leaptime-manager/html/*.html diff --git a/debian/postinst b/debian/postinst index 339c884..59b3bba 100644 --- a/debian/postinst +++ b/debian/postinst @@ -12,6 +12,10 @@ case "$1" in then glib-compile-schemas /usr/share/glib-2.0/schemas fi + if which gtk4-update-icon-cache >/dev/null 2>&1 + then + gtk4-update-icon-cache -q -t -f /usr/share/icons/hicolor + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/postrm b/debian/postrm index 7ff9a0b..275c089 100644 --- a/debian/postrm +++ b/debian/postrm @@ -12,6 +12,10 @@ case "$1" in then glib-compile-schemas /usr/share/glib-2.0/schemas fi + if which gtk4-update-icon-cache >/dev/null 2>&1 + then + gtk4-update-icon-cache -q -t -f /usr/share/icons/hicolor + fi ;; *) diff --git a/debian/rules b/debian/rules index 3393a5b..9c1d8a3 100755 --- a/debian/rules +++ b/debian/rules @@ -7,22 +7,22 @@ export PYBUILD_NAME=leaptime-manager export PYBUILD_SYSTEM=pyproject %: - dh $@ --with python3 --buildsystem=meson + dh $@ --with python3,sphinxdoc --buildsystem=meson # If you need to rebuild the Sphinx documentation # Add sphinxdoc to the dh --with line # # And uncomment the following lines -# override_dh_auto_build: export http_proxy=127.0.0.1:9 -# override_dh_auto_build: export https_proxy=127.0.0.1:9 -# override_dh_auto_build: -# dh_auto_build -O--buildsystem=meson -# PYTHONPATH=. python3 -m sphinx -N -bhtml \ -# docs/ usr/share/doc/leaptime-manager/html # HTML generator -# PYTHONPATH=. python3 -m sphinx -N -bman \ -# docs/ usr/share/man/man1 # Manpage generator -# rm -rfv usr/share/doc/leaptime-manager/html/.doctrees usr/share/man/man1/.doctrees +override_dh_auto_build: export http_proxy=127.0.0.1:9 +override_dh_auto_build: export https_proxy=127.0.0.1:9 +override_dh_auto_build: + dh_auto_build -O--buildsystem=meson + PYTHONPATH=. python3 -m sphinx -N -bhtml \ + docs/ usr/share/doc/leaptime-manager/html # HTML generator + PYTHONPATH=. python3 -m sphinx -N -bman \ + docs/ usr/share/man/man1 # Manpage generator + rm -rfv usr/share/doc/leaptime-manager/html/.doctrees usr/share/man/man1/.doctrees override_dh_install: dh_install -O--buildsystem=meson