blob: 08b2e3c23236e3636d29dcc67d405cd26e2d486c [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 = " \
14 ${DEBIAN_MIRROR}/main/o/${BPN}/${BPN}_${PV}.orig.tar.gz \
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
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 \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050038 --with-udev=${nonarch_base_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 \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050046 ${nonarch_base_libdir}/udev \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050047 ${libdir}/openct-ifd.so \
48 ${libdir}/pcsc \
49 /run/openct/status \
50"
51
52FILES_${PN}-dbg += " \
53 ${libdir}/ctapi/.debug \
54 ${libdir}/pcsc/drivers/openct-ifd.bundle/Contents/Linux/.debug \
55"
56
57INSANE_SKIP_${PN} += "dev-deps"
58
Patrick Williamsb48b7b42016-08-17 15:04:38 -050059do_install () {
60 rm -rf ${D}
61 install -d ${D}/etc
Brad Bishop6e60e8b2018-02-01 10:27:11 -050062 install -dm 755 ${D}${nonarch_base_libdir}/udev
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/
70 install -Dpm 644 etc/openct.udev ${D}/etc/udev/rules.d/60-openct.rules
71 install -pm 644 etc/openct.conf ${D}/etc/openct.conf
72
73 install -Dpm 755 ${WORKDIR}/openct.init ${D}/etc/init.d/openct
74 install -Dpm 644 ${WORKDIR}/openct.sysconfig ${D}/etc/sysconfig/openct
75
Brad Bishop316dfdd2018-06-25 12:45:53 -040076 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
81 install -Dpm 644 etc/reader.conf ${D}/etc/reader.conf.d/openct.conf
82
83 install -dm 755 ${D}${localstatedir}/run/openct
84 touch ${D}${localstatedir}/run/openct/status
85 chmod 644 ${D}${localstatedir}/run/openct/status
Brad Bishop8410d612019-11-25 09:40:59 -050086
87 rm -r ${D}/${localstatedir}/run
Patrick Williamsb48b7b42016-08-17 15:04:38 -050088}