From patchwork Wed Apr 23 07:22:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: christian.braunersorensen@prevas.dk X-Patchwork-Id: 341713 X-Patchwork-Delegate: esben@haabendal.dk Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hugin.dotsrc.org (hugin.dotsrc.org [130.225.254.102]) by ozlabs.org (Postfix) with ESMTP id 58FD21400FB for ; Wed, 23 Apr 2014 17:22:16 +1000 (EST) Received: from hugin.dotsrc.org (localhost [127.0.0.1]) by hugin.dotsrc.org (Postfix) with ESMTP id 722E53FDB3 for ; Wed, 23 Apr 2014 09:22:14 +0200 (CEST) X-Original-To: dev@oe-lite.org Delivered-To: dev@oe-lite.org Received: from mail01.prevas.se (mail01.prevas.se [62.95.78.3]) by hugin.dotsrc.org (Postfix) with ESMTPS id F02043FD61 for ; Wed, 23 Apr 2014 09:22:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=14284; q=dns/txt; s=ironport1; t=1398237729; x=1429773729; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=eWTkG8Z4+xN9YI+UbYOLCIKxJPdQIAhvBt1ieQvqf3w=; b=MP661qmLt6KOVe7QnKeuRlR7RMiq4El0fjWZHc478CfDoCqB3z8zQgct fuar+Qq9GRHqnzFvuPgR+67X21UuMWkc7b4QIuDSPNG5yMWog4xdOKely U//VDTJv0zwtLgygXa87XcJQ3MApojD/HwYhfpmS/K+A5KwKRLY2uSXOb 4=; X-IronPort-AV: E=Sophos;i="4.97,910,1389740400"; d="scan'208";a="4629894" Received: from vmprevas3.prevas.se (HELO smtp.prevas.se) ([172.16.8.103]) by ironport1.prevas.se with ESMTP/TLS/AES128-SHA; 23 Apr 2014 09:22:09 +0200 Received: from localhost (172.16.10.102) by smtp.prevas.se (172.16.8.105) with Microsoft SMTP Server id 14.2.347.0; Wed, 23 Apr 2014 09:22:09 +0200 Received: by localhost (Postfix, from userid 30007) id 3E5AD681DB0; Wed, 23 Apr 2014 07:22:10 +0000 (UTC) From: To: Subject: [PATCH 4/4] pciutils: Add new recipe for pciutils Date: Wed, 23 Apr 2014 07:22:07 +0000 Message-ID: X-Mailer: git-send-email 1.8.4 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: dev@oe-lite.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: OE-lite development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dev-bounces@oe-lite.org Errors-To: dev-bounces@oe-lite.org From: Christian Sørensen --- recipes/pciutils/pciutils/configure.patch | 104 ++++++++++++++++++++++++++ recipes/pciutils/pciutils/guess-fix.patch | 37 +++++++++ recipes/pciutils/pciutils/lib-build-fix.patch | 92 +++++++++++++++++++++++ recipes/pciutils/pciutils/makefile.patch | 31 ++++++++ recipes/pciutils/pciutils/makefile.patch.orig | 26 +++++++ recipes/pciutils/pciutils_3.2.1.oe | 55 ++++++++++++++ recipes/pciutils/pciutils_3.2.1.oe.sig | 1 + 7 files changed, 346 insertions(+) create mode 100644 recipes/pciutils/pciutils/configure.patch create mode 100644 recipes/pciutils/pciutils/guess-fix.patch create mode 100644 recipes/pciutils/pciutils/lib-build-fix.patch create mode 100644 recipes/pciutils/pciutils/makefile.patch create mode 100644 recipes/pciutils/pciutils/makefile.patch.orig create mode 100644 recipes/pciutils/pciutils_3.2.1.oe create mode 100644 recipes/pciutils/pciutils_3.2.1.oe.sig diff --git a/recipes/pciutils/pciutils/configure.patch b/recipes/pciutils/pciutils/configure.patch new file mode 100644 index 0000000..66c9f91 --- /dev/null +++ b/recipes/pciutils/pciutils/configure.patch @@ -0,0 +1,104 @@ +Upstream-Status: Inappropriate [embedded specific] + +# +# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher +# +--- + +7/30/2010 - rebased to 3.1.5 by Qing He +1/22/2012 - rebased to 3.1.9 by Shane Wang + +diff -r af2b10cc3c14 Makefile +--- a/Makefile Sun Jan 22 18:36:34 2012 +0800 ++++ b/Makefile Sun Jan 22 18:38:54 2012 +0800 +@@ -37,7 +37,6 @@ + # Commands + INSTALL=install + DIRINSTALL=install -d +-STRIP=-s + CC=$(CROSS_COMPILE)gcc + AR=$(CROSS_COMPILE)ar + RANLIB=$(CROSS_COMPILE)ranlib +@@ -86,7 +85,7 @@ + example.o: example.c $(PCIINC) + + %: %.o +- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@ ++ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) -o $@ + + %.8 %.7: %.man + M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#" +@@ -101,7 +100,7 @@ + install: all + # -c is ignored on Linux, but required on FreeBSD + $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7 +- $(INSTALL) -c -m 755 $(STRIP) lspci setpci $(DESTDIR)$(SBINDIR) ++ $(INSTALL) -c -m 755 lspci setpci $(DESTDIR)$(SBINDIR) + $(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR) + $(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR) + $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8 +diff -r af2b10cc3c14 lib/configure +--- a/lib/configure Sun Jan 22 18:36:34 2012 +0800 ++++ b/lib/configure Sun Jan 22 18:38:54 2012 +0800 +@@ -14,6 +14,10 @@ + fi + } + ++VERSION=$1 ++IDSDIR=$2 ++DNS=yes ++ + if [ -z "$VERSION" -o -z "$IDSDIR" ] ; then + echo >&2 "Please run the configure script from the top-level Makefile" + exit 1 +@@ -21,8 +25,8 @@ + + echo_n "Configuring libpci for your system..." + if [ -z "$HOST" ] ; then +- sys=`uname -s` +- rel=`uname -r` ++ sys=${3:-`uname -s`} ++ rel= + realsys="$sys" + if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ] + then +@@ -30,7 +34,7 @@ + proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1` + cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'` + else +- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'` ++ cpu=${4:-`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`} + fi + if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ] + then +@@ -40,7 +44,7 @@ + then + sys=cygwin + fi +- HOST=${3:-$cpu-$sys} ++ HOST=$cpu-$sys + fi + [ -n "$RELEASE" ] && rel="${RELEASE}" + # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless. +@@ -49,6 +53,21 @@ + sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo " $host $rel $cpu $sys" + ++if [ "$host" = "linux--gnueabi" ] ++then ++ sys=linux ++fi ++ ++if [ "$host" = "linux--uclibc" ] ++then ++ sys=linux ++fi ++ ++if [ "$host" = "linux--uclibceabi" ] ++then ++ sys=linux ++fi ++ + c=config.h + m=config.mk + echo >$c '#define PCI_CONFIG_H' diff --git a/recipes/pciutils/pciutils/guess-fix.patch b/recipes/pciutils/pciutils/guess-fix.patch new file mode 100644 index 0000000..540b4a0 --- /dev/null +++ b/recipes/pciutils/pciutils/guess-fix.patch @@ -0,0 +1,37 @@ +the original guess algorithm is broken for many archs +for example, the following two would break: + arm-linux-gnueabi --> sys=gnueabi + x86_64-unknown-pc-linux-gnu --> sys = pc-linux-gnu + +use a simpler scheme here and hope it works for all the cases + +Upstream-Status: Pending + +7/30/2010 - created by Qing He + +diff --git a/lib/configure b/lib/configure +index 4318b05..84f6acb 100755 +--- a/lib/configure ++++ b/lib/configure +@@ -53,20 +53,7 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo " $host $rel $cpu $sys" + +-if [ "$host" = "linux--gnueabi" ] +-then +- sys=linux +-fi +- +-if [ "$host" = "linux--uclibc" ] +-then +- sys=linux +-fi +- +-if [ "$host" = "linux--uclibceabi" ] +-then +- sys=linux +-fi ++{ echo "$host" | grep linux; } && sys=linux + + c=config.h + m=config.mk diff --git a/recipes/pciutils/pciutils/lib-build-fix.patch b/recipes/pciutils/pciutils/lib-build-fix.patch new file mode 100644 index 0000000..413ef0e --- /dev/null +++ b/recipes/pciutils/pciutils/lib-build-fix.patch @@ -0,0 +1,92 @@ +Link directly to lib/libpci.so.3.1.5 will hard code this versioned +string into lspci and other utilities, which is not desirable and +won't work. In the other hand, linking to a symbolic link lib/libpci.so +doesn't have this issue. + +Upstream-Status: Pending + +7/30/2010 - created by Qing He + +diff --git a/Makefile b/Makefile +index 74c570a..31337e0 100644 +--- a/Makefile ++++ b/Makefile +@@ -56,9 +56,9 @@ PCIINC_INS=lib/config.h lib/header.h lib/pci.h lib/types.h + + export + +-all: lib/$(PCILIB) lspci setpci example lspci.8 setpci.8 pcilib.7 update-pciids update-pciids.8 $(PCI_IDS) ++all: lib/$(PCILIB_DEV) lspci setpci example lspci.8 setpci.8 pcilib.7 update-pciids update-pciids.8 $(PCI_IDS) + +-lib/$(PCILIB): $(PCIINC) force ++lib/$(PCILIB) lib/$(PCILIB_DEV): $(PCIINC) force + $(MAKE) -C lib all + + force: +@@ -66,8 +66,8 @@ force: + lib/config.h lib/config.mk: + cd lib && ./configure + +-lspci: lspci.o ls-vpd.o ls-caps.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o common.o lib/$(PCILIB) +-setpci: setpci.o common.o lib/$(PCILIB) ++lspci: lspci.o ls-vpd.o ls-caps.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o common.o lib/$(PCILIB_DEV) ++setpci: setpci.o common.o lib/$(PCILIB_DEV) + + LSPCIINC=lspci.h pciutils.h $(PCIINC) + lspci.o: lspci.c $(LSPCIINC) +@@ -89,7 +89,7 @@ update-pciids: update-pciids.sh + chmod +x $@ + + # The example of use of libpci +-example: example.o lib/$(PCILIB) ++example: example.o lib/$(PCILIB_DEV) + example.o: example.c $(PCIINC) + + %: %.o +diff --git a/lib/Makefile b/lib/Makefile +index 1eb06a5..a8dab56 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -42,7 +42,7 @@ ifdef PCI_HAVE_PM_NBSD_LIBPCI + OBJS += nbsd-libpci + endif + +-all: $(PCILIB) $(PCILIBPC) ++all: $(PCILIB_DEV) $(PCILIBPC) + + ifeq ($(SHARED),no) + $(PCILIB): $(addsuffix .o,$(OBJS)) +@@ -53,6 +53,9 @@ else + CFLAGS += -fPIC -fvisibility=hidden + $(PCILIB): $(addsuffix .o,$(OBJS)) + $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,--version-script=libpci.ver -o $@ $^ $(LIB_LDLIBS) ++ ++$(PCILIB_DEV): $(PCILIB) ++ ln -s $< $@ + endif + + $(PCILIBPC): libpci.pc.in +diff --git a/lib/configure b/lib/configure +index 27388bc..6c508cf 100755 +--- a/lib/configure ++++ b/lib/configure +@@ -216,16 +216,18 @@ fi + echo "Checking whether to build a shared library... $SHARED (set manually)" + if [ "$SHARED" = no ] ; then + echo >>$m 'PCILIB=$(LIBNAME).a' ++ echo >>$m 'PCILIB_DEV=$(LIBNAME).a' + echo >>$m 'LDLIBS=$(WITH_LIBS)' + echo >>$m 'LIB_LDLIBS=' + else + echo >>$m 'PCILIB=$(LIBNAME).so.$(VERSION)' ++ echo >>$m 'PCILIB_DEV=$(LIBNAME).so' + # We link the dependencies _to_ the library, so we do not need explicit deps in .pc + echo >>$m 'LDLIBS=' + echo >>$m 'LIB_LDLIBS=$(WITH_LIBS)' + echo >>$c '#define PCI_SHARED_LIB' + if [ "$SHARED" = yes ] ; then +- echo >>$m 'SONAME=-Wl,-soname,$(LIBNAME).so$(ABI_VERSION)' ++ echo >>$m 'SONAME=-Wl,-soname -Wl,$(LIBNAME).so$(ABI_VERSION)' + fi + fi + echo >>$m 'PCILIBPC=$(LIBNAME).pc' diff --git a/recipes/pciutils/pciutils/makefile.patch b/recipes/pciutils/pciutils/makefile.patch new file mode 100644 index 0000000..22a83f4 --- /dev/null +++ b/recipes/pciutils/pciutils/makefile.patch @@ -0,0 +1,31 @@ +--- pciutils-3.2.1/Makefile.orig 2014-04-22 11:58:07.566961586 +0200 ++++ pciutils-3.2.1/Makefile 2014-04-22 11:59:26.778963820 +0200 +@@ -29,13 +29,13 @@ + ABI_VERSION=.3 + + # Installation directories +-PREFIX=/usr/local +-SBINDIR=$(PREFIX)/sbin +-SHAREDIR=$(PREFIX)/share ++PREFIX=$(PREFIX) ++SBINDIR=$(SBINDIR) ++SHAREDIR=$(SHAREDIR) + IDSDIR=$(SHAREDIR) +-MANDIR:=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi) +-INCDIR=$(PREFIX)/include +-LIBDIR=$(PREFIX)/lib ++MANDIR:=$(MANDIR) ++INCDIR=$(INCDIR) ++LIBDIR=$(LIBDIR) + PKGCFDIR=$(LIBDIR)/pkgconfig + + # Commands +@@ -92,7 +92,7 @@ + example.o: example.c $(PCIINC) + + %: %.o +- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) -o $@ ++ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@ + + %.8 %.7: %.man + M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#" diff --git a/recipes/pciutils/pciutils/makefile.patch.orig b/recipes/pciutils/pciutils/makefile.patch.orig new file mode 100644 index 0000000..c3fbc6f --- /dev/null +++ b/recipes/pciutils/pciutils/makefile.patch.orig @@ -0,0 +1,26 @@ +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Ionut Radu + +Index: pciutils-3.2.0/Makefile +=================================================================== +--- pciutils-3.2.0.orig/Makefile ++++ pciutils-3.2.0/Makefile +@@ -35,7 +35,7 @@ SHAREDIR=$(PREFIX)/share + IDSDIR=$(SHAREDIR) + MANDIR:=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi) + INCDIR=$(PREFIX)/include +-LIBDIR=$(PREFIX)/lib ++LIBDIR=$(libdir) + PKGCFDIR=$(LIBDIR)/pkgconfig + + # Commands +@@ -94,7 +94,7 @@ example: example.o lib/$(PCILIB_DEV) + example.o: example.c $(PCIINC) + + %: %.o +- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) -o $@ ++ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@ + + %.8 %.7: %.man + M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#" diff --git a/recipes/pciutils/pciutils_3.2.1.oe b/recipes/pciutils/pciutils_3.2.1.oe new file mode 100644 index 0000000..7eeb852 --- /dev/null +++ b/recipes/pciutils/pciutils_3.2.1.oe @@ -0,0 +1,55 @@ +SUMMARY = "PCI utilities" +DESCRIPTION = 'The PCI Utilities package contains a library for portable access \ +to PCI bus configuration space and several utilities based on this library.' +HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml" + +LICENSE = "GPL-2.0+" + +inherit c make +DEPENDS += "zlib libresolv" + +require conf/fetch/kernelorg.conf +SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.bz2 \ + file://configure.patch \ + file://lib-build-fix.patch \ + file://guess-fix.patch \ + file://makefile.patch" + +PARALLEL_MAKE = "" + +PCI_CONF_FLAG = "ZLIB=yes DNS=yes SHARED=yes PREFIX=${prefix} \ + SBINDIR=${sbindir} SHAREDIR=${datadir} INCDIR=${includedir} \ + LIBDIR=${libdir} MANDIR=${mandir} CROSS_COMPILE=${HOST_PREFIX}" + +# see configure.patch +do_configure () { + ( + cd lib && \ + ${PCI_CONF_FLAG} ./configure ${PV} ${datadir} ${TARGET_OS} ${TARGET_ARCH} + ) +} + +do_compile[prefuncs] += "do_compile_cleanup" +do_compile_cleanup () { + #Otherwise rebuilding fails + rm ${S}/lib/libpci.so +} + +EXTRA_OEMAKE = "${PCI_CONF_FLAG}" + +EXTRA_OEMAKE_INSTALL = "install-lib" + +inherit library +LIBRARY_NAME = "libpci" +DEPENDS_${PN} = "libc zlib libresolv" +RDEPENDS_${PN} = "libc zlib libresolv" + +inherit auto-package-utils +AUTO_PACKAGE_UTILS = "lspci setpci update-pciids" +DEPENDS_${PN}-lspci = "libc zlib libresolv libpci" +RDEPENDS_${PN}-lspci = "libc zlib libresolv libpci" +DEPENDS_${PN}-setpci = "libc zlib libresolv libpci" +RDEPENDS_${PN}-setpci = "libc zlib libresolv libpci" + +PACKAGES += "${PN}-ids" +FILES_${PN}-ids = "${datadir}/pci.ids.gz" diff --git a/recipes/pciutils/pciutils_3.2.1.oe.sig b/recipes/pciutils/pciutils_3.2.1.oe.sig new file mode 100644 index 0000000..64dc395 --- /dev/null +++ b/recipes/pciutils/pciutils_3.2.1.oe.sig @@ -0,0 +1 @@ +4ff9f98938c063b1f183cebc2a0c9dcbc80395d4 pciutils-3.2.1.tar.bz2