summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2021-01-10 10:05:51 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2021-01-10 10:07:09 (EST)
commita0b0a483c49beabb6d5f5fef67a7f4e359c0951c (patch)
tree58184f75deffb1f78f11ca627fdec351dbec8ab2
Initial commit
-rw-r--r--.gitignore10
-rwxr-xr-xbuild28
-rw-r--r--changelog5
-rw-r--r--control9
-rw-r--r--dialog-doc.pkg/control9
-rw-r--r--dialog-doc.pkg/files1
-rw-r--r--dialog-locale.pkg/control9
-rw-r--r--dialog-locale.pkg/files1
-rw-r--r--dialog-ncursesw.pkg/control7
-rw-r--r--dialog-ncursesw.pkg/docs0
-rw-r--r--dialog-ncursesw.pkg/files1
-rwxr-xr-xextract-copyright-comments216
-rw-r--r--format1
-rwxr-xr-xrelease13
-rw-r--r--source.mk26
15 files changed, 336 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dd90d0e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+# Vim swap and other dot files
+.*
+!.gitignore
+
+# Source archives
+*-*.orig.tar.*
+keyring.gpg
+
+# Work area
+tmp/
diff --git a/build b/build
new file mode 100755
index 0000000..d1b61cf
--- /dev/null
+++ b/build
@@ -0,0 +1,28 @@
+#!/usr/bin/make -f
+
+include ../source.mk
+
+curses_libs = ncursesw
+
+nop:
+ @:
+
+build:
+ set -e; for lib in $(curses_libs); do \
+ oh-autoconfigure -B build_$${lib} -- \
+ --enable-nls \
+ --with-$(curses) \
+ --disable-rpath-hack; \
+ oh-autobuild -B build_$${lib}; \
+ done
+ touch $@
+
+install: build
+ set -e; for lib in $(curses_libs); do \
+ oh-autoinstall -B build_$${lib}; \
+ done
+ rm dest/usr/lib/$(OPK_HOST_ARCH)/libdialog.a
+ oh-fixperms
+ oh-strip
+ oh-installfiles
+ oh-shlibdeps
diff --git a/changelog b/changelog
new file mode 100644
index 0000000..1e4fcde
--- /dev/null
+++ b/changelog
@@ -0,0 +1,5 @@
+dialog (1.3+20201126-1) trunk
+
+ * Initial release.
+
+ -- Patrick McDermott <patrick.mcdermott@libiquity.com> Sun, 10 Jan 2021 09:29:01 -0500
diff --git a/control b/control
new file mode 100644
index 0000000..1d21d0d
--- /dev/null
+++ b/control
@@ -0,0 +1,9 @@
+Maintainer: Patrick McDermott <patrick.mcdermott@libiquity.com>
+Build-Depends:
+ opkbuild (>= 4.2.1),
+ opkhelper-3.0 (>= 3.1.3),
+ busybox (>= 1.32.0-1),
+ gpg, dirmngr,
+ libncurses.6-dev,
+ gettext-tiny,
+Homepage: https://invisible-island.net/dialog/dialog.html
diff --git a/dialog-doc.pkg/control b/dialog-doc.pkg/control
new file mode 100644
index 0000000..4678b87
--- /dev/null
+++ b/dialog-doc.pkg/control
@@ -0,0 +1,9 @@
+Architecture: all
+Platform: all
+Section: doc
+Depends: dialog-ncursesw (>= ${Source-Version})
+Description: Program to display dialog boxes from shell scripts - documentation
+ dialog is a program that will let you present a variety of questions or display
+ messages using dialog boxes from a shell script.
+ .
+ This package provides documentation for the dialog program.
diff --git a/dialog-doc.pkg/files b/dialog-doc.pkg/files
new file mode 100644
index 0000000..72ec615
--- /dev/null
+++ b/dialog-doc.pkg/files
@@ -0,0 +1 @@
+/usr/share/man/
diff --git a/dialog-locale.pkg/control b/dialog-locale.pkg/control
new file mode 100644
index 0000000..e9f74b9
--- /dev/null
+++ b/dialog-locale.pkg/control
@@ -0,0 +1,9 @@
+Architecture: all
+Platform: all
+Section: locale
+Depends: dialog-ncursesw (>= ${Source-Version})
+Description: Program to display dialog boxes from shell scripts - locales
+ dialog is a program that will let you present a variety of questions or display
+ messages using dialog boxes from a shell script.
+ .
+ This package provides locale files for the dialog program.
diff --git a/dialog-locale.pkg/files b/dialog-locale.pkg/files
new file mode 100644
index 0000000..90d0bfc
--- /dev/null
+++ b/dialog-locale.pkg/files
@@ -0,0 +1 @@
+/usr/share/locale/
diff --git a/dialog-ncursesw.pkg/control b/dialog-ncursesw.pkg/control
new file mode 100644
index 0000000..322bbaa
--- /dev/null
+++ b/dialog-ncursesw.pkg/control
@@ -0,0 +1,7 @@
+Architecture: any
+Platform: all
+Section: util
+Depends: ${Shlib-Depends}
+Description: Program to display dialog boxes from shell scripts - ncursesw
+ dialog is a program that will let you present a variety of questions or display
+ messages using dialog boxes from a shell script.
diff --git a/dialog-ncursesw.pkg/docs b/dialog-ncursesw.pkg/docs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dialog-ncursesw.pkg/docs
diff --git a/dialog-ncursesw.pkg/files b/dialog-ncursesw.pkg/files
new file mode 100644
index 0000000..78fab77
--- /dev/null
+++ b/dialog-ncursesw.pkg/files
@@ -0,0 +1 @@
+/usr/bin/dialog
diff --git a/extract-copyright-comments b/extract-copyright-comments
new file mode 100755
index 0000000..9cbf6bf
--- /dev/null
+++ b/extract-copyright-comments
@@ -0,0 +1,216 @@
+#!/bin/sh
+#
+# Extract comments containing copyright notices from C/C++ files
+#
+# Copyright (C) 2020 Patrick McDermott
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set -eu
+
+LF='
+'
+HT=' '
+
+bufc=
+bufi=
+c=
+
+getc()
+{
+ if [ ${bufi} -ge ${bufc} ]; then
+ c=''
+ else
+ eval "c=\${bufv_${bufi}}"
+ bufi=$((${bufi} + 1))
+ fi
+}
+
+extract_cxx_comment()
+{
+ local indent="${1}"
+ shift 1
+ local comment='//'
+
+ while :; do
+ getc
+ case "${c}" in
+ "${LF}")
+ break
+ ;;
+ '')
+ printf '\tError: Unterminated C++ comment\n' \
+ 1>&2
+ return 1
+ ;;
+ *)
+ comment="${comment}${c}"
+ ;;
+ esac
+ done
+
+ if printf '%s' "${comment}" | grep -Eqi \
+ 'copyright|\(c\)|license|public domain'
+ then
+ printf '\t%s\n' "${indent}${comment}"
+ fi
+
+ return 0
+}
+
+extract_c_comment()
+{
+ local indent="${1}"
+ shift 1
+ local comment='/*'
+ local asterisk=false
+
+ while :; do
+ getc
+ case "${c}" in
+ '*')
+ asterisk=true
+ comment="${comment}${c}"
+ ;;
+ '/')
+ comment="${comment}${c}"
+ if ${asterisk}; then
+ break
+ fi
+ ;;
+ '')
+ printf '\tError: Unterminated C comment\n' 1>&2
+ return 1
+ ;;
+ *)
+ asterisk=false
+ comment="${comment}${c}"
+ ;;
+ esac
+ done
+
+ if printf '%s' "${comment}" | grep -Eqi \
+ 'copyright|\(c\)|license|public domain'
+ then
+ printf '%s\n' "${indent}${comment}" | sed 's/^/\t/'
+ fi
+
+ return 0
+}
+
+extract()
+{
+ local fn="${1}"
+ shift 1
+ local newline=true
+ local indent=''
+ local quote=
+
+ printf '%s\n' "${fn}"
+
+ # Read file into array
+ eval "$(awk -v FS='' -v j=0 -v squote="'" -v esc_squote="'\\\\''" '
+ {
+ for (i = 1; i <= NF; ++i) {
+ sub(squote, esc_squote, $i);
+ printf("bufv_%d=" squote "%s" squote "\n",
+ j++, $i);
+ };
+ printf("bufv_%d=" squote "\n" squote "\n", j++);
+ }
+ END {
+ printf("bufc=%d", j);
+ }
+ ')"
+ bufi=0
+
+ while :; do
+ getc
+ case "${c}" in
+ '/')
+ newline=false
+ getc
+ case "${c}" in
+ '/')
+ extract_cxx_comment "${indent}"\
+ || return 1
+ ;;
+ '*')
+ extract_c_comment "${indent}" \
+ || return 1
+ ;;
+ esac
+ ;;
+ "${LF}")
+ newline=true
+ indent=''
+ ;;
+ "${HT}" | ' ')
+ if ${newline}; then
+ indent="${indent}${c}"
+ fi
+ ;;
+ "'" | '"')
+ newline=false
+ quote="${c}"
+ while :; do
+ getc
+ case "${c}" in
+ "${quote}")
+ break
+ ;;
+ \\)
+ # This doesn't
+ # explicitly handle
+ # octal, hexadecimal, or
+ # Unicode sequences; but
+ # it's good enough to
+ # handle escaped quotes.
+ getc
+ ;;
+ esac
+ done
+ ;;
+ '')
+ break
+ ;;
+ *)
+ newline=false
+ ;;
+ esac
+ done
+
+ return 0
+}
+
+main()
+{
+ local f=
+
+ if [ ${#} -eq 0 ]; then
+ extract 'INPUT' || return 1
+ else
+ for f in "${@}"; do
+ if [ x"${f}" = x'-' ]; then
+ extract 'INPUT' || return 1
+ else
+ extract "${f}" 0<"${f}" || return 1
+ fi
+ done
+ fi
+
+ return 0
+}
+
+main "${@}"
diff --git a/format b/format
new file mode 100644
index 0000000..cd5ac03
--- /dev/null
+++ b/format
@@ -0,0 +1 @@
+2.0
diff --git a/release b/release
new file mode 100755
index 0000000..871cb4a
--- /dev/null
+++ b/release
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -eu
+
+read src ver <<-EOF
+ $(sed '1s/^\(.*\) (\(.*\)) .*$/\1 \2/; q;' changelog)
+ EOF
+
+sed '/^ -- .* /{ s/^\( -- .* \).*$/\1'"$(LC_ALL='POSIX' date \
+ '+%a, %d %b %Y %H:%M:%S %z')"'/; :l; n; b l; };' changelog >changelog~
+mv changelog~ changelog
+git commit -m "changelog: Release ${src} ${ver}" -- changelog
+git tag "${src}/${ver}" HEAD
diff --git a/source.mk b/source.mk
new file mode 100644
index 0000000..ae5b2e2
--- /dev/null
+++ b/source.mk
@@ -0,0 +1,26 @@
+upstream_version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \
+ sed 's/+/-/')
+upstream_archive = $(OPK_SOURCE)-$(upstream_version).tgz
+upstream_url_base = https://invisible-mirror.net/archives/dialog
+upstream_url = $(upstream_url_base)/$(upstream_archive)
+source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz
+
+gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg
+keys = \
+ 'C520 48C0 C074 8FEE 227D 47A2 7023 53E0 F7E4 8EDB'
+
+$(source_archive):
+ wget -c "$(upstream_url)" "$(upstream_url).asc"
+ install -m 0700 -d gnupghome/
+ [ -e ../keyring.gpg ] || \
+ $(gpg) --keyserver hkp://pool.sks-keyservers.net \
+ --recv-keys $(keys); \
+ rm -f ../keyring.gpg~; \
+ if ! $(gpg) --verify "$(upstream_archive).asc"; then \
+ rm -Rf gnupghome/; \
+ exit 1; \
+ fi
+ rm -Rf gnupghome/
+ mv "$(upstream_archive)" '$(source_archive)'
+
+source: $(source_archive)