2010-06-12 00:33:44 +02:00
|
|
|
# Ports collection makefile for: freeswitch-sounds
|
|
|
|
# Date created: May 11, 2010
|
|
|
|
# Whom: Eric F Crist <ecrist@secure-computing.net>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2012-05-20 18:01:35 +02:00
|
|
|
PORTNAME= freeswitch
|
|
|
|
DISTVERSION= 1.0.18
|
|
|
|
PORTREVISION= 1
|
2010-08-17 18:13:59 +02:00
|
|
|
CATEGORIES= audio
|
2010-06-12 00:33:44 +02:00
|
|
|
MASTER_SITES= http://files.freeswitch.org/
|
2012-05-20 18:01:35 +02:00
|
|
|
PKGNAMESUFFIX= -sounds
|
2010-08-17 18:13:59 +02:00
|
|
|
DIST_SUBDIR= freeswitch-sounds
|
2010-06-12 00:33:44 +02:00
|
|
|
|
2012-03-15 19:19:06 +01:00
|
|
|
MAINTAINER= r.neese@gmail.com
|
2010-08-17 18:13:59 +02:00
|
|
|
COMMENT= FreeSwitch Sounds (All Bitrates)
|
2010-06-12 00:33:44 +02:00
|
|
|
|
2012-05-20 18:01:35 +02:00
|
|
|
RUN_DEPENDS= freeswitch:${PORTSDIR}/net/freeswitch-core
|
|
|
|
|
2010-08-17 18:13:59 +02:00
|
|
|
PLIST= ${WRKDIR}/plist
|
|
|
|
NO_WRKSUBDIR= yes
|
2012-05-20 18:01:35 +02:00
|
|
|
SHAREOWN= ${PORTNAME}
|
|
|
|
SHAREGRP= ${SHAREOWN}
|
2010-06-12 00:33:44 +02:00
|
|
|
|
2012-05-20 18:01:35 +02:00
|
|
|
OPTIONS= DOWNLOAD "Don't resample, download all." off \
|
|
|
|
8K "Compile sounds for 8K" on \
|
|
|
|
16K "Compile sounds for 16K" on \
|
|
|
|
32K "Compile sounds for 32K" on \
|
|
|
|
48K "Compile sounds for 48K" on \
|
|
|
|
ENGLISH "Compile US English Language Sounds" on \
|
|
|
|
FRENCH "Compile French Canadian Language Sounds" off \
|
|
|
|
RUSSIAN "Compile Russian Language Sounds" off
|
|
|
|
|
2010-06-12 00:33:44 +02:00
|
|
|
.include <bsd.port.options.mk>
|
2011-10-04 21:01:54 +02:00
|
|
|
|
|
|
|
.if ! defined(WITH_DOWNLOAD)
|
|
|
|
BUILD_DEPENDS+= sox:${PORTSDIR}/audio/sox
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_8K)
|
|
|
|
BITRATES+= 8000
|
|
|
|
.endif
|
|
|
|
.if defined(WITH_16K)
|
|
|
|
BITRATES+= 16000
|
|
|
|
.endif
|
|
|
|
.if defined(WITH_32K)
|
|
|
|
BITRATES+= 32000
|
|
|
|
.endif
|
|
|
|
.if defined(WITH_48K)
|
|
|
|
BITRATES+= 48000
|
|
|
|
.endif
|
|
|
|
|
2010-06-12 00:33:44 +02:00
|
|
|
.if defined(WITH_ENGLISH)
|
2011-10-04 21:01:54 +02:00
|
|
|
.if defined(WITH_DOWNLOAD)
|
|
|
|
.for rate in ${BITRATES}
|
2012-05-20 18:01:35 +02:00
|
|
|
DISTFILES+= ${PORTNAME}${PKGNAMESUFFIX}-en-us-callie-${rate}-${DISTVERSION}${EXTRACT_SUFX}
|
2011-10-04 21:01:54 +02:00
|
|
|
.endfor
|
|
|
|
.else
|
2012-05-20 18:01:35 +02:00
|
|
|
DISTFILES+= ${PORTNAME}${PKGNAMESUFFIX}-en-us-callie-48000-${DISTVERSION}${EXTRACT_SUFX}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.if defined(WITH_FRENCH)
|
|
|
|
.if defined(WITH_DOWNLOAD)
|
|
|
|
.for rate in ${BITRATES}
|
|
|
|
DISTFILES+= ${PORTNAME}${PKGNAMESUFFIX}-fr-ca-june-${rate}-1.0.14${EXTRACT_SUFX}
|
|
|
|
.endfor
|
|
|
|
.else
|
|
|
|
DISTFILES+= ${PORTNAME}${PKGNAMESUFFIX}-fr-ca-june-48000-1.0.14${EXTRACT_SUFX}
|
2010-06-12 00:33:44 +02:00
|
|
|
.endif
|
2011-10-04 21:01:54 +02:00
|
|
|
.endif
|
2010-06-12 00:33:44 +02:00
|
|
|
.if defined(WITH_RUSSIAN)
|
2011-10-04 21:01:54 +02:00
|
|
|
.if defined(WITH_DOWNLOAD)
|
|
|
|
.for rate in ${BITRATES}
|
2012-05-20 18:01:35 +02:00
|
|
|
DISTFILES+= ${PORTNAME}${PKGNAMESUFFIX}-ru-RU-elena-${rate}-1.0.12${EXTRACT_SUFX}
|
2011-10-04 21:01:54 +02:00
|
|
|
.endfor
|
|
|
|
.else
|
2012-05-20 18:01:35 +02:00
|
|
|
DISTFILES+= ${PORTNAME}${PKGNAMESUFFIX}-ru-RU-elena-48000-1.0.12${EXTRACT_SUFX}
|
2010-06-12 00:33:44 +02:00
|
|
|
.endif
|
2011-10-04 21:01:54 +02:00
|
|
|
.endif
|
2012-05-20 18:01:35 +02:00
|
|
|
|
|
|
|
.if ! defined(WITH_ENGLISH) && ! defined(WITH_FRENCH) && ! defined(WITH_RUSSIAN)
|
|
|
|
BROKEN= you must build with atleast English or French or Russian,
|
2010-06-12 00:33:44 +02:00
|
|
|
.endif
|
2012-05-20 18:01:35 +02:00
|
|
|
|
2010-06-12 00:33:44 +02:00
|
|
|
.if ! defined(WITH_8K) && ! defined(WITH_16K) && ! defined(WITH_32K) && \
|
|
|
|
! defined(WITH_48K)
|
2010-08-17 18:13:59 +02:00
|
|
|
BROKEN= you must build with at least one of 8K, 16K, 32K, or 48K sounds
|
2010-06-12 00:33:44 +02:00
|
|
|
.endif
|
|
|
|
|
2011-10-04 21:01:54 +02:00
|
|
|
.if defined(FREESWITCH_VSCALE)
|
|
|
|
SCALE=${FREESWITCH_VSCALE}
|
|
|
|
.else
|
|
|
|
SCALE=0.2
|
2010-06-12 00:33:44 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
do-build:
|
2011-10-04 21:01:54 +02:00
|
|
|
@${ECHO_MSG} "===> Building for bitrates: ${BITRATES}"
|
|
|
|
@${ECHO_MSG} "===> Download >>>${WITH_DOWNLOAD}<<<"
|
|
|
|
@${ECHO_MSG} "===> Scaling audio to ${SCALE}"
|
2010-06-12 00:33:44 +02:00
|
|
|
if [ "${WITH_ENGLISH}" != "" -a ! -e "${WRKDIR}/ENGLISH.done" ]; then \
|
2011-10-04 21:01:54 +02:00
|
|
|
${ECHO_MSG} "====> English selected."; \
|
2010-06-12 00:33:44 +02:00
|
|
|
for rate in ${BITRATES}; do \
|
|
|
|
${ECHO_MSG} "WORKING on $${rate}!"; \
|
2011-10-04 21:01:54 +02:00
|
|
|
for dir in `ls ${WRKSRC}/en/us/callie/`; do \
|
|
|
|
${MKDIR} ${WRKDIR}/tmp/en/us/callie/$${dir}/$${rate}/; \
|
|
|
|
for filename in `ls ${WRKSRC}/en/us/callie/$${dir}/48000`; do \
|
2012-05-20 18:01:35 +02:00
|
|
|
echo "${DATADIR_REL}/sounds/en/us/callie/$${dir}/$${rate}/$${filename}" >> ${PLIST}; \
|
2011-10-04 21:01:54 +02:00
|
|
|
if [ ! -e "${WRKDIR}/tmp/en/us/callie/$${dir}/$${rate}/$${filename}" ]; then \
|
|
|
|
if [ "${WITH_DOWNLOAD}" = "true" ]; then \
|
|
|
|
${ECHO} -n "."; \
|
|
|
|
${MV} ${WRKSRC}/en/us/callie/$${dir}/$${rate}/$${filename} ${WRKDIR}/tmp/en/us/callie/$${dir}/$${rate}/$${filename} ; \
|
|
|
|
else \
|
|
|
|
${ECHO} -n "."; \
|
|
|
|
${LOCALBASE}/bin/sox -v ${SCALE} "${WRKSRC}/en/us/callie/$${dir}/48000/$${filename}" -r $${rate} -c 1 "${WRKDIR}/tmp/en/us/callie/$${dir}/$${rate}/$${filename}"; \
|
2010-06-12 00:33:44 +02:00
|
|
|
fi \
|
2011-10-04 21:01:54 +02:00
|
|
|
fi \
|
2010-06-12 00:33:44 +02:00
|
|
|
done; \
|
2011-10-04 21:01:54 +02:00
|
|
|
${ECHO} ""; \
|
2012-05-20 18:01:35 +02:00
|
|
|
echo "@rmdir share/${PORTNAME}/sounds/en/us/callie/$${dir}/$${rate}/" >> ${PLIST}; \
|
2011-10-04 21:01:54 +02:00
|
|
|
done; \
|
2010-06-12 00:33:44 +02:00
|
|
|
done; \
|
|
|
|
${TOUCH} ${WRKDIR}/ENGLISH.done; \
|
|
|
|
fi
|
2012-05-20 18:01:35 +02:00
|
|
|
|
|
|
|
if [ "${WITH_FRENCH}" != "" -a ! -e "${WRKDIR}/FRENCH.done" ]; then \
|
|
|
|
${ECHO_MSG} "====> French selected."; \
|
|
|
|
for rate in ${BITRATES}; do \
|
|
|
|
${ECHO_MSG} "WORKING on $${rate}!"; \
|
|
|
|
for dir in `ls ${WRKSRC}/fr/ca/june/`; do \
|
|
|
|
${MKDIR} ${WRKDIR}/tmp/fr/ca/june/$${dir}/$${rate}/; \
|
|
|
|
for filename in `ls ${WRKSRC}/fr/ca/june/$${dir}/48000`; do \
|
|
|
|
echo "${DATADIR_REL}/sounds/fr/ca/june/$${dir}/$${rate}/$${filename}" >> ${PLIST}; \
|
|
|
|
if [ ! -e "${WRKDIR}/tmp/fr/ca/june/$${dir}/$${rate}/$${filename}" ]; then \
|
|
|
|
if [ "${WITH_DOWNLOAD}" = "true" ]; then \
|
|
|
|
${ECHO} -n "."; \
|
|
|
|
${MV} ${WRKSRC}/fr/ca/june/$${dir}/$${rate}/$${filename} ${WRKDIR}/tmp/fr/ca/june/$${dir}/$${rate}/$${filename} ; \
|
|
|
|
else \
|
|
|
|
${ECHO} -n "."; \
|
|
|
|
${LOCALBASE}/bin/sox -v ${SCALE} "${WRKSRC}/fr/ca/june/$${dir}/48000/$${filename}" -r $${rate} -c 1 "${WRKDIR}/tmp/fr/ca/$${dir}/$${rate}/$${filename}"; \
|
|
|
|
fi \
|
|
|
|
fi \
|
|
|
|
done; \
|
|
|
|
${ECHO} ""; \
|
|
|
|
echo "@rmdir share/${PORTNAME}/sounds/fr/ca/june/$${dir}/$${rate}/" >> ${PLIST}; \
|
|
|
|
done; \
|
|
|
|
done; \
|
|
|
|
${TOUCH} ${WRKDIR}/FRENCH.done; \
|
|
|
|
fi
|
|
|
|
|
2010-06-12 00:33:44 +02:00
|
|
|
if [ "${WITH_RUSSIAN}" != "" -a ! -e "${WRKDIR}/RUSSIAN.done" ]; then \
|
2011-10-04 21:01:54 +02:00
|
|
|
${ECHO_MSG} "====> Russian selected."; \
|
2010-06-12 00:33:44 +02:00
|
|
|
for rate in ${BITRATES}; do \
|
|
|
|
${ECHO_MSG} "WORKING on $${rate}!"; \
|
2011-10-04 21:01:54 +02:00
|
|
|
for dir in `ls ${WRKSRC}/ru/RU/elena/`; do \
|
|
|
|
${MKDIR} ${WRKDIR}/tmp/ru/RU/elena/$${dir}/$${rate}/; \
|
|
|
|
for filename in `ls ${WRKSRC}/ru/RU/elena/$${dir}/48000`; do \
|
2012-05-20 18:01:35 +02:00
|
|
|
echo "share/${DATADIR_REL}/sounds/ru/RU/elena/$${dir}/$${rate}/$${filename}" >> ${PLIST}; \
|
2011-10-04 21:01:54 +02:00
|
|
|
if [ ! -e "${WRKDIR}/tmp/ru/RU/elena/$${dir}/$${rate}/$${filename}" ]; then \
|
|
|
|
if [ "${WITH_DOWNLOAD}" = "true" ]; then \
|
|
|
|
${ECHO} -n "."; \
|
|
|
|
${MV} ${WRKSRC}/ru/RU/elena/$${dir}/$${rate}/$${filename} ${WRKDIR}/tmp/ru/RU/elena/$${dir}/$${rate}/$${filename}; \
|
|
|
|
else \
|
|
|
|
${ECHO} -n "."; \
|
|
|
|
${LOCALBASE}/bin/sox -v ${SCALE} "${WRKSRC}/ru/RU/elena/$${dir}/48000/$${filename}" -r $${rate} -c 1 "${WRKDIR}/tmp/ru/RU/elena/$${dir}/$${rate}/$${filename}"; \
|
2010-06-12 00:33:44 +02:00
|
|
|
fi \
|
2011-10-04 21:01:54 +02:00
|
|
|
fi \
|
2010-06-12 00:33:44 +02:00
|
|
|
done; \
|
2011-10-04 21:01:54 +02:00
|
|
|
${ECHO} ""; \
|
2012-05-20 18:01:35 +02:00
|
|
|
echo "@dirrm share/${PORTNAME}/sounds/ru/RU/elena/$${dir}/$${rate}/" >> ${PLIST}; \
|
2011-10-04 21:01:54 +02:00
|
|
|
done; \
|
2010-06-12 00:33:44 +02:00
|
|
|
done; \
|
|
|
|
${TOUCH} ${WRKDIR}/RUSSIAN.done; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
pre-install:
|
2012-05-20 18:01:35 +02:00
|
|
|
@${RM} ${PLIST}
|
2010-06-12 00:33:44 +02:00
|
|
|
@cd ${WRKDIR}/tmp && ${FIND} * ! -type d | ${SORT} >> ${PLIST}; \
|
2012-05-20 18:01:35 +02:00
|
|
|
${ECHO} .${PORTNAME}${PKGNAMESUFFIX} >> ${PLIST}; \
|
|
|
|
${REINPLACE_CMD} -e "s:^:${DATADIR_REL}/sounds/:" ${PLIST}; \
|
|
|
|
${FIND} * -type d ! -empty | ${SORT} -r | ${SED} -e "s:^:@dirrm ${DATADIR_REL}/sounds/:" | ${GREP} / >> ${PLIST}
|
2010-06-12 00:33:44 +02:00
|
|
|
|
|
|
|
do-install:
|
|
|
|
@${ECHO_MSG} "Installing files..."
|
2012-05-20 18:01:35 +02:00
|
|
|
${TOUCH} ${DATADIR}/sounds/.freeswitch-sounds
|
|
|
|
(cd ${WRKDIR}/tmp/ && ${COPYTREE_SHARE} \* ${DATADIR}/sounds/)
|
2010-06-12 00:33:44 +02:00
|
|
|
|
|
|
|
.include <bsd.port.mk>
|