Skip to content

Instantly share code, notes, and snippets.

@sorrat
Last active August 5, 2017 06:15
Show Gist options
  • Save sorrat/71cdead20827641ab4d0a8d1809eefa0 to your computer and use it in GitHub Desktop.
Save sorrat/71cdead20827641ab4d0a8d1809eefa0 to your computer and use it in GitHub Desktop.
liblinear
# Contributor: jiuren <[email protected]>
# Maintainer: Benoit Favre <[email protected]>
# Contributor: Kristof Marussy <[email protected]>
pkgname=liblinear
pkgver=211
pkgrel=1
pkgdesc="A Library for Large Linear Classification"
arch=('i686' 'x86_64')
url="http://www.csie.ntu.edu.tw/~cjlin/liblinear/"
license=('BSD')
groups=()
depends=('coreutils')
makedepends=()
optdepends=(
'python: bindings for latest python version'
'python2: bindings for python 2'
'gcc-libs'
)
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=("https://github.com/cjlin1/liblinear/archive/v$pkgver.tar.gz")
noextract=()
md5sums=('9aa46bea862a82d7bdb86017e94feffc')
build() {
cd "$srcdir/$pkgname-$pkgver"
make lib all
}
package() {
cd "$srcdir/$pkgname-$pkgver"
install -D -m755 train $pkgdir/usr/bin/liblinear-train
install -D -m755 predict $pkgdir/usr/bin/liblinear-predict
install -D -m644 liblinear.so.3 $pkgdir/usr/lib/liblinear.so.3
install -D -m644 linear.h $pkgdir/usr/include/linear.h
ln -s liblinear.so.3 $pkgdir/usr/lib/liblinear.so
cd python
sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' liblinear.py
sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' liblinearutil.py
install -D -m644 liblinear.py $pkgdir/usr/lib/python2.7/liblinear.py
install -D -m644 liblinearutil.py $pkgdir/usr/lib/python2.7/liblinearutil.py
sed -i 's_#!/usr/bin/env python2_#!/usr/bin/env python3_' liblinear.py
sed -i 's_#!/usr/bin/env python2_#!/usr/bin/env python3_' liblinearutil.py
install -D -m644 liblinear.py $pkgdir/usr/lib/python3.4/liblinear.py
install -D -m644 liblinearutil.py $pkgdir/usr/lib/python3.4/liblinearutil.py
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment