misc/dtmflib: Added (Library to produce DTMF).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2024-04-06 07:08:14 +07:00 committed by Willy Sudiarto Raharjo
parent eac5c84da0
commit a7cd1662ff
No known key found for this signature in database
GPG key ID: 3F617144D7238786
5 changed files with 207 additions and 0 deletions

4
misc/dtmflib/README Normal file
View file

@ -0,0 +1,4 @@
dtmflib (synthesizes dialling tones)
dtmflib is a library and command-line tool that synthesizes DTMF (aka
TouchTone) telephone dialling tones.

View file

@ -0,0 +1,99 @@
#!/bin/bash
# Slackware build script for dtmflib
# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# Note: although this has "lib" in the name, and actually does install
# a library and header, I'm putting it under misc/ because it's going
# to be more useful as a standalone app (the dtmf command).
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=dtmflib
VERSION=${VERSION:-20210112_6609071}
COMMIT=${COMMIT:-6609071ba383e7a6d9bf7f7fd9d75bbdd1d8d717}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$COMMIT
tar xvf $CWD/$PRGNAM-$COMMIT.tar.gz
cd $PRGNAM-$COMMIT
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
# add a trailing newline to the -h help message.
sed -i '/-V version/s,";,\\n";,' src/dtmfutil.cpp
# man page contains a wildly inaccurate description (copied from some
# other utility?), bad grammar, and bad formatting; clean it up.
patch -p1 < $CWD/manpage.diff
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--disable-static \
--build=$ARCH-slackware-linux
make
make install-strip DESTDIR=$PKG
rm -f $PKG/usr/lib*/*.la
gzip -9 $PKG/usr/man/man*/*
# don't bother with the tiny README.
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a AUTHORS COPYING NEWS README.md $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE

10
misc/dtmflib/dtmflib.info Normal file
View file

@ -0,0 +1,10 @@
PRGNAM="dtmflib"
VERSION="20210112_6609071"
HOMEPAGE="https://github.com/gbonacini/dtmflib"
DOWNLOAD="https://github.com/gbonacini/dtmflib/archive/6609071ba383e7a6d9bf7f7fd9d75bbdd1d8d717/dtmflib-6609071ba383e7a6d9bf7f7fd9d75bbdd1d8d717.tar.gz"
MD5SUM="e315fb1a3e17df0fb33281fc8620a4ad"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="B. Watson"
EMAIL="urchlay@slackware.uk"

75
misc/dtmflib/manpage.diff Normal file
View file

@ -0,0 +1,75 @@
diff --git a/doc/dtmf.1 b/doc/dtmf.1
index b52d32f..96e6166 100644
--- a/doc/dtmf.1
+++ b/doc/dtmf.1
@@ -1,34 +1,46 @@
-.TH DTMF 1 "JAN 2019" Linux "User Manuals"
+.TH DTMF 1 "April 2024" dtmflib-20210112_6609071 "SlackBuilds.org"
.SH NAME
dtmf \- a tool to generate DTMF tones. DTMF encoder/decoder for regular files.
.SH SYNOPSIS
-.B dtmf [-s string to play]
+.B dtmf [-s string ]
.br
-.B | [ -b input file to convert] [ -c input file to convert] [-t tone file] [-o output file]
+.B | [ -b input_file] [ -c input_file] [-t tone_file] [-o output_file]
.br
-.B | [-h] | [-V]
+.B | [-h] | [-V]
.SH DESCRIPTION
-dtmf is listening for events on file system involving file or directories and it's able to send a notification and/or perform actiotions using a the plugins availables. For example, it's possible to send notifications by email, Apache Kafka messages, snmp traps, syslog-ng log entries or simply writing on the cosole.
+.B dtmf
+generates DTMF (aka TouchTone) tones and sends them to the sound card, or encodes
+files as a series of DTMF tones and saves the result to a text file of digits, or decodes a
+previously-encoded file.
.SH OPTIONS
-.IP -b\ input\ file
-It is a regular file (binary or text) that will be
-converted in tone coding.
-.IP -c\ input\ file
-It is a regular file (binary or text) that will be
-converted in tone coding intended for IOT/mocrocontroller devices, using a coding that doesn't need synchronization.
-.IP -t\ input\ file
-It contains a sequence of tones that will be converted back to the initial file (binary or text).
-.IP -o\ output\ file
-This flag is necessary if -b or -t is specified. This file will contain the encoded/decode data.
-.IP -s\ string
-The string, with one or more ascii characters representing tones (01234567890ABCD#*), will be reproduced by sound card.
-.IP -h
-print this help message.
-.IP -V
-version information.
+.TP
+\fB\-b\fR \fIinput_file\fR
+Regular file (binary or text) that will be
+converted to tone coding.
+.TP
+\fB\-c\fR \fIinput_file\fR
+Regular file (binary or text) that will be
+converted to tone coding intended for IOT/mocrocontroller devices, using a coding that doesn't need synchronization.
+.TP
+\fB\-t\fR \fItone_file\fR
+Audio file containing a sequence of tones that will be converted back to the initial file (binary or text).
+.TP
+\fB\-o\fR \fIoutput_file\fR
+This flag is necessary if -b or -t is specified. This file will contain the encoded/decode data.
+.TP
+\fB\-s\fR \fIstring\fR
+The string, with one or more ASCII characters representing tones (01234567890ABCD#*), will be reproduced by sound card.
+.TP
+\fB\-h\fR
+print help message and exit.
+.TP
+\fB\-V\fR
+print version information and exit.
.SH BUGS
This program is a beta version, changes are possible. Please send me bug report to address specified here.
.SH AUTHOR
-Gabriele Bonacini <gabriele.bonacini@protonmail.com>
-.SH "SEE ALSO"
-.BR DTMF(1)
+Gabriele Bonacini <gabriele.bonacini@protonmail.com> is the author of
+\fBdtmf\fR.
+.P
+This man page was modified by B. Watson <urchlay@slackware.uk> for use by the
+SlackBuilds.org project.

19
misc/dtmflib/slack-desc Normal file
View file

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
dtmflib: dtmflib (synthesizes dialling tones)
dtmflib:
dtmflib: dtmflib is a library and command-line tool that synthesizes DTMF (aka
dtmflib: TouchTone) telephone dialling tones.
dtmflib:
dtmflib:
dtmflib:
dtmflib:
dtmflib:
dtmflib:
dtmflib: