2009-10-15 00:33:31 +02:00
# Ports collection makefile for: squeezeboxserver
2008-04-02 19:30:27 +02:00
# Date created: Wed Apr 14, 2004
# Whom: Brooks Davis <brooks@freebsd.org>
2004-04-16 15:13:30 +02:00
#
# $FreeBSD$
#
2009-10-15 00:33:31 +02:00
PORTNAME = squeezeboxserver
2011-04-22 18:52:26 +02:00
PORTVERSION = 7.5.4
2012-03-08 14:15:22 +01:00
PORTREVISION = 4
2004-04-16 15:13:30 +02:00
CATEGORIES = audio
2009-10-15 00:33:31 +02:00
MASTER_SITES = http://downloads.slimdevices.com/SqueezeboxServer_v${ PORTVERSION } /
2009-10-24 19:56:07 +02:00
DISTNAME = ${ PORTNAME } -${ PORTVERSION } -noCPAN
2008-04-02 19:30:27 +02:00
EXTRACT_SUFX = .tgz
2004-04-16 15:13:30 +02:00
2011-12-05 19:41:53 +01:00
MAINTAINER = ports@FreeBSD.org
2004-04-16 15:13:30 +02:00
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 \
SHORTEN "Support Shorten input" off \
2009-01-23 22:59:48 +01:00
SOX "Support OGG Vorbis input via SoX (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
2011-04-22 18:52:26 +02:00
WRKSRC = ${ WRKDIR } /${ PORTNAME } -${ PORTVERSION } -32171-noCPAN
2006-05-05 07:45:13 +02:00
2010-09-21 09:56:43 +02:00
RUN_DEPENDS += ${ SITE_PERL } /DBIx/Class.pm:${ PORTSDIR } /databases/p5-DBIx-Class \
2009-10-15 00:33:31 +02:00
${ SITE_PERL } /File/Which.pm:${ PORTSDIR } /sysutils/p5-File-Which \
${ SITE_PERL } /URI/Find.pm:${ PORTSDIR } /textproc/p5-URI-Find \
2012-03-08 14:15:22 +01:00
${ SITE_PERL } /${ PERL_ARCH } /DBD/mysql.pm:${ PORTSDIR } /databases/p5-DBD-mysql50 \
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 \
2008-03-27 23:04:13 +01:00
${ SITE_PERL } /${ PERL_ARCH } /XML/Parser.pm:${ PORTSDIR } /textproc/p5-XML-Parser \
2009-10-15 00:33:31 +02:00
${ SITE_PERL } /${ PERL_ARCH } /YAML/Syck.pm:${ PORTSDIR } /textproc/p5-YAML-Syck \
${ SITE_PERL } /${ PERL_ARCH } /EV.pm:${ PORTSDIR } /devel/p5-EV \
2011-04-22 18:52:26 +02:00
p5-Audio-Scan>= 0.87:${ PORTSDIR } /audio/p5-Audio-Scan \
2009-12-03 02:28:10 +01:00
${ SITE_PERL } /${ PERL_ARCH } /Class/XSAccessor.pm:${ PORTSDIR } /devel/p5-Class-XSAccessor
2004-04-16 15:13:30 +02:00
2011-04-22 18:52:26 +02:00
# Work around a bug in p5-Package-Stash port
RUN_DEPENDS += p5-Package-DeprecationManager>= 0.10:${ PORTSDIR } /devel/p5-Package-DeprecationManager
2011-07-09 19:44:14 +02:00
USERS = ${ SLIMUSER }
GROUPS = ${ SLIMGROUP }
2005-04-22 19:31:55 +02:00
USE_PERL5 = yes
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 >
2010-09-21 09:56:43 +02:00
. i f $ { P E R L _ L E V E L } < 5 0 0 9 0 3
RUN_DEPENDS += p5-IO-Compress>= 2.017:${ PORTSDIR } /archivers/p5-IO-Compress
. e n d i f
2011-08-20 02:06:18 +02:00
USE_MYSQL = server
2012-03-08 14:15:22 +01:00
WANT_MYSQL_VER = 50
2009-10-24 19:56:07 +02:00
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 _ S H O R T E N )
RUN_DEPENDS += shorten:${ PORTSDIR } /audio/shorten
. e n d i f
2009-01-23 22:59:48 +01:00
. i f ! d e f i n e d ( W I T H O U T _ S O X )
RUN_DEPENDS += sox:${ PORTSDIR } /audio/sox
2006-05-05 07:45:13 +02:00
. e n d i f
2009-10-15 00:33:31 +02:00
USE_RC_SUBR = squeezeboxserver.sh
TMP_SLIMDIR = ${ WRKDIR } /_squeezeboxserver
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 } \
2009-10-15 00:33:31 +02:00
CPAN/Carp/Clan.pm \
CPAN/Class/Accessor.pm \
CPAN/Class/Accessor/Chained.pm \
CPAN/Class/C3.pm \
CPAN/Class/Inspector.pm \
CPAN/Class/XSAccessor.pm \
CPAN/Data/Page.pm \
2008-08-11 18:57:00 +02:00
CPAN/DBI.pm \
2009-10-15 00:33:31 +02:00
CPAN/EV.pm \
CPAN/File/Temp.pm \
CPAN/File/Which.pm \
2008-05-13 17:55:19 +02:00
CPAN/GD.pm \
2009-10-15 00:33:31 +02:00
CPAN/HTML/Parser.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 \
2009-10-15 00:33:31 +02:00
CPAN/Test/Simple.pm \
CPAN/URI.pm \
2008-04-02 19:30:27 +02:00
CPAN/XML/Parser.pm \
MySQL/errmsg.txt \
MySQL/errmsg.sys
2009-10-15 00:33:31 +02:00
2004-04-16 15:13:30 +02:00
EXCEPTDIRS = Bin \
2008-03-27 23:04:13 +01:00
CPAN/arch \
2009-10-15 00:33:31 +02:00
CPAN/Algorith \
CPAN/Audio \
2008-04-02 20:29:21 +02:00
CPAN/Compress \
2009-10-15 00:33:31 +02:00
CPAN/Class/Accessor/Chained \
CPAN/Class/C3 \
CPAN/Class/Inspector \
CPAN/Class/XSAccessor \
CPAN/DBD \
2008-08-11 18:57:00 +02:00
CPAN/DBI \
2009-10-15 00:33:31 +02:00
CPAN/DBIx \
2009-06-03 23:29:53 +02:00
CPAN/Digest \
2008-06-18 07:09:30 +02:00
CPAN/Encode \
2008-05-13 17:55:19 +02:00
CPAN/GD \
2009-10-15 00:33:31 +02:00
CPAN/Module \
CPAN/MRO \
CPAN/Path \
CPAN/Scope \
CPAN/Sub \
CPAN/SQL \
2008-04-02 19:30:27 +02:00
CPAN/Template \
2009-10-15 00:33:31 +02:00
CPAN/URI \
2008-04-02 19:30:27 +02:00
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
2012-01-08 02:26:12 +01:00
PLIST_SUB = SLIMDIR = ${ SLIMDIR } \
SLIMDBDIR = ${ SLIMDBDIR }
2004-04-16 15:13:30 +02:00
2009-01-10 22:49:13 +01:00
SUB_FILES = Custom.pm \
pkg-install \
2010-04-10 03:00:54 +02:00
softsqueeze.sh \
custom-convert.conf
2007-01-19 01:19:39 +01:00
SUB_LIST = PERL = ${ PERL } \
2008-06-24 18:10:23 +02:00
PORTNAME = ${ PORTNAME } \
2009-01-10 22:49:13 +01:00
SITE_PERL = ${ SITE_PERL } \
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 } ""
2009-10-15 00:33:31 +02:00
@${ ECHO_MSG } "Define SLIMDIR to override default of 'squeezeboxserver'."
2004-04-16 15:13:30 +02:00
@${ ECHO_MSG } ""
. e n d i f
2009-10-15 00:33:31 +02:00
SLIMDIR ?= squeezeboxserver
SLIMDBDIR ?= /var/db/squeezeboxserver
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' \
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-10 22:49:13 +01:00
@${ INSTALL_DATA } ${ WRKDIR } /Custom.pm \
${ PREFIX } /${ SLIMDIR } /Slim/Utils/OS/Custom.pm
2010-04-10 03:00:54 +02:00
@${ INSTALL_DATA } ${ WRKDIR } /custom-convert.conf \
${ PREFIX } /${ SLIMDIR } /custom-convert.conf
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 \
2009-01-10 22:49:13 +01:00
${ 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 }
2010-06-24 22:48:37 +02:00
@${ ECHO } "%%SLIMDIR%%/custom-convert.conf" >> ${ PLIST }
2009-01-10 22:49:13 +01:00
@${ ECHO } "%%SLIMDIR%%/Cache" >> ${ PLIST }
@${ ECHO } "%%SLIMDIR%%/MySQL/errmsg.txt" >> ${ PLIST }
@${ ECHO } "%%SLIMDIR%%/MySQL/errmsg.sys" >> ${ PLIST }
@${ ECHO } "%%SLIMDIR%%/Slim/Utils/OS/Custom.pm" >> ${ PLIST }
@${ 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 }
2009-01-10 22:49:13 +01: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 >