2008-04-02 19:30:27 +02:00
# Ports collection makefile for: squeezecenter
# Date created: Wed Apr 14, 2004
# Whom: Brooks Davis <brooks@freebsd.org>
2004-04-16 15:13:30 +02:00
#
# $FreeBSD$
#
2008-04-02 19:30:27 +02:00
PORTNAME = squeezecenter
2009-01-06 18:09:39 +01:00
PORTVERSION = 7.3.1
2004-04-16 15:13:30 +02:00
CATEGORIES = audio
2008-08-11 18:57:00 +02:00
MASTER_SITES = http://downloads.slimdevices.com/SqueezeCenter_v${ PORTVERSION } /
DISTNAME = ${ PORTNAME } -${ PORTVERSION : S /.0// } -noCPAN
2008-04-02 19:30:27 +02:00
EXTRACT_SUFX = .tgz
2004-04-16 15:13:30 +02:00
MAINTAINER = brooks@FreeBSD.org
COMMENT = Slim Devices audio streaming server
2006-05-05 07:45:13 +02:00
# Defaults support playback of relativly unrestricted formats on SB2 or
# SB3 devices and wired SB1 devices.
2009-01-06 18:09:39 +01:00
OPTIONS = APE "Support Monkey's Audio Codec input" on \
2006-05-05 07:45:13 +02:00
FAAD "Support AAC input via FAAD" on \
2006-10-05 04:56:56 +02:00
FLAC "Support FLAC output (and input on SliMP3 and SB1)" on \
2006-05-05 07:45:13 +02:00
LAME "Support MP3 output via LAME" off \
MUSEPACK "Support musepack input" on \
SHORTEN "Support Shorten input" off \
2006-10-05 04:56:56 +02:00
VORBIS "Support OGG Vorbis input (SliMP3 and SB1)" on
2006-05-05 07:45:13 +02:00
2005-04-21 07:17:02 +02:00
RESTRICTED = Contains non-redistributable firmware, documentation, and images
2008-08-11 18:57:00 +02:00
WRKSRC = ${ WRKDIR } /squeezecenter-${ PORTVERSION : S /.0// } -noCPAN
2006-05-05 07:45:13 +02:00
2006-10-06 02:17:39 +02:00
BUILD_DEPENDS += ${ SITE_PERL } /File/Which.pm:${ PORTSDIR } /sysutils/p5-File-Which
2006-10-05 04:56:56 +02:00
RUN_DEPENDS += ${ LOCALBASE } /bin/mDNSResponderPosix:${ PORTSDIR } /net/mDNSResponder \
2006-12-03 13:45:59 +01:00
${ SITE_PERL } /Compress/Zlib.pm:${ PORTSDIR } /archivers/p5-Compress-Zlib \
2007-01-22 22:44:11 +01:00
${ SITE_PERL } /${ PERL_ARCH } /DBD/mysql.pm:${ PORTSDIR } /databases/p5-DBD-mysql \
2006-10-05 04:56:56 +02:00
${ SITE_PERL } /${ PERL_ARCH } /Digest/SHA1.pm:${ PORTSDIR } /security/p5-Digest-SHA1 \
2008-04-02 19:30:27 +02:00
${ SITE_PERL } /${ PERL_ARCH } /Encode/Detect.pm:${ PORTSDIR } /converters/p5-Encode-Detect \
${ SITE_PERL } /${ PERL_ARCH } /GD.pm:${ PORTSDIR } /graphics/p5-GD \
${ SITE_PERL } /${ PERL_ARCH } /JSON/XS.pm:${ PORTSDIR } /converters/p5-JSON-XS \
2006-10-05 04:56:56 +02:00
${ SITE_PERL } /${ PERL_ARCH } /HTML/Parser.pm:${ PORTSDIR } /www/p5-HTML-Parser \
${ SITE_PERL } /${ PERL_ARCH } /Template.pm:${ PORTSDIR } /www/p5-Template-Toolkit \
${ SITE_PERL } /${ PERL_ARCH } /Time/HiRes.pm:${ PORTSDIR } /devel/p5-Time-HiRes \
2008-03-27 23:04:13 +01:00
${ SITE_PERL } /${ PERL_ARCH } /XML/Parser.pm:${ PORTSDIR } /textproc/p5-XML-Parser \
${ SITE_PERL } /${ PERL_ARCH } /YAML/Syck.pm:${ PORTSDIR } /textproc/p5-YAML-Syck
2004-04-16 15:13:30 +02:00
2005-04-21 07:17:02 +02:00
PKGINSTALL = ${ WRKDIR } /pkg-install
2005-04-22 19:31:55 +02:00
USE_PERL5 = yes
2006-10-05 04:56:56 +02:00
USE_MYSQL = yes
2006-10-06 22:48:28 +02:00
IGNORE_WITH_MYSQL = 323 40
2005-04-22 19:31:55 +02:00
2006-05-05 07:45:13 +02:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2008-04-02 19:30:27 +02:00
# We need a dependency on the server because squeezecenter runs the binary
2006-10-05 04:56:56 +02:00
# directly with a non-standard config.
RUN_DEPENDS += ${ LOCALBASE } /libexec/mysqld:${ PORTSDIR } /databases/mysql${ MYSQL_VER } -server
2006-05-05 07:45:13 +02:00
. i f ! d e f i n e d ( W I T H O U T _ A P E )
RUN_DEPENDS += mac:${ PORTSDIR } /audio/mac
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ F A A D )
RUN_DEPENDS += faad:${ PORTSDIR } /audio/faad
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ F L A C )
RUN_DEPENDS += flac:${ PORTSDIR } /audio/flac
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ L A M E )
RUN_DEPENDS += lame:${ PORTSDIR } /audio/lame
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ M U S E P A C K )
RUN_DEPENDS += mppdec:${ PORTSDIR } /audio/musepack
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ S H O R T E N )
RUN_DEPENDS += shorten:${ PORTSDIR } /audio/shorten
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ V O R B I S )
RUN_DEPENDS += oggdec:${ PORTSDIR } /audio/vorbis-tools
. e n d i f
2008-04-02 19:30:27 +02:00
USE_RC_SUBR = squeezecenter.sh
TMP_SLIMDIR = ${ WRKDIR } /_squeezecenter
2004-09-23 07:21:42 +02:00
TMP_DOCSDIR = ${ WRKDIR } /doc
2005-04-21 07:17:02 +02:00
DOCFILES = Changelog.html Installation.txt License.txt
CONFFILES = convert.conf types.conf
2008-04-02 19:30:27 +02:00
EXCEPTFILES = ${ DOCFILES } \
${ CONFFILES } \
2008-08-11 18:57:00 +02:00
CPAN/DBI.pm \
2008-05-13 17:55:19 +02:00
CPAN/GD.pm \
2008-06-17 07:14:49 +02:00
CPAN/JSON/XS/Boolean.pm \
CPAN/JSON/XS.pm \
2008-04-02 19:30:27 +02:00
CPAN/Template.pm \
CPAN/XML/Parser.pm \
MySQL/errmsg.txt \
MySQL/errmsg.sys
2004-04-16 15:13:30 +02:00
EXCEPTDIRS = Bin \
2008-03-27 23:04:13 +01:00
CPAN/arch \
2008-04-02 20:29:21 +02:00
CPAN/Compress \
2008-08-11 18:57:00 +02:00
CPAN/DBI \
2008-06-18 07:09:30 +02:00
CPAN/Encode \
2008-05-13 17:55:19 +02:00
CPAN/GD \
2008-04-02 19:30:27 +02:00
CPAN/Template \
CPAN/XML/Parser \
2008-03-27 23:04:13 +01:00
CPAN/YAML
2004-04-16 15:13:30 +02:00
CPIOARGS = --quiet -pdum -R
PLIST_SUB = SLIMDIR = ${ SLIMDIR }
2005-04-21 07:17:02 +02:00
SUB_FILES = softsqueeze.sh pkg-install
2007-01-19 01:19:39 +01:00
SUB_LIST = PERL = ${ PERL } \
2008-06-24 18:10:23 +02:00
PORTNAME = ${ PORTNAME } \
2005-04-21 07:17:02 +02:00
SLIMDIR = ${ SLIMDIR } \
2007-01-19 01:19:39 +01:00
SLIMDBDIR = ${ SLIMDBDIR } \
2007-07-15 05:47:20 +02:00
SLIMUSER = ${ SLIMUSER } \
SLIMGROUP = ${ SLIMGROUP } \
2005-04-21 07:17:02 +02:00
CONFFILES = " ${ CONFFILES } "
2004-04-16 15:13:30 +02:00
pre-fetch :
. i f ! d e f i n e d ( S L I M D I R )
@${ ECHO_MSG } ""
2008-04-02 19:30:27 +02:00
@${ ECHO_MSG } "Define SLIMDIR to override default of 'squeezecenter'."
2004-04-16 15:13:30 +02:00
@${ ECHO_MSG } ""
. e n d i f
2008-04-02 19:30:27 +02:00
SLIMDIR ?= squeezecenter
SLIMDBDIR ?= /var/db/squeezecenter
2007-07-15 05:47:20 +02:00
SLIMUSER ?= slimserv
SLIMGROUP ?= ${ SLIMUSER }
2004-04-16 15:13:30 +02:00
2005-04-21 07:17:02 +02:00
post-patch :
2006-07-25 22:24:38 +02:00
@${ REINPLACE_CMD } \
2009-01-06 18:09:39 +01:00
-e 's|/usr/bin/perl|${PERL}|g' \
-e 's|%%DISTDIR%%|${_DISTDIR}|g' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
-e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%SITE_PERL%%|${SITE_PERL}|g' \
-e 's|%%SLIMDBDIR%%|${SLIMDBDIR}|g' \
-e 's|%%TMP_SLIMDIR%%|${TMP_SLIMDIR}|g' \
${ WRKSRC } /Slim/Utils/OS/FreeBSD.pm \
2007-07-15 05:47:20 +02:00
${ WRKSRC } /scanner.pl \
${ WRKSRC } /slimserver.pl
2005-04-21 07:17:02 +02:00
2004-09-23 07:21:42 +02:00
do-build :
@${ MKDIR } -m 0755 ${ TMP_SLIMDIR }
2008-08-11 18:57:00 +02:00
cd ${ WRKSRC } && \
2008-04-02 19:30:27 +02:00
${ FIND } . -name \* .orig -o -name \* .bak \
${ EXCEPTFILES : S |^|-o -path ./| } \
2008-08-11 18:57:00 +02:00
${ EXCEPTDIRS : S |^|-o -path ./| } \
${ EXCEPTDIRS : S / $/ \/ \* / : S /^/-o -path . \/ / } -o -print | \
2004-09-23 07:21:42 +02:00
${ CPIO } ${ CPIOARGS } ${ BINOWN } :${ BINGRP } ${ TMP_SLIMDIR }
2005-04-21 07:17:02 +02:00
. f o r _ C O N F i n $ { C O N F F I L E S }
@cd ${ WRKSRC } && ${ INSTALL_DATA } ${ _CONF } ${ TMP_SLIMDIR } /${ _CONF } .sample
. e n d f o r
2004-09-23 07:21:42 +02:00
. i f ! d e f i n e d ( N O P O R T D O C S )
@${ MKDIR } ${ TMP_DOCSDIR }
@cd ${ WRKSRC } && ${ INSTALL_DATA } ${ DOCFILES } ${ TMP_DOCSDIR }
. e n d i f
2006-05-05 07:45:13 +02:00
2008-04-02 19:30:27 +02:00
pre-install :
@${ SH } ${ PKGINSTALL } ${ PKGNAME } PRE-INSTALL
do-install :
@${ MKDIR } -m 0755 ${ PREFIX } /${ SLIMDIR }
2009-01-06 18:09:39 +01:00
@${ RM } -f ${ PREFIX } /${ SLIMDIR } /Cache
2008-04-02 19:30:27 +02:00
@${ LN } -s ${ SLIMDBDIR } /cache ${ PREFIX } /${ SLIMDIR } /Cache
2008-04-04 17:48:14 +02:00
@cd ${ TMP_SLIMDIR } && ${ COPYTREE_SHARE } . ${ PREFIX } /${ SLIMDIR }
2009-01-06 18:09:39 +01:00
@${ CHMOD } 755 ${ PREFIX } /${ SLIMDIR } /slimserver.pl
@${ CHMOD } 755 ${ PREFIX } /${ SLIMDIR } /scanner.pl
@${ LN } -sf ${ LOCALBASE } /share/mysql/errmsg.txt \
2008-04-02 19:30:27 +02:00
${ PREFIX } /${ SLIMDIR } /MySQL/
2009-01-06 18:09:39 +01:00
@${ LN } -sf ${ LOCALBASE } /share/mysql/english/errmsg.sys \
2008-04-02 19:30:27 +02:00
${ PREFIX } /${ SLIMDIR } /MySQL/
@${ INSTALL_SCRIPT } ${ WRKDIR } /softsqueeze.sh ${ PREFIX } /bin/softsqueeze
. i f ! d e f i n e d ( N O P O R T D O C S )
@${ MKDIR } ${ DOCSDIR }
2008-04-04 17:48:14 +02:00
@cd ${ TMP_DOCSDIR } && ${ COPYTREE_SHARE } . ${ DOCSDIR }
2008-04-02 19:30:27 +02:00
. e n d i f
post-install :
@${ SH } ${ PKGINSTALL } ${ PKGNAME } POST-INSTALL
@${ ECHO }
@${ CAT } ${ PKGMESSAGE }
build-plist :
@${ CAT } /dev/null > ${ PLIST }
2008-09-02 22:55:46 +02:00
@${ ECHO } bin/softsqueeze >> ${ PLIST }
2005-04-21 07:17:02 +02:00
. f o r _ C O N F i n $ { C O N F F I L E S }
@${ ECHO } '@unexec if cmp -s %D/%%SLIMDIR%%/${_CONF} %D/%%SLIMDIR%%/${_CONF}.sample; then rm -f %D/%%SLIMDIR%%/${_CONF}; fi' >> ${ PLIST }
. e n d f o r
2004-09-23 07:21:42 +02:00
@${ FIND } ${ TMP_DOCSDIR } -type f | \
2008-06-12 02:56:51 +02:00
${ SED } -e 's|${TMP_DOCSDIR}|%%PORTDOCS%%%%DOCSDIR%%|' | \
2004-09-23 07:21:42 +02:00
${ SORT } >> ${ PLIST }
@${ FIND } ${ TMP_SLIMDIR } /* -type f | \
${ SED } -e 's|${TMP_SLIMDIR}|%%SLIMDIR%%|' | \
${ SORT } >> ${ PLIST }
@${ ECHO } " ${ SLIMDIR } /Cache " >> ${ PLIST }
2006-10-05 04:56:56 +02:00
@${ ECHO } " ${ SLIMDIR } /MySQL/errmsg.txt " >> ${ PLIST }
@${ ECHO } " ${ SLIMDIR } /MySQL/errmsg.sys " >> ${ PLIST }
2007-07-15 05:47:20 +02:00
${ FIND } ${ TMP_SLIMDIR } -type d | \
2008-09-02 22:55:46 +02:00
${ EGREP } -v " ${ TMP_SLIMDIR } (|/Plugins) $$ " | \
2004-09-23 07:21:42 +02:00
${ SED } -e 's|${TMP_SLIMDIR}|@dirrm %%SLIMDIR%%|' | \
${ SORT } -r >> ${ PLIST }
2007-07-15 05:47:20 +02:00
echo "@dirrmtry %%SLIMDIR%%/Plugins" >> ${ PLIST }
echo "@dirrmtry %%SLIMDIR%%" >> ${ PLIST }
2004-09-23 07:21:42 +02:00
@${ FIND } ${ TMP_DOCSDIR } -type d | \
2008-06-12 02:56:51 +02:00
${ SED } -e 's|${TMP_DOCSDIR}|%%PORTDOCS%%@dirrm %%DOCSDIR%%|' | \
2004-09-23 07:21:42 +02:00
${ SORT } -r >> ${ PLIST }
2007-01-19 01:19:39 +01:00
@${ ECHO } '@unexec rm -rf ${SLIMDBDIR}/cache > /dev/null 2>&1 || true' >> ${ PLIST }
@${ ECHO } '@dirrmtry ${SLIMDBDIR}/playlists' >> ${ PLIST }
@${ ECHO } '@dirrmtry ${SLIMDBDIR}' >> ${ PLIST }
@${ ECHO } '@unexec test -d ${SLIMDBDIR} && (echo "Configuration information saved. If you will *NOT* use this package anymore," && echo "please remove ${SLIMDBDIR} and its contents manually.")' >> ${ PLIST }
2004-09-23 07:21:42 +02:00
2004-04-16 15:13:30 +02:00
. i n c l u d e < b s d . p o r t . p o s t . m k >