diff options
author | Stu Miller <slackbuilds@go4it2day.com> | 2018-03-29 21:45:42 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-03-31 07:41:40 +0700 |
commit | d8b9a2aa1dc3f9cac43f44e778260da8fb9e7679 (patch) | |
tree | 483078ec4e377c476d8848e949fb267848942f64 /audio/clockchimes | |
parent | 19ce57e63c909504c098282fc22e73ca4371a136 (diff) |
audio/clockchimes: Added (plays clock chimes).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'audio/clockchimes')
-rw-r--r-- | audio/clockchimes/README | 9 | ||||
-rw-r--r-- | audio/clockchimes/clockchimes.SlackBuild | 87 | ||||
-rw-r--r-- | audio/clockchimes/clockchimes.info | 10 | ||||
-rw-r--r-- | audio/clockchimes/doinst.sh | 27 | ||||
-rw-r--r-- | audio/clockchimes/slack-desc | 19 |
5 files changed, 152 insertions, 0 deletions
diff --git a/audio/clockchimes/README b/audio/clockchimes/README new file mode 100644 index 000000000000..d51474364fa7 --- /dev/null +++ b/audio/clockchimes/README @@ -0,0 +1,9 @@ +Clockchimes creates a cron job that runs a sox based bash script. +The script plays clock chime sound files based on the system time. +The initial release plays Westminster chimes on the 15 minute, +30 minute, 45 minute and top of the hour. + +The installation script modifies /var/spool/cron/crontabs/root file +or creates the /var/spool/cron/crontabs/root file if it doesn't exist. If +the user uninstalls clockchimes then the user should manually remove +the root crontab entry. diff --git a/audio/clockchimes/clockchimes.SlackBuild b/audio/clockchimes/clockchimes.SlackBuild new file mode 100644 index 000000000000..59a679c788cf --- /dev/null +++ b/audio/clockchimes/clockchimes.SlackBuild @@ -0,0 +1,87 @@ +#!/bin/sh + +# Slackware build script for clockchimes + +# Copyright 2018 - Stu Miller - Colorado, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=clockchimes +VERSION=${VERSION:-0.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +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-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README $PKG/usr/doc/$PRGNAM-$VERSION/ +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/usr/share/sounds/$PRGNAM +cp -a sounds/* $PKG/usr/share/sounds/$PRGNAM/ + +mkdir -p $PKG/usr/bin +cp -a clockchimes.sh $PKG/usr/bin/ + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/audio/clockchimes/clockchimes.info b/audio/clockchimes/clockchimes.info new file mode 100644 index 000000000000..de48a2779c95 --- /dev/null +++ b/audio/clockchimes/clockchimes.info @@ -0,0 +1,10 @@ +PRGNAM="clockchimes" +VERSION="0.1" +HOMEPAGE="https://www.go4it2day.com" +DOWNLOAD="https://www.go4it2day.com/downloads/clockchimes-0.1.tar.gz" +MD5SUM="ad552bde6ccc9ec001d762d2f3469ac3" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Stu Miller" +EMAIL="slackbuilds@go4it2day.com" diff --git a/audio/clockchimes/doinst.sh b/audio/clockchimes/doinst.sh new file mode 100644 index 000000000000..30a7850b470b --- /dev/null +++ b/audio/clockchimes/doinst.sh @@ -0,0 +1,27 @@ +# doinst.sh for clockchimes +# focus is on making sure cron is managing clockchime script + +# negative test: check if root crontab exists +if [ ! -e /var/spool/cron/crontabs/root ]; then + # true: does not exist, create root crontab and set permissions + touch /var/spool/cron/crontabs/root + chmod 0600 /var/spool/cron/crontabs/root +fi + +# negative test: check if root crontab previously modified +grep "# clockchimes" /var/spool/cron/crontabs/root 1> /dev/null +if [ $? -ne 0 ]; then + +# true: not previously modified +cat << EOF >> /var/spool/cron/crontabs/root +# clockchimes +0,15,30,45 * * * * /usr/bin/clockchimes.sh 1> /dev/null +EOF + + # positive test: check if crond is running + ps -C crond 1>/dev/null + if [ $? -eq 0 ]; then + # true: reload crond + crontab /var/spool/cron/crontabs/root 1> /dev/null + fi +fi diff --git a/audio/clockchimes/slack-desc b/audio/clockchimes/slack-desc new file mode 100644 index 000000000000..fe704aa186c6 --- /dev/null +++ b/audio/clockchimes/slack-desc @@ -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------------------------------------------------------| +clockchimes: clockchimes (plays clock chimes based on the system time) +clockchimes: +clockchimes: Clockchimes creates a cron job that runs a sox based bash script. +clockchimes: The script plays clock chime sound files based on the system time. +clockchimes: The initial release plays Westminster chimes on the 15 minute, +clockchimes: 30 minute, 45 minute and top of the hour. +clockchimes: +clockchimes: Home: http://www.go4it2day.com +clockchimes: +clockchimes: +clockchimes: |