You are not logged in.
Hi, so I made a PKGBUILD for something called HTS, which is a patch for HTK. The thing is, that to download the HTK source, one needs an account there (easily enough set up), but as far as I can tell, the source array does not support account protected sources (probably because nearly no one uses this), so I needed to use wget with --user and --password in the build() function.
My question is whether there is a better/ more elegant solution for that, because the code looks kinda ugly:
# Maintainer: Moritz Maxeiner <moritz@ucworks.org>
pkgname=hts
pkgver=2.2
_htkver=3.4.1
pkgrel=1
pkgdesc="Modified version (patch) of the Hidden Markov Model Toolkit (htk)."
arch=('i686')
url="http://hts.sp.nitech.ac.jp/"
license=('custom')
depends=('libx11')
makedepends=('wget' 'patch')
conflicts=(htk)
source=(http://hts.sp.nitech.ac.jp/archives/$pkgver/HTS-${pkgver}_for_HTK-$_htkver.tar.bz2)
md5sums=('76b7674a01f1edfeb5b4bbca4f5e39a2')
build() {
cd $srcdir
# HTK account necessary to download HTK source code
echo "You need an HTK account to download the source base HTS uses."
echo "You can create such an account here: http://htk.eng.cam.ac.uk/register.shtml"
echo "Please proceed only if you have one, the build will fail otherwise!"
echo
echo -n "Please enter your HTK username: "
read username
echo -n "Please enter your HTK password: "
read password
# Get the htk source code
wget --user=$username --password=$password http://htk.eng.cam.ac.uk/ftp/software/HTK-$_htkver.tar.gz
if [ $(md5sum HTK-$_htkver.tar.gz) != "b3fc12006b0af12f59cd573c07aa4c1d" ]; then
echo "HTK md5sum wrong"
return 1
fi
wget --user=$username --password=$password http://htk.eng.cam.ac.uk/ftp/software/hdecode/HDecode-$_htkver.tar.gz
if [ $(md5sum HDecode-$_htkver.tar.gz) != "4e332a7fea6db58751cec878b80c3575" ]; then
echo "HDecode md5sum wrong"
return 1
fi
bsdtar -xf HTK-$_htkver.tar.gz
bsdtar -xf HDecode-$_htkver.tar.gz
cd htk
echo "Patching HTK source base to HTS..."
patch -p1 -d . < "./../HTS-${pkgver}_for_HTK-$_htkver.patch"
echo "Beginning build..."
./configure --prefix=/usr
make
}
package() {
cd "$srcdir/htk"
make prefix="$pkgdir/usr" install
# The HTK license applying to the package
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE
# The HTS license applying to the patch
install -D -m644 $srcdir/COPYING ${pkgdir}/usr/share/licenses/$pkgname/COPYING
}Offline
You can tell users to download the code themselves, place it in the same directory as the PKGBUILD, patches etc.
https://aur.archlinux.org/packages.php?ID=50762
Last edited by karol (2011-10-16 19:37:42)
Offline
Thanks, that would indeed clean up code, although I would like something where the user does not have to download the code themselves more.
Last edited by Calrama (2011-10-16 19:45:39)
Offline
Thanks, that would indeed clean up code, although I would like something where the user does not have to download the code themselves more.
You could also host the source yourself (depending on legality issues of course).
I think it should be safe to assume that Arch users are perfectly capable of downloading source themselves
.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline