blob: 4a1a0f568df4d13d3c7e159a2d14f6bad680daf9 [file] [log] [blame]
Andrew Geissler220dafd2023-10-04 10:18:08 -05001SUMMARY = "Middleware framework for smart card terminals"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002HOMEPAGE = "https://github.com/OpenSC/openct/wiki"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05003DESCRIPTION = " \
4OpenCT implements drivers for several smart card readers. \
5It comes as driver in ifdhandler format for PC/SC-Lite, \
6as CT-API driver, or as a small and lean middleware, \
7so applications can use it with minimal overhead. \
8OpenCT also has a primitive mechanism to export smart card \
9readers to remote machines via TCP/IP."
10
11DEPENDS += "libtool pcsc-lite libusb-compat"
12
13SRC_URI = " \
Andrew Geissler8fc454f2020-12-11 16:27:59 -060014 https://downloads.sourceforge.net/project/opensc/${BPN}/${BPN}-${PV}.tar.gz \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050015 file://etc-openct.udev.in-disablePROGRAM.patch \
16 file://etc-openct_usb.in-modify-UDEVINFO.patch \
Patrick Williamse760df82023-05-26 11:10:49 -050017 file://0001-m4-Just-emit-the-first-line-of-compiler-version.patch \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050018 file://openct.init \
19 file://openct.sysconfig \
20 file://openct.service \
21"
22
23SRC_URI[md5sum] = "a1da3358ab798f1cb9232f1dbababc21"
24SRC_URI[sha256sum] = "6cd3e2933d29eb1f875c838ee58b8071fd61f0ec8ed5922a86c01c805d181a68"
25
Andrew Geissler9aee5002022-03-30 16:27:02 +000026LICENSE = "LGPL-2.0-or-later"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050027LIC_FILES_CHKSUM = "file://LGPL-2.1;md5=2d5025d4aa3495befef8f17206a5b0a1"
28
Brad Bishop316dfdd2018-06-25 12:45:53 -040029inherit systemd
Patrick Williams213cb262021-08-07 19:21:33 -050030SYSTEMD_SERVICE:${PN} += "openct.service "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050031SYSTEMD_AUTO_ENABLE = "enable"
32
33EXTRA_OECONF=" \
34 --disable-static \
35 --enable-usb \
36 --enable-pcsc \
37 --enable-doc \
38 --enable-api-doc \
Andrew Geissler72956ed2021-01-08 16:11:14 -060039 --with-udev=${nonarch_libdir}/udev \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050040 --with-bundle=${libdir}/pcsc/drivers \
41"
42
43inherit autotools pkgconfig
44
Patrick Williams213cb262021-08-07 19:21:33 -050045FILES:${PN} += " \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050046 ${libdir}/ctapi \
Andrew Geissler72956ed2021-01-08 16:11:14 -060047 ${nonarch_libdir}/udev \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050048 ${libdir}/openct-ifd.so \
49 ${libdir}/pcsc \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050050"
51
Patrick Williams213cb262021-08-07 19:21:33 -050052FILES:${PN}-dbg += " \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050053 ${libdir}/ctapi/.debug \
54 ${libdir}/pcsc/drivers/openct-ifd.bundle/Contents/Linux/.debug \
55"
56
Patrick Williams213cb262021-08-07 19:21:33 -050057INSANE_SKIP:${PN} += "dev-deps"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050058
Andrew Geissler72956ed2021-01-08 16:11:14 -060059do_install[cleandirs] += "${D}"
60
Patrick Williamsb48b7b42016-08-17 15:04:38 -050061do_install () {
Andrew Geissler72956ed2021-01-08 16:11:14 -060062 install -d ${D}${sysconfdir}
Patrick Williamsb48b7b42016-08-17 15:04:38 -050063 # fix up hardcoded paths
64 sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \
65 ${WORKDIR}/openct.service ${WORKDIR}/openct.init
66
67 oe_runmake install DESTDIR=${D}
68 install -dm 755 ${D}${libdir}/ctapi/
69 mv ${D}${libdir}/libopenctapi.so ${D}${libdir}/ctapi/
Andrew Geissler72956ed2021-01-08 16:11:14 -060070 install -Dpm 644 etc/openct.udev ${D}${nonarch_libdir}/udev/rules.d/60-openct.rules
71 install -pm 644 etc/openct.conf ${D}${sysconfdir}/openct.conf
Patrick Williamsb48b7b42016-08-17 15:04:38 -050072
Andrew Geissler72956ed2021-01-08 16:11:14 -060073 install -Dpm 755 ${WORKDIR}/openct.init ${D}${sysconfdir}/init.d/openct
74 install -Dpm 644 ${WORKDIR}/openct.sysconfig ${D}${sysconfdir}/sysconfig/openct
Patrick Williamsb48b7b42016-08-17 15:04:38 -050075
Andrew Geissler72956ed2021-01-08 16:11:14 -060076 install -d ${D}${systemd_unitdir}/system
77 install -m 644 ${WORKDIR}/openct.service ${D}${systemd_unitdir}/system
Patrick Williamsb48b7b42016-08-17 15:04:38 -050078
79 so=$(find ${D} -name \*.so | sed "s|^${D}||")
80 sed -i -e 's|\\(LIBPATH\\s*\\).*|\\1$so|' etc/reader.conf
Andrew Geissler72956ed2021-01-08 16:11:14 -060081 install -Dpm 644 etc/reader.conf ${D}${sysconfdir}/reader.conf.d/openct.conf
Patrick Williamsb48b7b42016-08-17 15:04:38 -050082}
Andrew Geissler72956ed2021-01-08 16:11:14 -060083
84BBCLASSEXTEND = "native"