#!/bin/bash # Slackware build script for solfege # Originally written by Phillip Warner . # Modified and now maintained by B. Watson . # Original version of this script had no license. Modified version is # licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20240812 bkw: BUILD=2 # - take over maintenance. # - don't generate broken help if lilypond is installed. # - ARCH=noarch (no compiled C/etc here). # - Add notes to README about what I had to do to get audio to # work, and about freepats vs. eawpats. # Note: 3.22.2 (from 2013) is still the latest stable. I tried 3.23.4, # the latest development release (from 2016), but it fails to start # up, with some Python stack trace stuff. Stable still works (though # there are some spurious error dialogs), so stick with it. # Looks like it's abandoned upstream. # If you're wondering why this can't just be dropped from the repo... # it could be. But there's nothing else in the repo that does the same # job (ear training and music theory exercises). cd $(dirname $0) ; CWD=$(pwd) PRGNAM=solfege VERSION=${VERSION:-3.22.2} BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} ARCH=noarch 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} set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.xz cd $PRGNAM-$VERSION 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 {} \+ # Fix Makefile.in so it does not require txt2man # We will copy over our own man page patch -p1 < $CWD/Makefile.in_fix_solfege3.22.0.patch CFLAGS="$SLKCFLAGS" \ CPPFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --disable-oss-sound \ --mandir=/usr/man # 20240812 bkw: solfege source will rebuild all the PNG images # in the help/ dir if lilypond is found, otherwise use shipped versions. # There are 2 reasons to want to avoid this: (1) to save build time, # and (2) because the generated files are actually incorrect! # There's no --disable-lilypond config option, but this works: sed -i '/LILYPOND/s,:=.*,:=,' Makefile CFLAGS="$SLKCFLAGS" make # We either had to install this or txt2man cat $CWD/solfege.1 > solfege.1 make install DESTDIR=$PKG gzip $PKG/usr/man/man*/* mv $PKG/etc/solfege $PKG/etc/solfege.new PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC cp -a AUTHORS COPYING README ChangeLog changelog FAQ $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild 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