diff --git a/packages/multimedia/crystalhd/build b/packages/multimedia/crystalhd/build
deleted file mode 100755
index a3e69f3079..0000000000
--- a/packages/multimedia/crystalhd/build
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC 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 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC 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. If not, see .
-################################################################################
-
-. config/options $1
-
-cd $PKG_BUILD/driver/linux
-autoreconf -vif
-./configure --host=$TARGET_NAME \
- --build=$HOST_NAME \
- --prefix=/usr \
- --with-kernel-path=$(kernel_path) \
-
-LDFLAGS="" make V=1
-
-cd ../../linux_lib/libcrystalhd
-
-make BCGCC=$TARGET_CXX
-$MAKEINSTALL
diff --git a/packages/multimedia/crystalhd/install b/packages/multimedia/crystalhd/install
deleted file mode 100755
index 54d6484de5..0000000000
--- a/packages/multimedia/crystalhd/install
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC 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 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC 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. If not, see .
-################################################################################
-
-. config/options $1
-
-mkdir -p $INSTALL/lib/firmware
- cp $PKG_BUILD/firmware/fwbin/*/*.bin $INSTALL/lib/firmware
-
-mkdir -p $INSTALL/usr/lib
- cp -P $PKG_BUILD/linux_lib/libcrystalhd/*.so* $INSTALL/usr/lib
-
-mkdir -p $INSTALL/lib/udev/rules.d
- cp $PKG_BUILD/driver/linux/*.rules $INSTALL/lib/udev/rules.d
-
-mkdir -p $INSTALL/lib/modules/$(get_module_dir)/crystalhd
- cp $PKG_BUILD/driver/linux/crystalhd.ko $INSTALL/lib/modules/$(get_module_dir)/crystalhd
diff --git a/packages/multimedia/crystalhd/meta b/packages/multimedia/crystalhd/package.mk
similarity index 68%
rename from packages/multimedia/crystalhd/meta
rename to packages/multimedia/crystalhd/package.mk
index 513da7009f..f3e5fc2fe4 100644
--- a/packages/multimedia/crystalhd/meta
+++ b/packages/multimedia/crystalhd/package.mk
@@ -23,13 +23,41 @@ PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://git.linuxtv.org/jarod/crystalhd.git"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
-PKG_DEPENDS="linux"
-PKG_BUILD_DEPENDS="toolchain linux"
+PKG_DEPENDS_TARGET="linux"
+PKG_BUILD_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_PRIORITY="optional"
PKG_SECTION="multimedia"
PKG_SHORTDESC="crystalhd: OSX and Linux driver and library support for the Broadcom Crystal HD Video Accelerator."
PKG_LONGDESC="OSX and Linux driver and library support for the Broadcom Crystal HD Video Accelerator. Supported under XBMC for Mac on the AppleTV and under 10.4 and 10.5 OSX platforms."
-PKG_IS_ADDON="no"
+PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
+
+pre_configure_target() {
+ cd driver/linux
+ autoreconf -vif
+}
+
+configure_target() {
+ ./configure --host=$TARGET_NAME \
+ --build=$HOST_NAME \
+ --prefix=/usr \
+ --with-kernel-path=$(kernel_path)
+}
+
+make_target() {
+ LDFLAGS="" make V=1
+
+ cd $ROOT/$PKG_BUILD/linux_lib/libcrystalhd
+ make BCGCC=$TARGET_CXX
+}
+
+post_makeinstall_target() {
+ cd $ROOT/$PKG_BUILD
+ mkdir -p $INSTALL/lib/udev/rules.d
+ cp driver/linux/*.rules $INSTALL/lib/udev/rules.d
+
+ mkdir -p $INSTALL/lib/modules/$(get_module_dir)/crystalhd
+ cp driver/linux/crystalhd.ko $INSTALL/lib/modules/$(get_module_dir)/crystalhd
+}