diff --git a/packages/multimedia/libaacs/build b/packages/multimedia/libaacs/build
deleted file mode 100755
index 9f9f1ec4e5..0000000000
--- a/packages/multimedia/libaacs/build
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
-#
-# This Program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This Program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC.tv; see the file COPYING. If not, write to
-# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
-# http://www.gnu.org/copyleft/gpl.html
-################################################################################
-
-. config/options $1
-
-cd $PKG_BUILD
-./configure --host=$TARGET_NAME \
- --build=$HOST_NAME \
- --prefix=/usr \
- --disable-static \
- --enable-shared \
- --disable-werror \
- --disable-extra-warnings \
- --disable-optimizations \
- --disable-examples \
- --disable-debug \
- --with-gnu-ld
-
-make
-
-$MAKEINSTALL
diff --git a/packages/multimedia/libaacs/install b/packages/multimedia/libaacs/install
deleted file mode 100755
index 33b265f98f..0000000000
--- a/packages/multimedia/libaacs/install
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
-#
-# This Program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This Program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC.tv; see the file COPYING. If not, write to
-# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
-# http://www.gnu.org/copyleft/gpl.html
-################################################################################
-
-. config/options $1
-
-mkdir -p $INSTALL/usr/lib
- cp -P $PKG_BUILD/src/.libs/*.so* $INSTALL/usr/lib
-
-mkdir -p $INSTALL/usr/config/aacs
- cp -P $PKG_BUILD/KEYDB.cfg $INSTALL/usr/config/aacs
diff --git a/packages/multimedia/libaacs/meta b/packages/multimedia/libaacs/package.mk
similarity index 75%
rename from packages/multimedia/libaacs/meta
rename to packages/multimedia/libaacs/package.mk
index 934e1e5177..0bfc08ef18 100644
--- a/packages/multimedia/libaacs/meta
+++ b/packages/multimedia/libaacs/package.mk
@@ -19,18 +19,36 @@
################################################################################
PKG_NAME="libaacs"
-PKG_VERSION="0.5.0"
+PKG_VERSION="0.6.0"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.videolan.org/developers/libaacs.html"
PKG_URL="ftp://ftp.videolan.org/pub/videolan/libaacs/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS="libgcrypt"
-PKG_BUILD_DEPENDS="toolchain libgcrypt"
+PKG_BUILD_DEPENDS_TARGET="toolchain libgcrypt"
PKG_PRIORITY="optional"
PKG_SECTION="multimedia"
PKG_SHORTDESC="libaacs: a research project to implement the Advanced Access Content System specification."
PKG_LONGDESC="libaacs is a research project to implement the Advanced Access Content System specification. This research project provides, through an open-source library, a way to understand how the AACS works. This research project is mainly developed by an international team of developers from Doom9."
-PKG_IS_ADDON="no"
+PKG_IS_ADDON="no"
PKG_AUTORECONF="yes"
+
+PKG_CONFIGURE_OPTS_TARGET="--disable-werror \
+ --disable-extra-warnings \
+ --disable-optimizations \
+ --disable-examples \
+ --disable-debug \
+ --with-gnu-ld"
+
+pre_configure_target() {
+# libaacs fails to build in subdirs
+ cd $ROOT/$PKG_BUILD
+ rm -rf .$TARGET_NAME
+}
+
+post_makeinstall_target() {
+ mkdir -p $INSTALL/usr/config/aacs
+ cp -P KEYDB.cfg $INSTALL/usr/config/aacs
+}
diff --git a/packages/multimedia/libaacs/patches/libaacs-0.5.0-automake_1.13.patch b/packages/multimedia/libaacs/patches/libaacs-0.5.0-automake_1.13.patch
deleted file mode 100644
index 2434fb0e79..0000000000
--- a/packages/multimedia/libaacs/patches/libaacs-0.5.0-automake_1.13.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur libaacs-0.5.0-old/configure.ac libaacs-0.5.0-new/configure.ac
---- libaacs-0.5.0-old/configure.ac 2012-08-17 04:28:42.000000000 -0700
-+++ libaacs-0.5.0-new/configure.ac 2013-01-03 21:08:26.000000000 -0800
-@@ -24,7 +24,7 @@
- AC_CONFIG_MACRO_DIR([m4])
- AC_CANONICAL_SYSTEM
- AM_INIT_AUTOMAKE([foreign])
--AM_CONFIG_HEADER(config.h)
-+AC_CONFIG_HEADERS(config.h)
- AM_MAINTAINER_MODE
-
- SET_FEATURES="-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L"
diff --git a/packages/multimedia/libaacs/patches/libaacs-0.5.0-bison_2.6.patch b/packages/multimedia/libaacs/patches/libaacs-0.5.0-bison_2.6.patch
deleted file mode 100644
index 698692c4bd..0000000000
--- a/packages/multimedia/libaacs/patches/libaacs-0.5.0-bison_2.6.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -Naur libaacs-0.4.0-old/src/file/keydbcfg-parser.y libaacs-0.4.0-new/src/file/keydbcfg-parser.y
---- libaacs-0.4.0-old/src/file/keydbcfg-parser.y 2012-05-04 04:23:42.000000000 -0700
-+++ libaacs-0.4.0-new/src/file/keydbcfg-parser.y 2012-07-21 19:20:14.000000000 -0700
-@@ -1,4 +1,8 @@
--%{
-+%code requires {
-+#include "file/keydbcfg.h"
-+}
-+
-+%code {
- /*
- * This file is part of libaacs
- * Copyright (C) 2010 gates
-@@ -18,7 +22,6 @@
- * .
- */
-
--#include "file/keydbcfg.h"
- #include "util/macro.h"
-
- #include
-@@ -85,7 +88,7 @@
-
- /* uncomment the line below for debugging */
- // int yydebug = 1;
--%}
-+}
- /* Options set to generate a reentrant parser that is POSIX yacc compatible
- * The basic 'scanner' parameters are set. Also, another parameter is set
- * to pass in a title entry list struct used to hold all title entries.
diff --git a/packages/multimedia/libaacs/patches/libaacs-buildfix.patch b/packages/multimedia/libaacs/patches/libaacs-buildfix.patch
new file mode 100644
index 0000000000..6d6ba96561
--- /dev/null
+++ b/packages/multimedia/libaacs/patches/libaacs-buildfix.patch
@@ -0,0 +1,14 @@
+diff --git a/configure.ac b/configure.ac
+index 466f7f9..0dec17f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,7 +27,7 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
+ AC_CONFIG_HEADERS(config.h)
+ AM_MAINTAINER_MODE
+
+-SET_FEATURES="-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L"
++SET_FEATURES="-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500"
+
+ case "${host_os}" in
+ "")
+