diff --git a/packages/sysutils/pciutils/build b/packages/sysutils/pciutils/build
deleted file mode 100755
index fcfdd9eaf9..0000000000
--- a/packages/sysutils/pciutils/build
+++ /dev/null
@@ -1,49 +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
-
-# pciutils fails building with LTO support
- strip_lto
-
-cd $PKG_BUILD
-
-make OPT="$CFLAGS" \
- CROSS_COMPILE=${TARGET_PREFIX} \
- HOST=$TARGET_ARCH-linux \
- IDSDIR="/usr/share" \
- ZLIB=no \
- DNS=no \
- SHARED=yes \
- STRIP="" \
- PREFIX=/usr \
-
-make PREFIX=/usr \
- SHARED=yes \
- STRIP=""\
- IDSDIR="/usr/share" \
- DESTDIR=$SYSROOT_PREFIX install
-
-make PREFIX=/usr \
- SHARED=yes \
- STRIP="" \
- IDSDIR="/usr/share" \
- DESTDIR=$SYSROOT_PREFIX install-lib
-
diff --git a/packages/sysutils/pciutils/install b/packages/sysutils/pciutils/install
deleted file mode 100755
index 1b55618c15..0000000000
--- a/packages/sysutils/pciutils/install
+++ /dev/null
@@ -1,36 +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
-
-PCIUTILS_ABI=`echo $PKG_VERSION | cut -f1 -d "."`
-
-if [ "$TARGET_ARCH" = i386 -o "$TARGET_ARCH" = x86_64 ]; then
- mkdir -p $INSTALL/usr/bin
- cp $PKG_BUILD/lspci $INSTALL/usr/bin
-fi
-
-mkdir -p $INSTALL/usr/lib
- cp $PKG_BUILD/lib/libpci.so.$PKG_VERSION $INSTALL/usr/lib
- ln -sf libpci.so.$PKG_VERSION $INSTALL/usr/lib/libpci.so.$PCIUTILS_ABI
- ln -sf libpci.so.$PCIUTILS_ABI $INSTALL/usr/lib/libpci.so
-
-mkdir -p $INSTALL/usr/share
- cp $PKG_DIR/config/pci.ids $INSTALL/usr/share
\ No newline at end of file
diff --git a/packages/sysutils/pciutils/meta b/packages/sysutils/pciutils/package.mk
similarity index 62%
rename from packages/sysutils/pciutils/meta
rename to packages/sysutils/pciutils/package.mk
index b5d31fcf22..66c3eebf06 100644
--- a/packages/sysutils/pciutils/meta
+++ b/packages/sysutils/pciutils/package.mk
@@ -24,11 +24,45 @@ PKG_LICENSE="GPL"
PKG_SITE="http://mj.ucw.cz/pciutils.shtml"
PKG_URL="http://www.kernel.org/pub/software/utils/pciutils/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS=""
-PKG_BUILD_DEPENDS="toolchain"
+PKG_BUILD_DEPENDS_TARGET="toolchain"
PKG_PRIORITY="optional"
PKG_SECTION="system"
PKG_SHORTDESC="pciutils: Linux PCI Utilities"
PKG_LONGDESC="This package contains various utilities for inspecting and setting of devices connected to the PCI bus and the PCI vendor/product ID database."
-PKG_IS_ADDON="no"
+PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
+
+PKG_MAKE_OPTS="PREFIX=/usr SHARED=yes STRIP= IDSDIR=/usr/share"
+
+pre_make_target() {
+# pciutils fails building with LTO support
+ strip_lto
+}
+
+make_target() {
+ make OPT="$CFLAGS" \
+ CROSS_COMPILE=${TARGET_PREFIX} \
+ HOST=$TARGET_ARCH-linux \
+ $PKG_MAKE_OPTS \
+ ZLIB=no \
+ DNS=no
+}
+
+makeinstall_target() {
+ make $PKG_MAKE_OPTS DESTDIR=$SYSROOT_PREFIX install
+ make $PKG_MAKE_OPTS DESTDIR=$SYSROOT_PREFIX install-lib
+ make $PKG_MAKE_OPTS DESTDIR=$INSTALL install-lib
+ if [ "$TARGET_ARCH" = i386 -o "$TARGET_ARCH" = x86_64 ]; then
+ make $PKG_MAKE_OPTS DESTDIR=$INSTALL install
+ fi
+}
+
+post_makeinstall_target() {
+ rm -rf $INSTALL/usr/bin/setpci
+ rm -rf $INSTALL/usr/bin/update-pciids
+ rm -rf $INSTALL/usr/share
+
+ mkdir -p $INSTALL/usr/share
+ cp $PKG_DIR/config/pci.ids $INSTALL/usr/share
+}