blob: acd520a54a3b3d9d7cf658ed11530fa5ce255432 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
# Ports collection makefile for: squeezecenter
# Date created: Wed Apr 14, 2004
# Whom: Brooks Davis <brooks@freebsd.org>
#
# $FreeBSD$
#
PORTNAME= squeezecenter
PORTVERSION= 7.0.1
PORTREVISION= 2
CATEGORIES= audio
MASTER_SITES= http://www.slimdevices.com/downloads/SqueezeCenter_v${PORTVERSION}/
DISTNAME= ${PORTNAME}-${PORTVERSION}-noCPAN
EXTRACT_SUFX= .tgz
MAINTAINER= brooks@FreeBSD.org
COMMENT= Slim Devices audio streaming server
# Defaults support playback of relativly unrestricted formats on SB2 or
# SB3 devices and wired SB1 devices.
OPTIONS= CLASSIC "Default to the Classic skin" off \
APE "Support Monkey's Audio Codec input" on \
FAAD "Support AAC input via FAAD" on \
FLAC "Support FLAC output (and input on SliMP3 and SB1)" on \
LAME "Support MP3 output via LAME" off \
MUSEPACK "Support musepack input" on \
SHORTEN "Support Shorten input" off \
VORBIS "Support OGG Vorbis input (SliMP3 and SB1)" on
RESTRICTED= Contains non-redistributable firmware, documentation, and images
WRKSRC= ${WRKDIR}/squeezecenter-${PORTVERSION}-noCPAN
BUILD_DEPENDS+= ${SITE_PERL}/File/Which.pm:${PORTSDIR}/sysutils/p5-File-Which
RUN_DEPENDS+= ${LOCALBASE}/bin/mDNSResponderPosix:${PORTSDIR}/net/mDNSResponder \
${SITE_PERL}/Compress/Zlib.pm:${PORTSDIR}/archivers/p5-Compress-Zlib \
${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql \
${SITE_PERL}/${PERL_ARCH}/Digest/SHA1.pm:${PORTSDIR}/security/p5-Digest-SHA1 \
${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 \
${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 \
${SITE_PERL}/${PERL_ARCH}/XML/Parser.pm:${PORTSDIR}/textproc/p5-XML-Parser \
${SITE_PERL}/${PERL_ARCH}/YAML/Syck.pm:${PORTSDIR}/textproc/p5-YAML-Syck
PKGINSTALL= ${WRKDIR}/pkg-install
USE_PERL5= yes
USE_MYSQL= yes
IGNORE_WITH_MYSQL= 323 40
.include <bsd.port.pre.mk>
# We need a dependency on the server because squeezecenter runs the binary
# directly with a non-standard config.
RUN_DEPENDS+= ${LOCALBASE}/libexec/mysqld:${PORTSDIR}/databases/mysql${MYSQL_VER}-server
.if !defined(WITHOUT_APE)
RUN_DEPENDS+= mac:${PORTSDIR}/audio/mac
.endif
.if !defined(WITHOUT_FAAD)
RUN_DEPENDS+= faad:${PORTSDIR}/audio/faad
.endif
.if !defined(WITHOUT_FLAC)
RUN_DEPENDS+= flac:${PORTSDIR}/audio/flac
.endif
.if !defined(WITHOUT_LAME)
RUN_DEPENDS+= lame:${PORTSDIR}/audio/lame
.endif
.if !defined(WITHOUT_MUSEPACK)
RUN_DEPENDS+= mppdec:${PORTSDIR}/audio/musepack
.endif
.if !defined(WITHOUT_SHORTEN)
RUN_DEPENDS+= shorten:${PORTSDIR}/audio/shorten
.endif
.if !defined(WITHOUT_VORBIS)
RUN_DEPENDS+= oggdec:${PORTSDIR}/audio/vorbis-tools
.endif
.if defined(WITH_CLASSIC)
DEFAULT_SKIN= Classic
.else
DEFAULT_SKIN?= Default
.endif
USE_RC_SUBR= squeezecenter.sh
TMP_SLIMDIR= ${WRKDIR}/_squeezecenter
TMP_DOCSDIR= ${WRKDIR}/doc
DOCFILES= Changelog.html Installation.txt License.txt
CONFFILES= convert.conf types.conf
EXCEPTFILES= ${DOCFILES} \
${CONFFILES} \
CPAN/GD.pm \
CPAN/JSON/XS/Boolean.pm \
CPAN/JSON/XS.pm \
CPAN/Template.pm \
CPAN/XML/Parser.pm \
MySQL/errmsg.txt \
MySQL/errmsg.sys
EXCEPTDIRS= Bin \
CPAN/arch \
CPAN/Compress \
CPAN/Encode \
CPAN/GD \
CPAN/Template \
CPAN/XML/Parser \
CPAN/YAML
CPIOARGS= --quiet -pdum -R
PLIST_SUB= SLIMDIR=${SLIMDIR}
SUB_FILES= softsqueeze.sh pkg-install
SUB_LIST= PERL=${PERL} \
SLIMDIR=${SLIMDIR} \
SLIMDBDIR=${SLIMDBDIR} \
SLIMUSER=${SLIMUSER} \
SLIMGROUP=${SLIMGROUP} \
CONFFILES="${CONFFILES}"
pre-fetch:
.if !defined(SLIMDIR)
@${ECHO_MSG} ""
@${ECHO_MSG} "Define SLIMDIR to override default of 'squeezecenter'."
@${ECHO_MSG} ""
.endif
SLIMDIR?= squeezecenter
SLIMDBDIR?= /var/db/squeezecenter
SLIMUSER?= slimserv
SLIMGROUP?= ${SLIMUSER}
post-patch:
@${REINPLACE_CMD} \
-e 's|/usr/bin/perl|${PERL}|' \
-e 's|%%DISTDIR%%|${_DISTDIR}|' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|' \
-e 's|%%PREFIX%%|${PREFIX}|' \
-e 's|%%SITE_PERL%%|${SITE_PERL}|' \
-e 's|%%SLIMDBDIR%%|${SLIMDBDIR}|' \
-e 's|%%TMP_SLIMDIR%%|${TMP_SLIMDIR}|' \
-e 's|%%DEFAULT_SKIN%%|${DEFAULT_SKIN}|' \
${WRKSRC}/Slim/Utils/OSDetect.pm \
${WRKSRC}/Slim/Utils/Prefs.pm \
${WRKSRC}/Slim/Web/HTTP.pm \
${WRKSRC}/scanner.pl \
${WRKSRC}/slimserver.pl
do-build:
@${MKDIR} -m 0755 ${TMP_SLIMDIR}
@cd ${WRKSRC} && \
${FIND} . -name \*.orig -o -name \*.bak \
${EXCEPTFILES:S|^|-o -path ./|} \
${EXCEPTDIRS:S/$/\*/:S/^/-o -path .\//} -o -print | \
${CPIO} ${CPIOARGS} ${BINOWN}:${BINGRP} ${TMP_SLIMDIR}
.for _CONF in ${CONFFILES}
@cd ${WRKSRC} && ${INSTALL_DATA} ${_CONF} ${TMP_SLIMDIR}/${_CONF}.sample
.endfor
.if !defined(NOPORTDOCS)
@${MKDIR} ${TMP_DOCSDIR}
@cd ${WRKSRC} && ${INSTALL_DATA} ${DOCFILES} ${TMP_DOCSDIR}
.endif
pre-install:
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
do-install:
@${MKDIR} -m 0755 ${PREFIX}/${SLIMDIR}
@${LN} -s ${SLIMDBDIR}/cache ${PREFIX}/${SLIMDIR}/Cache
@cd ${TMP_SLIMDIR} && ${COPYTREE_SHARE} . ${PREFIX}/${SLIMDIR}
@${CHMOD} 755 ${PREFIX}/${SLIMDIR}/slimserver.pl
@${CHMOD} 755 ${PREFIX}/${SLIMDIR}/scanner.pl
@${LN} -s ${LOCALBASE}/share/mysql/errmsg.txt \
${PREFIX}/${SLIMDIR}/MySQL/
@${LN} -s ${LOCALBASE}/share/mysql/english/errmsg.sys \
${PREFIX}/${SLIMDIR}/MySQL/
@${INSTALL_SCRIPT} ${WRKDIR}/softsqueeze.sh ${PREFIX}/bin/softsqueeze
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@cd ${TMP_DOCSDIR} && ${COPYTREE_SHARE} . ${DOCSDIR}
.endif
post-install:
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${ECHO}
@${CAT} ${PKGMESSAGE}
build-plist:
@${CAT} /dev/null > ${PLIST}
echo bin/softsqueeze >> ${PLIST}
.for _CONF in ${CONFFILES}
@${ECHO} '@unexec if cmp -s %D/%%SLIMDIR%%/${_CONF} %D/%%SLIMDIR%%/${_CONF}.sample; then rm -f %D/%%SLIMDIR%%/${_CONF}; fi' >> ${PLIST}
.endfor
@${FIND} ${TMP_DOCSDIR} -type f | \
${SED} -e 's|${TMP_DOCSDIR}|%%PORTDOCS%%%%DOCSDIR%%|' | \
${SORT} >> ${PLIST}
@${FIND} ${TMP_SLIMDIR}/* -type f | \
${SED} -e 's|${TMP_SLIMDIR}|%%SLIMDIR%%|' | \
${SORT} >> ${PLIST}
@${ECHO} "${SLIMDIR}/Cache" >> ${PLIST}
@${ECHO} "${SLIMDIR}/MySQL/errmsg.txt" >> ${PLIST}
@${ECHO} "${SLIMDIR}/MySQL/errmsg.sys" >> ${PLIST}
${FIND} ${TMP_SLIMDIR} -type d | \
egrep -v "${TMP_SLIMDIR}(|/Plugins)$$" | \
${SED} -e 's|${TMP_SLIMDIR}|@dirrm %%SLIMDIR%%|' | \
${SORT} -r >> ${PLIST}
echo "@dirrmtry %%SLIMDIR%%/Plugins" >> ${PLIST}
echo "@dirrmtry %%SLIMDIR%%" >> ${PLIST}
@${FIND} ${TMP_DOCSDIR} -type d | \
${SED} -e 's|${TMP_DOCSDIR}|%%PORTDOCS%%@dirrm %%DOCSDIR%%|' | \
${SORT} -r >> ${PLIST}
@${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}
.include <bsd.port.post.mk>
|