Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | Summanry = "Middleware framework for smart card terminals" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | HOMEPAGE = "https://github.com/OpenSC/openct/wiki" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 3 | DESCRIPTION = " \ |
| 4 | OpenCT implements drivers for several smart card readers. \ |
| 5 | It comes as driver in ifdhandler format for PC/SC-Lite, \ |
| 6 | as CT-API driver, or as a small and lean middleware, \ |
| 7 | so applications can use it with minimal overhead. \ |
| 8 | OpenCT also has a primitive mechanism to export smart card \ |
| 9 | readers to remote machines via TCP/IP." |
| 10 | |
| 11 | DEPENDS += "libtool pcsc-lite libusb-compat" |
| 12 | |
| 13 | SRC_URI = " \ |
Andrew Geissler | 8fc454f | 2020-12-11 16:27:59 -0600 | [diff] [blame] | 14 | https://downloads.sourceforge.net/project/opensc/${BPN}/${BPN}-${PV}.tar.gz \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 15 | file://etc-openct.udev.in-disablePROGRAM.patch \ |
| 16 | file://etc-openct_usb.in-modify-UDEVINFO.patch \ |
| 17 | file://openct.init \ |
| 18 | file://openct.sysconfig \ |
| 19 | file://openct.service \ |
| 20 | " |
| 21 | |
| 22 | SRC_URI[md5sum] = "a1da3358ab798f1cb9232f1dbababc21" |
| 23 | SRC_URI[sha256sum] = "6cd3e2933d29eb1f875c838ee58b8071fd61f0ec8ed5922a86c01c805d181a68" |
| 24 | |
| 25 | LICENSE = "LGPLv2+" |
| 26 | LIC_FILES_CHKSUM = "file://LGPL-2.1;md5=2d5025d4aa3495befef8f17206a5b0a1" |
| 27 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 28 | inherit systemd |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 29 | SYSTEMD_SERVICE_${PN} += "openct.service " |
| 30 | SYSTEMD_AUTO_ENABLE = "enable" |
| 31 | |
| 32 | EXTRA_OECONF=" \ |
| 33 | --disable-static \ |
| 34 | --enable-usb \ |
| 35 | --enable-pcsc \ |
| 36 | --enable-doc \ |
| 37 | --enable-api-doc \ |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 38 | --with-udev=${nonarch_libdir}/udev \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 39 | --with-bundle=${libdir}/pcsc/drivers \ |
| 40 | " |
| 41 | |
| 42 | inherit autotools pkgconfig |
| 43 | |
| 44 | FILES_${PN} += " \ |
| 45 | ${libdir}/ctapi \ |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 46 | ${nonarch_libdir}/udev \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 47 | ${libdir}/openct-ifd.so \ |
| 48 | ${libdir}/pcsc \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 49 | " |
| 50 | |
| 51 | FILES_${PN}-dbg += " \ |
| 52 | ${libdir}/ctapi/.debug \ |
| 53 | ${libdir}/pcsc/drivers/openct-ifd.bundle/Contents/Linux/.debug \ |
| 54 | " |
| 55 | |
| 56 | INSANE_SKIP_${PN} += "dev-deps" |
| 57 | |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 58 | do_install[cleandirs] += "${D}" |
| 59 | |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 60 | do_install () { |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 61 | install -d ${D}${sysconfdir} |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 62 | # fix up hardcoded paths |
| 63 | sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \ |
| 64 | ${WORKDIR}/openct.service ${WORKDIR}/openct.init |
| 65 | |
| 66 | oe_runmake install DESTDIR=${D} |
| 67 | install -dm 755 ${D}${libdir}/ctapi/ |
| 68 | mv ${D}${libdir}/libopenctapi.so ${D}${libdir}/ctapi/ |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 69 | install -Dpm 644 etc/openct.udev ${D}${nonarch_libdir}/udev/rules.d/60-openct.rules |
| 70 | install -pm 644 etc/openct.conf ${D}${sysconfdir}/openct.conf |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 71 | |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 72 | install -Dpm 755 ${WORKDIR}/openct.init ${D}${sysconfdir}/init.d/openct |
| 73 | install -Dpm 644 ${WORKDIR}/openct.sysconfig ${D}${sysconfdir}/sysconfig/openct |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 74 | |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 75 | install -d ${D}${systemd_unitdir}/system |
| 76 | install -m 644 ${WORKDIR}/openct.service ${D}${systemd_unitdir}/system |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 77 | |
| 78 | so=$(find ${D} -name \*.so | sed "s|^${D}||") |
| 79 | sed -i -e 's|\\(LIBPATH\\s*\\).*|\\1$so|' etc/reader.conf |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 80 | install -Dpm 644 etc/reader.conf ${D}${sysconfdir}/reader.conf.d/openct.conf |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 81 | } |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 82 | |
| 83 | BBCLASSEXTEND = "native" |