blob: 3dae8b33cae9575fa076dbed2833a5bb0c385130 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001Summanry = "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 \
17 file://openct.init \
18 file://openct.sysconfig \
19 file://openct.service \
20"
21
22SRC_URI[md5sum] = "a1da3358ab798f1cb9232f1dbababc21"
23SRC_URI[sha256sum] = "6cd3e2933d29eb1f875c838ee58b8071fd61f0ec8ed5922a86c01c805d181a68"
24
25LICENSE = "LGPLv2+"
26LIC_FILES_CHKSUM = "file://LGPL-2.1;md5=2d5025d4aa3495befef8f17206a5b0a1"
27
Brad Bishop316dfdd2018-06-25 12:45:53 -040028inherit systemd
Patrick Williamsb48b7b42016-08-17 15:04:38 -050029SYSTEMD_SERVICE_${PN} += "openct.service "
30SYSTEMD_AUTO_ENABLE = "enable"
31
32EXTRA_OECONF=" \
33 --disable-static \
34 --enable-usb \
35 --enable-pcsc \
36 --enable-doc \
37 --enable-api-doc \
Andrew Geissler72956ed2021-01-08 16:11:14 -060038 --with-udev=${nonarch_libdir}/udev \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050039 --with-bundle=${libdir}/pcsc/drivers \
40"
41
42inherit autotools pkgconfig
43
44FILES_${PN} += " \
45 ${libdir}/ctapi \
Andrew Geissler72956ed2021-01-08 16:11:14 -060046 ${nonarch_libdir}/udev \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050047 ${libdir}/openct-ifd.so \
48 ${libdir}/pcsc \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050049"
50
51FILES_${PN}-dbg += " \
52 ${libdir}/ctapi/.debug \
53 ${libdir}/pcsc/drivers/openct-ifd.bundle/Contents/Linux/.debug \
54"
55
56INSANE_SKIP_${PN} += "dev-deps"
57
Andrew Geissler72956ed2021-01-08 16:11:14 -060058do_install[cleandirs] += "${D}"
59
Patrick Williamsb48b7b42016-08-17 15:04:38 -050060do_install () {
Andrew Geissler72956ed2021-01-08 16:11:14 -060061 install -d ${D}${sysconfdir}
Patrick Williamsb48b7b42016-08-17 15:04:38 -050062 # 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 Geissler72956ed2021-01-08 16:11:14 -060069 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 Williamsb48b7b42016-08-17 15:04:38 -050071
Andrew Geissler72956ed2021-01-08 16:11:14 -060072 install -Dpm 755 ${WORKDIR}/openct.init ${D}${sysconfdir}/init.d/openct
73 install -Dpm 644 ${WORKDIR}/openct.sysconfig ${D}${sysconfdir}/sysconfig/openct
Patrick Williamsb48b7b42016-08-17 15:04:38 -050074
Andrew Geissler72956ed2021-01-08 16:11:14 -060075 install -d ${D}${systemd_unitdir}/system
76 install -m 644 ${WORKDIR}/openct.service ${D}${systemd_unitdir}/system
Patrick Williamsb48b7b42016-08-17 15:04:38 -050077
78 so=$(find ${D} -name \*.so | sed "s|^${D}||")
79 sed -i -e 's|\\(LIBPATH\\s*\\).*|\\1$so|' etc/reader.conf
Andrew Geissler72956ed2021-01-08 16:11:14 -060080 install -Dpm 644 etc/reader.conf ${D}${sysconfdir}/reader.conf.d/openct.conf
Patrick Williamsb48b7b42016-08-17 15:04:38 -050081}
Andrew Geissler72956ed2021-01-08 16:11:14 -060082
83BBCLASSEXTEND = "native"