dot

packages and services management
Log | Files | Refs | README

commit 6ccd2ee2d7b47ba70cc04a1f27a775928e74b4db
parent 568386c2d5c5ea7345ef159d74aa8cf0b9aa882d
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun,  2 Dec 2018 12:52:42 +0100

enable commonplace features of gnupg

Diffstat:
Mbin/lines | 2+-
Mbin/mail-gpg | 31+++++++++++++------------------
Mbin/mail-send | 2+-
Mbin/service-log | 11+++++------
Dconf/gpg-export | 4----
Dconf/gpg-import | 6------
Mpack/gnupg/build | 50++++++++++++++++++++++++++------------------------
Dpack/gnupg/d/libbz2 | 2--
Dpack/gnupg/d/libgpg-error | 2--
Dpack/gnupg/d/libksba | 2--
Dpack/gnupg/d/libnpth | 2--
Apack/gnupg/dependencies/libbz2 | 2++
Apack/gnupg/dependencies/libgpg-error | 2++
Apack/gnupg/dependencies/libntbtls | 2++
Apack/gnupg/uri/2.2.11 | 1+
Mpack/gnupg/version | 2+-
Apack/libgcrypt/uri/1.8.4 | 1+
Mpack/libgcrypt/version | 2+-
Apack/libntbtls/build | 22++++++++++++++++++++++
Apack/libntbtls/dependencies/libgcrypt | 2++
Apack/libntbtls/dependencies/libgpg-error | 2++
Apack/libntbtls/dependencies/libz | 2++
Apack/libntbtls/homepage | 1+
Apack/libntbtls/uri/0.1.2 | 1+
Apack/libntbtls/version | 1+
Ms6/ssh-agent/x/run | 9+++++----
26 files changed, 92 insertions(+), 74 deletions(-)

