From 5254ccddad4183e84689ce96d889b23d001475b3 Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Fri, 16 Dec 2022 17:41:34 -0800 Subject: Basic debmake docset, with pages for each major chapter --- .gitignore | 4 ++-- Makefile | 18 +++++++++++++----- README | 19 +++++++++++++------ src/Info.plist | 6 +++--- src/icon.png | Bin 1617 -> 719 bytes src/index.sh | 2 +- 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 9941ba2..6126ef8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -/GNU_Make.docset -/GNU_Make.tgz +/debmake.docset +/debmake.tgz /tmp diff --git a/Makefile b/Makefile index ac6a91b..554db64 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,9 @@ -DOCSET_NAME = GNU_Automake +DOCSET_NAME = debmake +PACKAGE_NAME = debmake-doc + +ifndef $(LOCALE) + LOCALE=en +endif DOCSET_DIR = $(DOCSET_NAME).docset CONTENTS_DIR = $(DOCSET_DIR)/Contents @@ -10,8 +15,7 @@ INDEX_FILE = $(RESOURCES_DIR)/docSet.dsidx ICON_FILE = $(DOCSET_DIR)/icon.png ARCHIVE_FILE = $(DOCSET_NAME).tgz -MANUAL_URL = https://www.gnu.org/software/automake/manual/automake.html_node.tar.gz -MANUAL_FILE = tmp/automake.html_node.tar.gz +MANUAL_SOURCE = /usr/share/doc/$(PACKAGE_NAME)/html DOCSET = $(INFO_PLIST_FILE) $(INDEX_FILE) $(ICON_FILE) @@ -29,7 +33,6 @@ $(ARCHIVE_FILE): $(DOCSET) tar --exclude='.DS_Store' -czf $@ $(DOCSET_DIR) $(MANUAL_FILE): tmp - curl -o $@ $(MANUAL_URL) $(DOCSET_DIR): mkdir -p $@ @@ -41,8 +44,13 @@ $(RESOURCES_DIR): $(CONTENTS_DIR) mkdir -p $@ $(DOCUMENTS_DIR): $(RESOURCES_DIR) $(MANUAL_FILE) +ifeq (,$(wildcard $(MANUAL_SOURCE))) + $(error Missing debmake-doc package) +endif mkdir -p $@ - tar -x -z -f $(MANUAL_FILE) -C $@ + cp -r $(MANUAL_SOURCE)/*.$(LOCALE).* $@ + cp -r $(MANUAL_SOURCE)/*css $@ + cp -r $(MANUAL_SOURCE)/images $@ $(INFO_PLIST_FILE): src/Info.plist $(CONTENTS_DIR) cp src/Info.plist $@ diff --git a/README b/README index ff57476..f9812d4 100644 --- a/README +++ b/README @@ -1,15 +1,22 @@ -Here is a script and a Makefile for generating a GNU Automake docset for Dash. The script is loosely based on benzado's script for GNU Make https://github.com/benzado/gnu-make-dash-docset. +Here is a script and a Makefile for generating a debmake docset for Dash. It is built from documentation provided by the [debmake-doc](https://salsa.debian.org/debian/debmake-doc) package and provides guides useful for the creation of deb packages. The script is loosely based on benzado's script for GNU Make https://github.com/benzado/gnu-make-dash-docset. -- GNU Automake: https://www.gnu.org/software/automake/ +- debmake: https://salsa.debian.org/debian/debmake - Dash: https://kapeli.com/dash -To generate a docset from the latest edition of the GNU Automake Manual, simply -execute `make` from the same directory as this README file. The latest edition -will be downloaded from www.gnu.org and packaged appropriately. - Requirements: - any POSIX-compliant shell - curl - make - sqlite3 + +In addition, this script is designed to be run on a Debian or Debian-based system where the debmake-doc package can be installed, as the script will check to make sure it can source the docset's html pages from /usr/share/doc/debmake-doc/html + +To generate a docset from the the debmake-doc package, simply execute `make` from the same directory as this README file. The version installed on the system will be packaged appropriately. The default locale is English (en). Alternative locales can be specified by executing `make LOCALE=$(locale)` (where $(locale) is the short form, i.e. "en"). The list of supported locales is listed below: + +- German (de) +- English (en) +- Japanese (jp) +- Russian (ru) +- Chinese (China) (zh-cn) +- Chinese (Taiwan) (zh-tw) diff --git a/src/Info.plist b/src/Info.plist index f94b2c9..f2f7339 100644 --- a/src/Info.plist +++ b/src/Info.plist @@ -3,11 +3,11 @@ CFBundleIdentifier - gnuautomake + debmake CFBundleName - GNU Automake + debmake DocSetPlatformFamily - automake + debmake isDashDocset diff --git a/src/icon.png b/src/icon.png index 9b18522..364a3e8 100644 Binary files a/src/icon.png and b/src/icon.png differ diff --git a/src/index.sh b/src/index.sh index f4d898e..be1a508 100755 --- a/src/index.sh +++ b/src/index.sh @@ -6,7 +6,7 @@ shift get_title() { FILE="$1" - PATTERN=".*\(automake\).*" + PATTERN=".*" #Find pattern in file grep -Eo "$PATTERN" "$FILE" | -- cgit