summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie Shprung <lshprung@scu.edu>2022-12-30 10:04:55 -0800
committerLouie Shprung <lshprung@scu.edu>2022-12-30 10:04:55 -0800
commit0569fa14d9bfc07f5fcffebb3c53c3b9aa6a7592 (patch)
treef2c657e04c52909907399552548a7a836dfdd2b1
parent20aa42ad2c7740d64247e900e02638317b650209 (diff)
Package GNU Autoconf Archive
-rw-r--r--Makefile23
-rw-r--r--README7
-rw-r--r--src/Info.plist4
-rwxr-xr-xsrc/index.sh19
4 files changed, 29 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index 344a120..fd8a429 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-DOCSET_NAME = GNU_Autoconf
+DOCSET_NAME = GNU_Autoconf_Archive
DOCSET_DIR = $(DOCSET_NAME).docset
CONTENTS_DIR = $(DOCSET_DIR)/Contents
@@ -10,8 +10,11 @@ INDEX_FILE = $(RESOURCES_DIR)/docSet.dsidx
ICON_FILE = $(DOCSET_DIR)/icon.png
ARCHIVE_FILE = $(DOCSET_NAME).tgz
-MANUAL_URL = https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html_node.tar.gz
-MANUAL_FILE = tmp/autoconf.html_node.tar.gz
+MANUAL_VERSION = 2022.09.03
+MANUAL_URL = https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archive-$(MANUAL_VERSION).tar.xz
+MANUAL_SRC = tmp/autoconf-archive-$(MANUAL_VERSION)
+MANUAL_SRC_MAKEFILE = $(MANUAL_SRC)/Makefile
+MANUAL_FILE = $(MANUAL_SRC)/doc/autoconf-archive.html
DOCSET = $(INFO_PLIST_FILE) $(INDEX_FILE) $(ICON_FILE)
@@ -28,8 +31,15 @@ tmp:
$(ARCHIVE_FILE): $(DOCSET)
tar --exclude='.DS_Store' -czf $@ $(DOCSET_DIR)
-$(MANUAL_FILE): tmp
- curl -o $@ $(MANUAL_URL)
+$(MANUAL_SRC): tmp
+ curl -o $@.tar.xz $(MANUAL_URL)
+ tar -x -J -f $@.tar.xz -C tmp
+
+$(MANUAL_SRC_MAKEFILE): $(MANUAL_SRC)
+ cd $(MANUAL_SRC) && ./configure
+
+$(MANUAL_FILE): $(MANUAL_SRC_MAKEFILE)
+ cd $(MANUAL_SRC) && make html
$(DOCSET_DIR):
mkdir -p $@
@@ -42,7 +52,7 @@ $(RESOURCES_DIR): $(CONTENTS_DIR)
$(DOCUMENTS_DIR): $(RESOURCES_DIR) $(MANUAL_FILE)
mkdir -p $@
- tar -x -z -f $(MANUAL_FILE) -C $@
+ cp -r $(MANUAL_FILE)/* $@
$(INFO_PLIST_FILE): src/Info.plist $(CONTENTS_DIR)
cp src/Info.plist $@
@@ -50,7 +60,6 @@ $(INFO_PLIST_FILE): src/Info.plist $(CONTENTS_DIR)
$(INDEX_FILE): src/index.sh $(DOCUMENTS_DIR)
rm -f $@
src/index.sh $@ $(DOCUMENTS_DIR)/*.html
- #ruby src/index.rb $(DOCUMENTS_DIR)/*.html | sqlite3 $@
$(ICON_FILE): src/icon.png $(DOCSET_DIR)
cp src/icon.png $@
diff --git a/README b/README
index 1e64579..0dbe50c 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
-Here is a script and a Makefile for generating a GNU Autoconf 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 GNU Autoconf Archive docset for Dash. GNU Autoconf Archive provides m4 macros to use in autoconf projects. The script is loosely based on benzado's script for GNU Make https://github.com/benzado/gnu-make-dash-docset.
-- GNU Autoconf: https://www.gnu.org/software/autoconf/
+- GNU Autoconf Archive: https://www.gnu.org/software/autoconf-archive/
- Dash: https://kapeli.com/dash
-To generate a docset from the latest edition of the GNU Autoconf Manual, simply
+To generate a docset from the latest edition of the GNU Autoconf Archive 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.
@@ -13,3 +13,4 @@ Requirements:
- curl
- make
- sqlite3
+- texinfo
diff --git a/src/Info.plist b/src/Info.plist
index 2850204..6289fc8 100644
--- a/src/Info.plist
+++ b/src/Info.plist
@@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
- <string>gnuautoconf</string>
+ <string>gnuautoconfarchive</string>
<key>CFBundleName</key>
- <string>GNU Autoconf</string>
+ <string>GNU Autoconf Archive</string>
<key>DocSetPlatformFamily</key>
<string>autoconf</string>
<key>isDashDocset</key>
diff --git a/src/index.sh b/src/index.sh
index e81a0f7..4d4b12b 100755
--- a/src/index.sh
+++ b/src/index.sh
@@ -6,14 +6,14 @@ shift
get_title() {
FILE="$1"
- PATTERN="<title>.*\(Autoconf\).*</title>"
+ PATTERN="<title>.*\(Autoconf Archive\).*</title>"
#Find pattern in file
grep -Eo "$PATTERN" "$FILE" |
#Remove tag
sed 's/<[^>]*>//g' | \
#Remove '(automake)'
- sed 's/(Autoconf)//g' | \
+ sed 's/(Autoconf Archive)//g' | \
#Remove trailing space
sed 's/[ ]*$//g' | \
#Replace '&amp' with '&'
@@ -23,17 +23,12 @@ get_title() {
}
get_type() {
- FILE="$1"
- PATTERN="The node you are looking for is at.*Limitations-of-.*\.html;Builtin
- The node you are looking for is at;Macro"
+ FILE="$(basename $1)"
+ MACRO_PATTERN="^ax_"
- echo "$PATTERN" | while read -r line; do
- #echo "$line"
- if grep -Eq "$(echo "$line" | cut -d ';' -f 1)" "$FILE"; then
- echo "$line" | cut -d ';' -f 2
- break
- fi
- done
+ if echo "$FILE" | grep -q "$MACRO_PATTERN"; then
+ echo "Macro"
+ fi
}
insert() {