Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kou1okada/4037887 to your computer and use it in GitHub Desktop.
Save kou1okada/4037887 to your computer and use it in GitHub Desktop.
build hts-voice-mmdagent-example-mei package for cygwin
#!/usr/bin/env bash
#-----------------------------------------------------------------------------
PKGNAME=hts-voice-mmdagent-example-mei
VERSION=1.3
SRCURL=http://downloads.sourceforge.net/mmdagent/MMDAgent_Example-1.3.zip
SRCARC=MMDAgent_Example-1.3.zip
SRCDIR=MMDAgent_Example-1.3
CONFIGUREOPT=""
REQUIRES=( )
HINT="\
@ $PKGNAME\n\
sdesc: \"HTS voice date of MMDAgent Example Mei\"\n\
ldesc: \"HTS voice data of MMDAgent Example Mei.\"\n\
category: Audio\n\
requires: cygwin\n\
version: $VERSION\n\
"
prebuild () {
mkdir -p $BUILDDIR/$SRCDIR
cat <<EOD > $BUILDDIR/$SRCDIR/configure
#!/bin/sh
EOD
chmod 755 $BUILDDIR/$SRCDIR/configure
cat <<EOD > $BUILDDIR/$SRCDIR/Makefile
all:
install:
mkdir -p "\$(DESTDIR)/usr/share/hts-voice/MMDAgent_Example"
cp -av Voice "\$(DESTDIR)/usr/share/hts-voice/MMDAgent_Example/"
EOD
}
#-----------------------------------------------------------------------------
BUILDDIR=$PKGNAME
PKGDIR=$PKGNAME
PKGFILE=$PKGNAME-$VERSION.tar.bz2
for i in "${REQUIRES[@]}"; do
if [ ! -e "$i" ]; then
echo "Error: $i is not found."
echo
exit
fi
done
mkdir -p $BUILDDIR $BUILDDIR/$PKGDIR
echo -e "$HINT" > $BUILDDIR/$PKGDIR/setup.hint
cat <<EOD > $BUILDDIR/Makefile
PKGNAME=$PKGNAME
SRCURL="$SRCURL"
SRCARC=$SRCARC
SRCDIR=$SRCDIR
PKGDIR=$PKGDIR
PKGFILE=\$(PKGDIR)/$PKGFILE
all: download \$(PKGFILE)
@echo =========================================
@echo "Following cygwin package files are built."
@ls -l \$(PKGFILE)
#patch:
# patch -d \$(SRCDIR) -p 1 < \$(PKGNAME).patch
# touch \$@
download: \$(SRCARC)
\$(SRCARC):
wget -c --content-disposition "\$(SRCURL)"
extract: \$(SRCDIR)/extract
\$(SRCDIR)/extract: \$(SRCARC)
ifeq (\$(patsubst %.tar.gz,.tar.gz,\$(SRCARC)),.tar.gz)
tar zxvf \$(SRCARC)
endif
ifeq (\$(suffix \$(SRCARC)),.tgz)
tar zxvf \$(SRCARC)
endif
ifeq (\$(suffix \$(SRCARC)),.zip)
unzip \$(SRCARC)
endif
touch \$@
\$(SRCDIR)/Makefile: extract
cd \$(SRCDIR) && ./configure --prefix=/usr $CONFIGUREOPT
build: \$(SRCDIR)/Makefile
cd \$(SRCDIR) && make DESTDIR="\`pwd\`/tmp" install
touch \$@
\$(PKGFILE): build
mkdir -p \$(PKGDIR)
cd \$(SRCDIR)/tmp && tar jcvf ../../\$(PKGFILE) *
buildclean:
-rm build patch extract
clean: buildclean
cd \$(SRCDIR) && make clean
distclean: buildclean
cd \$(SRCDIR) && make distclean
distcleanall: buildclean
-rm -r \$(SRCDIR) \$(PKGDIR)
EOD
prebuild
cd $BUILDDIR && make "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment