2004-04-16 15:13:30 +02:00
# Ports collection makefile for: slimserver
# Date created: Wed Apr 14, 2004
# Whom: Brooks Davis <brooks@freebsd.org>
#
# $FreeBSD$
#
PORTNAME = slimserver
2004-12-14 18:50:27 +01:00
PORTVERSION ?= 5.4.0
2004-12-31 01:17:05 +01:00
PORTREVISION = 1
2004-04-16 15:13:30 +02:00
CATEGORIES = audio
2004-09-23 07:21:42 +02:00
MASTER_SITES = http://www.slimdevices.com/downloads/${ NIGHTLY } SlimServer_v${ DISTVERSION } /
DISTNAME = SlimServer_v${ DISTVERSION }
2004-04-16 15:13:30 +02:00
MAINTAINER = brooks@FreeBSD.org
COMMENT = Slim Devices audio streaming server
2004-09-23 07:21:42 +02:00
DISTVERSION ?= ${ PORTVERSION }
2004-12-31 01:17:05 +01:00
RUN_DEPENDS += ${ LOCALBASE } /bin/mDNSResponderPosix:${ PORTSDIR } /net/mDNSResponder
2004-04-16 15:13:30 +02:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2004-12-31 01:17:05 +01:00
SLIM_CPAN_DEPS != cut -f 2 -d, ${ FILESDIR } /pm2port | grep -v ^_builtin
RUN_DEPENDS += ${ SLIM_CPAN_DEPS : S |^| ${ SITE_PERL } /| : S | : | : ${ PORTSDIR } /| }
. i f $ { P E R L _ L E V E L } < 5 0 0 8 0 0
IGNORE = "Perl 5.8 or newer required. Install lang/perl5.8 and try again."
. e n d i f
2004-04-16 15:13:30 +02:00
. i f $ { O S V E R S I O N } < 5 0 2 1 1 0
RUN_DEPENDS += ${ LOCALBASE } /bin/pgrep:${ PORTSDIR } /sysutils/pkill
2004-05-04 00:59:03 +02:00
PGREPBASE = ${ LOCALBASE }
. e l s e
PGREPBASE = /usr
2004-04-16 15:13:30 +02:00
. e n d i f
USE_RC_SUBR = yes
2004-09-23 07:21:42 +02:00
TMP_SLIMDIR = ${ WRKDIR } /slimserver
TMP_DOCSDIR = ${ WRKDIR } /doc
2004-04-16 15:13:30 +02:00
DOCFILES = Changelog.html Installation.txt
2004-12-14 18:50:27 +01:00
EXCEPTFILES = ${ DOCFILES } \
2004-12-31 01:17:05 +01:00
CPAN/File/.exists \
CPAN/MP3/.exists
2004-04-16 15:13:30 +02:00
EXCEPTDIRS = Bin \
2004-12-31 01:17:05 +01:00
CPAN/arch
2004-04-16 15:13:30 +02:00
CPIOARGS = --quiet -pdum -R
2004-09-23 07:21:42 +02:00
PLIST = ${ WRKDIR } /pkg-plist
2004-04-16 15:13:30 +02:00
PLIST_SUB = SLIMDIR = ${ SLIMDIR }
2004-12-31 01:17:05 +01:00
SED_SCRIPT += -e 's,%%LOCALBASE%%,${LOCALBASE},g' \
-e 's,%%PREFIX%%,${PREFIX},g' \
2004-05-04 00:59:03 +02:00
-e 's,%%PGREPBASE%%,${PGREPBASE},g' \
2004-04-16 15:13:30 +02:00
-e 's,%%RC_SUBR%%,${RC_SUBR},g' \
-e 's,%%SLIMDIR%%,${SLIMDIR},g'
pre-fetch :
. i f ! d e f i n e d ( S L I M D I R )
@${ ECHO_MSG } ""
2004-05-04 00:59:03 +02:00
@${ ECHO_MSG } "Define SLIMDIR to override default of 'slimserver'."
2004-04-16 15:13:30 +02:00
@${ ECHO_MSG } ""
. e n d i f
post-patch :
@${ SED } ${ SED_SCRIPT } <${ FILESDIR } /slimserver.sh >${ WRKDIR } /slimserver.sh
2004-12-31 01:17:05 +01:00
@${ SED } ${ SED_SCRIPT } <${ FILESDIR } /softsqueeze.sh >${ WRKDIR } /softsqueeze.sh
2004-04-16 15:13:30 +02:00
SLIMDIR ?= slimserver
2004-09-23 07:21:42 +02:00
do-build :
@${ MKDIR } -m 0755 ${ TMP_SLIMDIR }
2004-04-16 15:13:30 +02:00
@cd ${ WRKSRC } && \
2004-12-31 01:17:05 +01:00
${ FIND } . -name \* .orig ${ EXCEPTFILES : S |^|-o -path ./| } \
2004-04-16 15:13:30 +02:00
${ EXCEPTDIRS : S / $/ \* / : S /^/-o -path . \/ / } -o -print | \
2004-09-23 07:21:42 +02:00
${ CPIO } ${ CPIOARGS } ${ BINOWN } :${ BINGRP } ${ TMP_SLIMDIR }
2004-12-31 01:17:05 +01:00
@cd ${ TMP_SLIMDIR } /CPAN && \
for pm in ` egrep -v ,$$ ${ FILESDIR } /pm2port | cut -f 1 -d,` ; do \
grep " $$ {pm}: " ${ FILESDIR } /CPANfiles | cut -f2 -d: | xargs rm; \
done
@find ${ TMP_SLIMDIR } /CPAN -depth -type d -empty -delete
. i f d e f i n e d ( P O R T D E V )
@echo "Checking for unexpected files in CPAN"
@cd ${ TMP_SLIMDIR } /CPAN && \
for file in ` find . -type f | sed -e 's|^\./||' ` ; do \
egrep -q " : $$ {file}\$ $" ${ FILESDIR } /CPANfiles || \
echo $$ { file} ; \
done
@echo
. e n d i f
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
@${ ECHO } " etc/rc.d/slimserver ${ PKGNAMESUFFIX } .sh " > ${ PLIST }
2004-12-31 01:17:05 +01:00
@${ ECHO } "bin/softsqueeze" >> ${ PLIST }
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 )
@${ 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
@${ ECHO } '@unexec rmdir /var/db/slimserver 2>/dev/null || (echo "Configuration information saved. If you will *NOT* use this package anymore," && echo "please remove /var/db/slimserver and its contents manually.")' >> ${ PLIST }
2004-12-31 01:17:05 +01:00
pre-install :
@${ SH } ${ PKGINSTALL } ${ PKGNAME } PRE-INSTALL
2004-09-23 07:21:42 +02:00
do-install :
@${ MKDIR } -m 0755 ${ PREFIX } /${ SLIMDIR }
@${ LN } -s /var/db/slimserver/cache ${ PREFIX } /${ SLIMDIR } /Cache
@cd ${ TMP_SLIMDIR } && \
${ FIND } . | \
2004-04-16 15:13:30 +02:00
${ CPIO } ${ CPIOARGS } ${ BINOWN } :${ BINGRP } ${ PREFIX } /${ SLIMDIR }
2004-09-23 07:21:42 +02:00
@${ INSTALL_SCRIPT } ${ WRKDIR } /slimserver.sh \
${ PREFIX } /etc/rc.d/slimserver${ PKGNAMESUFFIX } .sh
2004-12-31 01:17:05 +01:00
@${ INSTALL_SCRIPT } ${ WRKDIR } /softsqueeze.sh ${ PREFIX } /bin/softsqueeze
2004-04-16 15:13:30 +02: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 07:21:42 +02:00
@cd ${ TMP_DOCSDIR } && \
${ FIND } . | \
${ CPIO } ${ CPIOARGS } ${ BINOWN } :${ BINGRP } ${ DOCSDIR }
2004-04-16 15:13:30 +02:00
. e n d i f
post-install :
2004-09-23 07:21:42 +02:00
@${ SH } ${ PKGINSTALL } ${ PKGNAME } POST-INSTALL
2004-05-04 00:59:03 +02:00
@${ ECHO }
@${ CAT } ${ PKGMESSAGE }
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 >