aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-01-11 01:44:48 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-01-14 08:50:29 +0700
commit992e366dfd71548c090545d6dff2d2c6189196dc (patch)
treecca6510d645179e314e30ee49ec9f3fc35891554 /audio
parent8302ca169bb9180188a031c34a045d552d725fa1 (diff)
audio/freepats: Handle .cfg symlinks better.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'audio')
-rw-r--r--audio/freepats/doinst.sh4
-rw-r--r--audio/freepats/douninst.sh9
-rw-r--r--audio/freepats/freepats.SlackBuild14
3 files changed, 23 insertions, 4 deletions
diff --git a/audio/freepats/doinst.sh b/audio/freepats/doinst.sh
index 160c80f012504..746354c7e90ad 100644
--- a/audio/freepats/doinst.sh
+++ b/audio/freepats/doinst.sh
@@ -17,3 +17,7 @@ config etc/timidity/freepats.cfg.new
if [ ! -r etc/timidity/timidity.cfg ]; then
( cd etc/timidity ; ln -sf crude.cfg timidity.cfg )
fi
+
+if [ ! -r etc/timidity.cfg ]; then
+ ( cd etc ; ln -sf timidity/crude.cfg timidity.cfg )
+fi
diff --git a/audio/freepats/douninst.sh b/audio/freepats/douninst.sh
new file mode 100644
index 0000000000000..74df568c1738e
--- /dev/null
+++ b/audio/freepats/douninst.sh
@@ -0,0 +1,9 @@
+# remove symlinks, if they belong to us.
+
+[ -e etc/timidity.cfg ] && \
+ [ "$( readlink etc/timidity.cfg )" == "timidity/crude.cfg" ] && \
+ rm -f etc/timidity.cfg
+
+[ -e etc/timidity/timidity.cfg ] && \
+ [ "$( readlink etc/timidity/timidity.cfg )" == "crude.cfg" ] && \
+ rm -f etc/timidity/timidity.cfg
diff --git a/audio/freepats/freepats.SlackBuild b/audio/freepats/freepats.SlackBuild
index 7f1a38539221d..e4769082af2ee 100644
--- a/audio/freepats/freepats.SlackBuild
+++ b/audio/freepats/freepats.SlackBuild
@@ -22,18 +22,23 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20230111 bkw: Modified by SlackBuilds.org, BUILD=3:
+# - Create config file symlink at /etc/timidity.cfg, because Slackware's
+# SDL-1.2 looks there for it. Doing this makes the music work in odamex,
+# and various other games. Also add a douninst.sh that removes the
+# symlinks *if* they point to crude.cfg, to make it possible to switch
+# between freepats and eawpats without having to manually update the
+# symlinks.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=freepats
VERSION=${VERSION:-20060219}
ARCH=noarch
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -73,6 +78,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
+cat $CWD/douninst.sh > $PKG/install/douninst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE