2004-04-16 13:13:30 +00:00
# Ports collection makefile for: slimserver
# Date created: Wed Apr 14, 2004
# Whom: Brooks Davis <brooks@freebsd.org>
#
# $FreeBSD$
#
PORTNAME = slimserver
2006-07-26 15:53:24 +00:00
PORTVERSION = 6.3.1
2004-04-16 13:13:30 +00:00
CATEGORIES = audio
2006-05-05 05:45:13 +00:00
MASTER_SITES = http://www.slimdevices.com/downloads/SlimServer_v${ PORTVERSION } /
DISTNAME = SlimServer_v${ PORTVERSION } .no-cpan-arch
2005-04-21 05:17:02 +00:00
DIST_SUBDIR = slimserver
2004-04-16 13:13:30 +00:00
MAINTAINER = brooks@FreeBSD.org
COMMENT = Slim Devices audio streaming server
2006-05-05 05:45:13 +00:00
# Defaults support playback of relativly unrestricted formats on SB2 or
# SB3 devices and wired SB1 devices.
OPTIONS = APE "Support Monkey's Audio Codec input" on \
FAAD "Support AAC input via FAAD" on \
FLAC "Support FLAC output (and inputs on older devices)" on \
LAME "Support MP3 output via LAME" off \
MUSEPACK "Support musepack input" on \
SHORTEN "Support Shorten input" off \
VORBIS "Support OGG Vorbis input" on
2005-04-21 05:17:02 +00:00
RESTRICTED = Contains non-redistributable firmware, documentation, and images
2006-05-05 05:45:13 +00:00
WRKSRC = ${ WRKDIR } /SlimServer_v${ PORTVERSION }
2006-01-30 23:20:05 +00:00
LIB_DEPENDS += expat.6:${ PORTSDIR } /textproc/expat2
2004-12-31 00:17:05 +00:00
RUN_DEPENDS += ${ LOCALBASE } /bin/mDNSResponderPosix:${ PORTSDIR } /net/mDNSResponder
2004-04-16 13:13:30 +00:00
2005-04-21 05:17:02 +00:00
PKGINSTALL = ${ WRKDIR } /pkg-install
2005-04-22 17:31:55 +00:00
USE_PERL5 = yes
2005-04-21 05:17:02 +00:00
SLIMCPANPKGS = Compress-Zlib-1.33.tar.gz \
DBI-1.46.tar.gz \
DBD-SQLite-1.08.tar.gz \
2006-07-25 20:24:38 +00:00
Digest-SHA1-2.11.tar.gz \
2005-04-21 05:17:02 +00:00
HTML-Parser-3.45.tar.gz \
Template-Toolkit-2.13.tar.gz \
Time-HiRes-1.66.tar.gz \
XML-Parser-2.34.tar.gz
ALLFILES = ${ DISTFILES } ${ SLIMCPANPKGS }
2004-12-31 00:17:05 +00:00
2006-05-05 05:45:13 +00:00
. i n c l u d e < b s d . p o r t . p r e . m k >
. 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
2004-12-31 00:17:05 +00:00
. i f $ { P E R L _ L E V E L } < 5 0 0 8 0 0
2006-05-05 05:45:13 +00:00
IGNORE = perl 5.8 or newer required. Install lang/perl5.8 and try again
2004-12-31 00:17:05 +00:00
. e n d i f
2004-04-16 13:13:30 +00:00
. i f $ { O S V E R S I O N } < 5 0 2 1 1 0
2006-05-05 05:45:13 +00:00
RUN_DEPENDS += { LOCALBASE} /bin/pgrep:${ PORTSDIR } /sysutils/pkill
2004-05-03 22:59:03 +00:00
PGREPBASE = ${ LOCALBASE }
. e l s e
PGREPBASE = /usr
2004-04-16 13:13:30 +00:00
. e n d i f
2005-04-21 05:17:02 +00:00
USE_RC_SUBR = slimserver.sh
2004-09-23 05:21:42 +00:00
TMP_SLIMDIR = ${ WRKDIR } /slimserver
TMP_DOCSDIR = ${ WRKDIR } /doc
2005-04-21 05:17:02 +00:00
CPANWRKDIR = ${ WRKDIR } /cpantemp
DOCFILES = Changelog.html Installation.txt License.txt
CONFFILES = convert.conf types.conf
EXCEPTFILES = ${ DOCFILES } ${ CONFFILES }
2004-04-16 13:13:30 +00:00
EXCEPTDIRS = Bin \
2004-12-31 00:17:05 +00:00
CPAN/arch
2004-04-16 13:13:30 +00:00
CPIOARGS = --quiet -pdum -R
2004-09-23 05:21:42 +00:00
PLIST = ${ WRKDIR } /pkg-plist
2004-04-16 13:13:30 +00:00
PLIST_SUB = SLIMDIR = ${ SLIMDIR }
2005-04-21 05:17:02 +00:00
PLIST_FILES = bin/softsqueeze
2004-04-16 13:13:30 +00:00
2005-04-21 05:17:02 +00:00
SUB_FILES = softsqueeze.sh pkg-install
2005-01-27 06:00:52 +00:00
SUB_LIST = PGREPBASE = ${ PGREPBASE } \
2005-04-21 05:17:02 +00:00
SLIMDIR = ${ SLIMDIR } \
CONFFILES = " ${ CONFFILES } "
2004-04-16 13:13:30 +00:00
pre-fetch :
. i f ! d e f i n e d ( S L I M D I R )
@${ ECHO_MSG } ""
2004-05-03 22:59:03 +00:00
@${ ECHO_MSG } "Define SLIMDIR to override default of 'slimserver'."
2004-04-16 13:13:30 +00:00
@${ ECHO_MSG } ""
. e n d i f
SLIMDIR ?= slimserver
2005-04-21 05:17:02 +00:00
post-fetch :
. f o r _ P K G i n $ { S L I M C P A N P K G S }
@cd ${ _DISTDIR } ; test -e ${ _PKG } || \
${ FETCH_CMD } -o ${ _PKG } http://svn.slimdevices.com/vendor/src/${ _PKG } ?view= auto
. e n d f o r
post-patch :
2006-07-25 20:24:38 +00:00
@${ REINPLACE_CMD } \
2005-04-21 05:17:02 +00:00
-e 's|%%PERL%%|${PERL}|' \
2005-10-18 19:45:10 +00:00
-e 's|%%LOCALBASE%%|${LOCALBASE}|' \
2005-04-21 05:17:02 +00:00
-e 's|%%TMP_SLIMDIR%%|${TMP_SLIMDIR}|' \
-e 's|%%CPANWRKDIR%%|${CPANWRKDIR}|' \
-e 's|%%DISTDIR%%|${_DISTDIR}|' ${ WRKSRC } /Bin/build-perl-modules.pl
2004-09-23 05:21:42 +00:00
do-build :
@${ MKDIR } -m 0755 ${ TMP_SLIMDIR }
2004-04-16 13:13:30 +00:00
@cd ${ WRKSRC } && \
2004-12-31 00:17:05 +00:00
${ FIND } . -name \* .orig ${ EXCEPTFILES : S |^|-o -path ./| } \
2004-04-16 13:13:30 +00:00
${ EXCEPTDIRS : S / $/ \* / : S /^/-o -path . \/ / } -o -print | \
2004-09-23 05:21:42 +00:00
${ CPIO } ${ CPIOARGS } ${ BINOWN } :${ BINGRP } ${ TMP_SLIMDIR }
2005-04-21 05:17:02 +00: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 05:21:42 +00: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
2005-04-21 05:17:02 +00:00
${ MKDIR } ${ CPANWRKDIR }
${ WRKSRC } /Bin/build-perl-modules.pl
2006-05-05 05:45:13 +00:00
post-build :
@${ RM } -f ${ PLIST }
2005-04-21 05:17:02 +00: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 05:21:42 +00:00
. i f ! d e f i n e d ( N O P O R T D O C S )
@${ FIND } ${ TMP_DOCSDIR } -type f | \
${ SED } -e 's|${TMP_DOCSDIR}|%%DOCSDIR%%|' | \
${ SORT } >> ${ PLIST }
. e n d i f
@${ FIND } ${ TMP_SLIMDIR } /* -type f | \
${ SED } -e 's|${TMP_SLIMDIR}|%%SLIMDIR%%|' | \
${ SORT } >> ${ PLIST }
@${ ECHO } " ${ SLIMDIR } /Cache " >> ${ PLIST }
@${ FIND } ${ TMP_SLIMDIR } -type d | \
${ SED } -e 's|${TMP_SLIMDIR}|@dirrm %%SLIMDIR%%|' | \
${ SORT } -r >> ${ PLIST }
. i f ! d e f i n e d ( N O P O R T D O C S )
@${ FIND } ${ TMP_DOCSDIR } -type d | \
${ SED } -e 's|${TMP_DOCSDIR}|@dirrm %%DOCSDIR%%|' | \
${ SORT } -r >> ${ PLIST }
. e n d i f
2006-05-06 04:14:42 +00:00
@${ ECHO } '@unexec rm -rf /var/db/slimserver/cache > /dev/null 2>&1 || true' >> ${ PLIST }
2006-05-05 05:45:13 +00:00
@${ ECHO } '@dirrmtry /var/db/slimserver/playlists' >> ${ PLIST }
@${ ECHO } '@dirrmtry /var/db/slimserver' >> ${ PLIST }
@${ ECHO } '@unexec test -d /var/db/slimserver && (echo "Configuration information saved. If you will *NOT* use this package anymore," && echo "please remove /var/db/slimserver and its contents manually.")' >> ${ PLIST }
2004-09-23 05:21:42 +00:00
2004-12-31 00:17:05 +00:00
pre-install :
@${ SH } ${ PKGINSTALL } ${ PKGNAME } PRE-INSTALL
2004-09-23 05:21:42 +00:00
do-install :
@${ MKDIR } -m 0755 ${ PREFIX } /${ SLIMDIR }
@${ LN } -s /var/db/slimserver/cache ${ PREFIX } /${ SLIMDIR } /Cache
@cd ${ TMP_SLIMDIR } && \
${ FIND } . | \
2004-04-16 13:13:30 +00:00
${ CPIO } ${ CPIOARGS } ${ BINOWN } :${ BINGRP } ${ PREFIX } /${ SLIMDIR }
2004-12-31 00:17:05 +00:00
@${ INSTALL_SCRIPT } ${ WRKDIR } /softsqueeze.sh ${ PREFIX } /bin/softsqueeze
2004-04-16 13:13:30 +00:00
. i f ! d e f i n e d ( N O P O R T D O C S )
@${ MKDIR } ${ DOCSDIR }
2004-09-23 05:21:42 +00:00
@cd ${ TMP_DOCSDIR } && \
${ FIND } . | \
${ CPIO } ${ CPIOARGS } ${ BINOWN } :${ BINGRP } ${ DOCSDIR }
2004-04-16 13:13:30 +00:00
. e n d i f
post-install :
2004-09-23 05:21:42 +00:00
@${ SH } ${ PKGINSTALL } ${ PKGNAME } POST-INSTALL
2004-05-03 22:59:03 +00:00
@${ ECHO }
@${ CAT } ${ PKGMESSAGE }
2004-04-16 13:13:30 +00:00
. i n c l u d e < b s d . p o r t . p o s t . m k >