summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-07-14 18:10:48 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-07-14 18:10:48 (EDT)
commitc352e135a21569ff29ab3e7595744cf1e9b3450d (patch)
tree4a707f0f1bd7cda21a567b8595f68d59650c39b6
parent850f2d8c79cfe48032ac6c2620d862ab124061ec (diff)
ppt-make: New utility
-rwxr-xr-xbuild1
-rw-r--r--src/ppt-make71
2 files changed, 72 insertions, 0 deletions
diff --git a/build b/build
index aa6bfaf..b8d1dd9 100755
--- a/build
+++ b/build
@@ -17,3 +17,4 @@ install: build
install -D -m 0644 src/1/ppt-mkpkgs $(pkgdatadir)/1/ppt-mkpkgs
install -D -m 0755 src/ppt-rmpkgs $(bindir)/ppt-rmpkgs
install -D -m 0644 src/1/ppt-rmpkgs $(pkgdatadir)/1/ppt-rmpkgs
+ install -D -m 0755 src/ppt-make $(bindir)/ppt-make
diff --git a/src/ppt-make b/src/ppt-make
new file mode 100644
index 0000000..4e36267
--- /dev/null
+++ b/src/ppt-make
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+set -eu
+
+PPT_VERSION='1.0.0'
+PLATFORM=
+MAINTAINER_NAME=
+MAINTAINER_MAILBOX=
+
+main()
+{
+ local date=
+
+ prompt 'Platform' PLATFORM
+ prompt 'Maintainer name' MAINTAINER_NAME
+ prompt 'Maintainer e-mail address' MAINTAINER_MAILBOX
+
+ date="$(LC_ALL='POSIX' date '+%a, %d %b %Y %H:%M:%S %z')"
+
+ printf '2.0\n' >format
+
+ cat >control <<-EOF
+ Maintainer: ${MAINTAINER_NAME} <${MAINTAINER_MAILBOX}>
+ Build-Depends: platconf-pkg-tools (>= ${PPT_VERSION%.*})
+ EOF
+
+ cat >changelog <<-EOF
+ config-${PLATFORM} (1) trunk
+
+ * Initial release.
+
+ -- ${MAINTAINER_NAME} <${MAINTAINER_MAILBOX}> ${date}
+ EOF
+
+ mkdir src src/build src/run
+
+ cat >build <<-EOF
+ #!/usr/bin/make -f
+
+ include /usr/share/platconf-pkg-tools/build.mk
+ EOF
+ chmod 0755 build
+
+ printf 'ppt_version=%d\n' ${PPT_VERSION%%.*} >ppt-version
+
+ >copyright
+
+ cat <<-EOF
+
+Package generated.
+
+Put build-time configuration files in src/build/<package>/<upstream-ver>, e.g.:
+ src/build/linux-libre/3.10.45~gnu/config
+
+Put run-time configuration files in src/run/<package>, e.g.:
+ src/run/lilo/etc/lilo.conf.in
+
+Then run ppt-mkpkgs to generate metadata files for binary packages.
+EOF
+}
+
+prompt()
+{
+ local msg="${1}"
+ local var="${2}"
+
+ printf '%s:\n> ' "${msg}"
+ read -r "${var}"
+}
+
+main "${@}"