blob: 67b7c29753023b3e7944f32e25b8fc06e04904b8 [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 Williamsddad1a12017-02-23 20:36:32 -060059do_install_append() {
60 rm -r ${D}/${localstatedir}/run
61}
Patrick Williamsb48b7b42016-08-17 15:04:38 -050062
63do_install () {
64 rm -rf ${D}
65 install -d ${D}/etc
Brad Bishop6e60e8b2018-02-01 10:27:11 -050066 install -dm 755 ${D}${nonarch_base_libdir}/udev
Patrick Williamsb48b7b42016-08-17 15:04:38 -050067 # fix up hardcoded paths
68 sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \
69 ${WORKDIR}/openct.service ${WORKDIR}/openct.init
70
71 oe_runmake install DESTDIR=${D}
72 install -dm 755 ${D}${libdir}/ctapi/
73 mv ${D}${libdir}/libopenctapi.so ${D}${libdir}/ctapi/
74 install -Dpm 644 etc/openct.udev ${D}/etc/udev/rules.d/60-openct.rules
75 install -pm 644 etc/openct.conf ${D}/etc/openct.conf
76
77 install -Dpm 755 ${WORKDIR}/openct.init ${D}/etc/init.d/openct
78 install -Dpm 644 ${WORKDIR}/openct.sysconfig ${D}/etc/sysconfig/openct
79
Brad Bishop316dfdd2018-06-25 12:45:53 -040080 install -d ${D}/${systemd_unitdir}/system
81 install -m 644 ${WORKDIR}/openct.service ${D}/${systemd_unitdir}/system
Patrick Williamsb48b7b42016-08-17 15:04:38 -050082
83 so=$(find ${D} -name \*.so | sed "s|^${D}||")
84 sed -i -e 's|\\(LIBPATH\\s*\\).*|\\1$so|' etc/reader.conf
85 install -Dpm 644 etc/reader.conf ${D}/etc/reader.conf.d/openct.conf
86
87 install -dm 755 ${D}${localstatedir}/run/openct
88 touch ${D}${localstatedir}/run/openct/status
89 chmod 644 ${D}${localstatedir}/run/openct/status
90}