diff --git a/bin/lines b/bin/lines @@ -1,7 +1,7 @@ #!/bin/sh -e # count lines of C code in a directory -du -a "${1:-.}" | awk -F '\t' ' +du -a "${@:-.}" | awk -F '\t' ' /\.[ch]$/ { cmd = "exec wc -l '\''"$2"'\''"; diff --git a/bin/mail-gpg b/bin/mail-gpg @@ -1,32 +1,27 @@ #!/usr/bin/env execlineb -elgetpositionals -P 2 -elgetopt "es" -define flags $1 -define draft $2 +importas -i flags 1 +importas -i draft 2 backtick -n x { - pipeline { mhdr -d -M -A -h from:to:cc:bcc: ${draft} } + pipeline { mhdr -d -M -A -h from:to:cc:bcc: "${draft}" } sort -u } importas -s recipients x -if { -} - fdmove -c 3 1 if { echo "Version: 1" } fdmove -c 4 1 -if { pipeline { sed "1,/^$/ d" } gpg ${flags}a -r${recipients} } +if { pipeline { sed "1,/^$/ d" "${draft}" } gpg ${flags} -a -r${recipients} } + +ifte { mv ${draft}.mime ${draft} } + { if { rm ${draft}.mime } exit 1 } -if { - redirfd -w 1 ${draft}.mime - pipeline { - if { sed "/^$/ { p; q; }" ${draft} } - if { echo "#application/pgp-encrypted /dev/fd/3" } - if { echo "#application/octet-stream /dev/fd/4" } - } - mmime -t "multipart/encrypted; protocol=\"application/pgp-encrypted\"" +redirfd -w 1 ${draft}.mime +pipeline { + if { sed "/^$/ { p; q; }" ${draft} } + if { echo "#application/pgp-encrypted /dev/fd/3" } + if { echo "#application/octet-stream /dev/fd/4" } } -mv ${draft}.mime ${draft} +mmime -t "multipart/encrypted; protocol=\"application/pgp-encrypted\"" diff --git a/bin/mail-send b/bin/mail-send @@ -18,7 +18,7 @@ define -s sendmail "${sm} ${args}" backtick -n x { mseq ${1} } importas -n draft x -if -t { if { redirfd -r 0 ${draft} mmime -c } +if { if -tn { redirfd -r 0 ${draft} mmime -c } if { redirfd -r 0 ${draft} redirfd -w 1 ${draft}.mime mmime } mv ${draft}.mime ${draft} } diff --git a/bin/service-log b/bin/service-log @@ -1,13 +1,12 @@ #!/usr/bin/env execlineb elgetpositionals -P 1 -cd /var/log backtick x { - pipeline { s6-rc -l /var/s6/.s6-rc/live list $@ } - pipeline { sed -n "s/,log$// p" } - uniq + pipeline { s6-rc -l "/var/s6/.s6-rc/live" list $@ } + pipeline { sed "s/,log$//" } + sort -u } -importas -ns -d "\n" x x +importas -ns -d "\n" sv x -pipeline { tail -f ${x}/current } +pipeline { tail -f "/var/log/${sv}/current" } s6-tai64nlocal diff --git a/conf/gpg-export b/conf/gpg-export @@ -1,4 +0,0 @@ -#!/bin/sh -ex - -cd "$HOME/.gnupg" -cp -rf "private-keys-v1.d" pubring.kbx /mnt/key/gpg diff --git a/conf/gpg-import b/conf/gpg-import @@ -1,6 +0,0 @@ -#!/bin/sh -ex - -mkdir -p "$HOME/.gnupg" -cd "$HOME/.gnupg" -gpg2 --import /mnt/key/gpg/pubring.kbx -cp /mnt/key/gpg/trustdb.gpg . diff --git a/pack/gnupg/build b/pack/gnupg/build @@ -1,52 +1,56 @@ #!/bin/sh -ex +./configure --help + export LDFLAGS='-s -static' -export CFLAGS="$CFLAGS -I$libiconv/include" -export LDFLAGS="$LDFLAGS -L$libiconv/lib -liconv" +export CFLAGS="$CFLAGS -I${libiconv}/include" +export LDFLAGS="$LDFLAGS -L${libiconv}/lib -liconv" export LIBS="$LIBS -liconv" -export CFLAGS="$CFLAGS -I$libgcrypt/include" -export LDFLAGS="$LDFLAGS -L$libgcrypt/lib" +export CFLAGS="$CFLAGS -I${libgcrypt}/include" +export LDFLAGS="$LDFLAGS -L${libgcrypt}/lib" export LIBS="$LIBS -lgcrypt" -export CFLAGS="$CFLAGS -I$libz/include" -export LDFLAGS="$LDFLAGS -L$libz/lib" +export CFLAGS="$CFLAGS -I${libz}/include" +export LDFLAGS="$LDFLAGS -L${libz}/lib" export LIBS="$LIBS -lz" -#export CFLAGS="$CFLAGS -I$libgpg_error/include" -#export LDFLAGS="$LDFLAGS -L$libgpg_error/lib" +export CFLAGS="$CFLAGS -I${libbz2}/include" +export LDFLAGS="$LDFLAGS -L${libbz2}/lib" +export LIBS="$LIBS -lbz2" + +#export CFLAGS="$CFLAGS -I${libgpg_error}/include" +#export LDFLAGS="$LDFLAGS -L${libgpg_error}/lib" #export LIBS="$LIBS -lgpg-error" -export CFLAGS="$CFLAGS -I$libassuan/include" -export LDFLAGS="$LDFLAGS -L$libassuan/lib" +export CFLAGS="$CFLAGS -I${libassuan}/include" +export LDFLAGS="$LDFLAGS -L${libassuan}/lib" export LIBS="$LIBS -lassuan" -#export CFLAGS="$CFLAGS -I$libnpth/include" -#export LDFLAGS="$LDFLAGS -L$libnpth/lib" -#export LIBS="$LIBS -lnpth" +export CFLAGS="$CFLAGS -I${libntbtls}/include" +export LDFLAGS="$LDFLAGS -L${libntbtls}/lib" +export LIBS="$LIBS -lntbtls" ./configure \ --prefix="$PREFIX" \ - --with-pinentry-pgm="$pinentry/bin/pinentry" \ - --without-iconv-prefix \ + --with-pinentry-pgm="${pinentry}/bin/pinentry" \ + --enable-ntbtls \ + --enable-dirmngr \ + --enable-wks-tools \ + --enable-bzip2 \ + --enable-zip \ + --enable-trust-models \ \ - --disable-option-checking \ - --disable-silent-rules \ --disable-scdaemon \ --disable-g13 \ - --disable-dirmngr \ --disable-doc \ --disable-symcryptrun \ --disable-gpgtar \ - --disable-wks-tools \ --disable-selinux-support \ --disable-large-secmem \ - --disable-trust-models \ --disable-tofu \ --disable-libdns \ - --disable-zip \ - --disable-bzip2 \ --disable-photo-viewers \ --disable-card-support \ --disable-ccid-driver \ @@ -55,7 +59,6 @@ export LIBS="$LIBS -lassuan" --disable-largefile \ --disable-sqlite \ --disable-npth-debug \ - --disable-ntbtls \ --disable-gnutls \ --disable-ldap \ --disable-rpath \ @@ -63,7 +66,6 @@ export LIBS="$LIBS -lassuan" --disable-regex \ --disable-optimization \ --disable-werror \ - --disable-all-tests \ --disable-run-gnupg-user-socket make install diff --git a/pack/gnupg/d/libbz2 b/pack/gnupg/d/libbz2 @@ -1 +0,0 @@ -../../libbz2/version- \ No newline at end of file diff --git a/pack/gnupg/d/libgpg-error b/pack/gnupg/d/libgpg-error @@ -1 +0,0 @@ -../../libgpg-error/version- \ No newline at end of file diff --git a/pack/gnupg/d/libksba b/pack/gnupg/d/libksba @@ -1 +0,0 @@ -../../libksba/version- \ No newline at end of file diff --git a/pack/gnupg/d/libnpth b/pack/gnupg/d/libnpth @@ -1 +0,0 @@ -../../libnpth/version- \ No newline at end of file diff --git a/pack/gnupg/dependencies/libbz2 b/pack/gnupg/dependencies/libbz2 @@ -0,0 +1 @@ +../../libbz2/version+ \ No newline at end of file diff --git a/pack/gnupg/dependencies/libgpg-error b/pack/gnupg/dependencies/libgpg-error @@ -0,0 +1 @@ +../../libgpg-error/version+ \ No newline at end of file diff --git a/pack/gnupg/dependencies/libntbtls b/pack/gnupg/dependencies/libntbtls @@ -0,0 +1 @@ +../../libntbtls/version+ \ No newline at end of file diff --git a/pack/gnupg/uri/2.2.11 b/pack/gnupg/uri/2.2.11 @@ -0,0 +1 @@ +https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.11.tar.bz2 diff --git a/pack/gnupg/version b/pack/gnupg/version @@ -1 +1 @@ -2.2.10 +2.2.11 diff --git a/pack/libgcrypt/uri/1.8.4 b/pack/libgcrypt/uri/1.8.4 @@ -0,0 +1 @@ +https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.bz2 diff --git a/pack/libgcrypt/version b/pack/libgcrypt/version @@ -1 +1 @@ -1.8.3 +1.8.4 diff --git a/pack/libntbtls/build b/pack/libntbtls/build @@ -0,0 +1,22 @@ +#!/bin/sh -ex + +export CFLAGS="${CFLAGS} -I${libgcrypt}/include" +export LDFLAGS="${LDFLAGS} -L${libgcrypt}/lib" + +export CFLAGS="${CFLAGS} -I${libz}/include" +export LDFLAGS="${LDFLAGS} -L${libz}/lib" + +export CFLAGS="${CFLAGS} -I${libgpg_error}/include" +export LDFLAGS="${LDFLAGS} -L${libgpg_error}/lib" + +./configure --help +./configure \ + --prefix="$PREFIX" \ + --enable-static \ + --disable-shared \ + --with-libgpg-error-prefix="${libgpg_error}" \ + --with-libgcrypt-prefix="${libgcrypt}" \ + --with-zlib="${libz}" + +make +make install diff --git a/pack/libntbtls/dependencies/libgcrypt b/pack/libntbtls/dependencies/libgcrypt @@ -0,0 +1 @@ +../../libgcrypt/version+ \ No newline at end of file diff --git a/pack/libntbtls/dependencies/libgpg-error b/pack/libntbtls/dependencies/libgpg-error @@ -0,0 +1 @@ +../../libgpg-error/version+ \ No newline at end of file diff --git a/pack/libntbtls/dependencies/libz b/pack/libntbtls/dependencies/libz @@ -0,0 +1 @@ +../../libz/version+ \ No newline at end of file diff --git a/pack/libntbtls/homepage b/pack/libntbtls/homepage @@ -0,0 +1 @@ +https://www.gnupg.org/software/ntbtls/index.html diff --git a/pack/libntbtls/uri/0.1.2 b/pack/libntbtls/uri/0.1.2 @@ -0,0 +1 @@ +https://www.gnupg.org/ftp/gcrypt/ntbtls/ntbtls-0.1.2.tar.bz2 diff --git a/pack/libntbtls/version b/pack/libntbtls/version @@ -0,0 +1 @@ +0.1.2 diff --git a/s6/ssh-agent/x/run b/s6/ssh-agent/x/run @@ -3,8 +3,9 @@ fdmove -c 2 1 s6-envdir env multisubstitute { importas USER USER } -backtick -n home { homeof $USER } importas home home +backtick -n x { homeof ${USER} } +importas HOME x -if { rm -f ${home}/.ssh/auth.sock } -s6-setuidgid $USER -ssh-agent -d -a ${home}/.ssh/auth.sock +if { rm -f "${HOME}/.ssh/auth.sock" } +s6-setuidgid ${USER} +ssh-agent -d -a "${HOME}/.ssh/auth.sock"