description="A library to talk to FTDI chips, optional python bindings."
url="http://www.intra2net.com/en/developer/libftdi/download.php"

packager="spiky <spiky@nutyx.org>"
contributors="Greg,Tnut"

makedepends=(libusb confuse boost cmake swig)

name=libftdi
version=1.5
release=2

source=(http://www.intra2net.com/en/developer/libftdi/download/${name}1-$version.tar.bz2)

build() {
cd ${name}1-$version
  sed -i 's|LIB_SUFFIX 64|LIB_SUFFIX ""|' CMakeLists.txt
  sed -i "s|MODE=\"0664\", GROUP=\"plugdev\"|TAG+=\"uaccess\"|g" packages/99-libftdi.rules

  mkdir -p build
  cd build
  cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
           -DFTDI_EEPROM=ON -DDOCUMENTATION=OFF \
           -DSTATICLIBS=0 -Wno-dev
  make
  make DESTDIR=$PKG install
  install -Dm644 ../packages/99-libftdi.rules $PKG/etc/udev/rules.d/69-libftdi.rules
  mkdir -p $PKG/usr/share/libftdi

  cp -r ../examples $PKG/usr/share/libftdi/examples

}
