sys-apps/pcsc-slb-rf72-drv: fixups
authorAlon Bar-Lev <alonbl@gentoo.org>
Fri, 17 Jun 2016 16:05:09 +0000 (19:05 +0300)
committerAlon Bar-Lev <alonbl@gentoo.org>
Fri, 17 Jun 2016 16:05:40 +0000 (19:05 +0300)
EAP-6, fix src_uri, rework patch

Bug: 530668

Package-Manager: portage-2.2.28

sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build-new.patch [deleted file]
sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build.patch [deleted file]
sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-openct.patch [new file with mode: 0644]
sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r2.ebuild

diff --git a/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build-new.patch b/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build-new.patch
deleted file mode 100644 (file)
index dd386b6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -urNp slb_rf72.org/ifdhandler.c slb_rf72/ifdhandler.c
---- slb_rf72.org/ifdhandler.c  2001-08-23 17:19:22.000000000 +0300
-+++ slb_rf72/ifdhandler.c      2006-10-07 12:57:43.000000000 +0200
-@@ -37,6 +37,7 @@
- #ifdef HAVE_PTHREAD_H
- #include <pthread.h>
- #endif
-+#include <openct/ctapi.h>
- /*
-  * Not exported constants definition
-diff -urNp slb_rf72.org/Makefile slb_rf72/Makefile
---- slb_rf72.org/Makefile      2001-09-05 18:22:00.000000000 +0300
-+++ slb_rf72/Makefile  2006-10-07 13:05:20.000000000 +0200
-@@ -16,7 +16,7 @@ clean: 
-       rm -f test *.o *.lo *.so
- lib:  $(OBJ)
--      $(LD) -G ifdhandler.o lib/libctapi.a -o libslb_rf72.so
-+      $(CC) $(LDFLAGS) -shared `pkg-config --libs-only-L libopenct` -lopenctapi ifdhandler.o -o libslb_rf72.so
- ifdhandler.o: ifdhandler.h ifdhandler.c
--      $(CC) $(CFLAGS) -c ifdhandler.c $(INCLUDES)
-+      $(CC) $(CFLAGS) `pkg-config --cflags libopenct` -fPIC -DHAVE_PTHREAD_H -c ifdhandler.c $(INCLUDES)
diff --git a/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build.patch b/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build.patch
deleted file mode 100644 (file)
index 0e6a7db..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -urNp slb_rf72.org/ifdhandler.c slb_rf72/ifdhandler.c
---- slb_rf72.org/ifdhandler.c  2001-08-23 17:19:22.000000000 +0300
-+++ slb_rf72/ifdhandler.c      2006-10-07 12:57:43.000000000 +0200
-@@ -37,6 +37,7 @@
- #ifdef HAVE_PTHREAD_H
- #include <pthread.h>
- #endif
-+#include <openct/ctapi.h>
- /*
-  * Not exported constants definition
-diff -urNp slb_rf72.org/Makefile slb_rf72/Makefile
---- slb_rf72.org/Makefile      2001-09-05 18:22:00.000000000 +0300
-+++ slb_rf72/Makefile  2006-10-07 13:05:20.000000000 +0200
-@@ -16,7 +16,7 @@ clean: 
-       rm -f test *.o *.lo *.so
- lib:  $(OBJ)
--      $(LD) -G ifdhandler.o lib/libctapi.a -o libslb_rf72.so
-+      $(CC) -shared `pkg-config --libs-only-L libopenct` -lopenctapi ifdhandler.o -o libslb_rf72.so
- ifdhandler.o: ifdhandler.h ifdhandler.c
--      $(CC) $(CFLAGS) -c ifdhandler.c $(INCLUDES)
-+      $(CC) $(CFLAGS) `pkg-config --cflags libopenct` -fPIC -DHAVE_PTHREAD_H -c ifdhandler.c $(INCLUDES)
diff --git a/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-openct.patch b/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-openct.patch
new file mode 100644 (file)
index 0000000..c7ddb87
--- /dev/null
@@ -0,0 +1,41 @@
+From a0822b820d59a53b0aab87cc12c4d1eae2228561 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Fri, 17 Jun 2016 18:58:05 +0300
+Subject: [PATCH] build: use openct instead of embedded binary ctapi
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ Makefile     | 4 ++--
+ ifdhandler.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index cdba2b6..319449a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -16,7 +16,7 @@ clean:
+       rm -f test *.o *.lo *.so
+ lib:  $(OBJ)
+-      $(LD) -G ifdhandler.o lib/libctapi.a -o libslb_rf72.so
++      $(CC) $(LDFLAGS) -shared `pkg-config --libs-only-L libopenct` -lopenctapi ifdhandler.o -o libslb_rf72.so
+ ifdhandler.o: ifdhandler.h ifdhandler.c
+-      $(CC) $(CFLAGS) -c ifdhandler.c $(INCLUDES)
++      $(CC) $(CFLAGS) `pkg-config --cflags libopenct` -fPIC -DHAVE_PTHREAD_H -c ifdhandler.c $(INCLUDES)
+diff --git a/ifdhandler.c b/ifdhandler.c
+index cbb3a65..256605e 100644
+--- a/ifdhandler.c
++++ b/ifdhandler.c
+@@ -29,7 +29,7 @@
+ #include "pcscdefines.h"
+ #include "ifdhandler.h"
+ #include <ctapidefines.h>
+-#include <ctapi.h>
++#include <openct/ctapi.h>
+ #include <ctbcs.h>
+ #include <stdio.h>
+ #include <string.h>
+-- 
+2.7.3
+
index 7af68a538a39ad1170fb71db66936be50fa41a70..777ba41cce3e06f3e694e7f49a937ab3bea5656e 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI="2"
+EAPI="6"
 
 inherit eutils toolchain-funcs
 
@@ -14,37 +14,36 @@ LICENSE="all-rights-reserved BSD LGPL-2.1+"
 KEYWORDS="~amd64 ~x86"
 IUSE=""
 SLOT="0"
-SRC_URI="http://www.linuxnet.com/drivers/readers/files/slb_rf72-drv-1.1.0.tar.gz"
-RESTRICT="mirror bindist"
+SRC_URI="mirror://gentoo/${MY_P}-drv-${PV}.tar.gz"
 
 RDEPEND="sys-apps/pcsc-lite
        dev-libs/openct"
 DEPEND="${RDEPEND}
        virtual/pkgconfig"
 
-src_prepare() {
-       epatch "${FILESDIR}/${P}-build-new.patch"
-}
+PATCHES=(
+       "${FILESDIR}/${P}-openct.patch"
+)
 
 src_compile() {
-       emake CC="$(tc-getCC)" LD="$(tc-getLD)" || die
+       emake CC="$(tc-getCC)" LD="$(tc-getLD)"
 }
 
 src_install () {
        local pcscdir="$(pkg-config --variable=usbdropdir libpcsclite)"
        local conf="/etc/reader.conf.d/${PN}.conf"
 
-       dodoc ERRATA README || die
+       dodoc ERRATA README
 
-       dodir "${pcscdir}/serial" || die
+       dodir "${pcscdir}/serial"
        insinto "${pcscdir}/serial"
        insopts -m755
-       doins libslb_rf72.so || die
+       doins libslb_rf72.so
 
-       dodir "$(dirname "${conf}")" || die
+       dodir "$(dirname "${conf}")"
        insinto "$(dirname "${conf}")"
-       newins "${FILESDIR}/reader.conf" "$(basename "${conf}")" || die
-       sed -i "s#%PCSC_DRIVERS_DIR%#${pcscdir}#g" "${D}/${conf}" || die
+       newins "${FILESDIR}/reader.conf" "$(basename "${conf}")"
+       sed -i "s#%PCSC_DRIVERS_DIR%#${pcscdir}#g" "${D}/${conf}"
 
        einfo "NOTICE:"
        einfo "1. modify ${conf}"