Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 1 | SUMMARY = "TrouSerS - An open-source TCG Software Stack implementation." |
| 2 | LICENSE = "BSD" |
| 3 | HOMEPAGE = "http://sourceforge.net/projects/trousers/" |
| 4 | LIC_FILES_CHKSUM = "file://README;startline=3;endline=4;md5=2af28fbed0832e4d83a9e6dd68bb4413" |
| 5 | SECTION = "security/tpm" |
| 6 | |
| 7 | DEPENDS = "openssl" |
| 8 | |
| 9 | SRCREV = "4b9a70d5789b0b74f43957a6c19ab2156a72d3e0" |
| 10 | PV = "0.3.14+git${SRCPV}" |
| 11 | |
| 12 | SRC_URI = " \ |
| 13 | git://git.code.sf.net/p/trousers/trousers \ |
| 14 | file://trousers.init.sh \ |
| 15 | file://trousers-udev.rules \ |
| 16 | file://tcsd.service \ |
| 17 | file://get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch \ |
| 18 | file://0001-build-don-t-override-localstatedir-mandir-sysconfdir.patch \ |
| 19 | " |
| 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | inherit autotools pkgconfig useradd update-rc.d ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)} |
| 24 | |
| 25 | PACKAGECONFIG ?= "gmp " |
| 26 | PACKAGECONFIG[gmp] = "--with-gmp, --with-gmp=no, gmp" |
| 27 | PACKAGECONFIG[gtk] = "--with-gui=gtk, --with-gui=none, gtk+" |
| 28 | |
| 29 | do_install () { |
| 30 | oe_runmake DESTDIR=${D} install |
| 31 | } |
| 32 | |
| 33 | do_install_append() { |
| 34 | install -d ${D}${sysconfdir}/init.d |
| 35 | install -m 0755 ${WORKDIR}/trousers.init.sh ${D}${sysconfdir}/init.d/trousers |
| 36 | install -d ${D}${sysconfdir}/udev/rules.d |
| 37 | install -m 0644 ${WORKDIR}/trousers-udev.rules ${D}${sysconfdir}/udev/rules.d/45-trousers.rules |
| 38 | |
| 39 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 40 | install -d ${D}${systemd_unitdir}/system |
| 41 | install -m 0644 ${WORKDIR}/tcsd.service ${D}${systemd_unitdir}/system/ |
| 42 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/tcsd.service |
| 43 | fi |
| 44 | } |
| 45 | |
| 46 | CONFFILES_${PN} += "${sysconfig}/tcsd.conf" |
| 47 | |
| 48 | PROVIDES = "${PACKAGES}" |
| 49 | PACKAGES = " \ |
| 50 | libtspi \ |
| 51 | libtspi-dbg \ |
| 52 | libtspi-dev \ |
| 53 | libtspi-doc \ |
| 54 | libtspi-staticdev \ |
| 55 | trousers \ |
| 56 | trousers-dbg \ |
| 57 | trousers-doc \ |
| 58 | " |
| 59 | |
| 60 | # libtspi needs tcsd for most (all?) operations, so suggest to |
| 61 | # install that. |
| 62 | RRECOMMENDS_libtspi = "${PN}" |
| 63 | |
| 64 | FILES_libtspi = " \ |
| 65 | ${libdir}/*.so.1 \ |
| 66 | ${libdir}/*.so.1.2.0 \ |
| 67 | " |
| 68 | FILES_libtspi-dbg = " \ |
| 69 | ${libdir}/.debug \ |
| 70 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/tspi \ |
| 71 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/trspi \ |
| 72 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/include/*.h \ |
| 73 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/include/tss \ |
| 74 | " |
| 75 | FILES_libtspi-dev = " \ |
| 76 | ${includedir} \ |
| 77 | ${libdir}/*.so \ |
| 78 | " |
| 79 | FILES_libtspi-doc = " \ |
| 80 | ${mandir}/man3 \ |
| 81 | " |
| 82 | FILES_libtspi-staticdev = " \ |
| 83 | ${libdir}/*.la \ |
| 84 | ${libdir}/*.a \ |
| 85 | " |
| 86 | FILES_${PN} = " \ |
| 87 | ${sbindir}/tcsd \ |
| 88 | ${sysconfdir} \ |
| 89 | ${localstatedir} \ |
| 90 | " |
| 91 | |
| 92 | FILES_${PN}-dev += "${libdir}/trousers" |
| 93 | |
| 94 | FILES_${PN}-dbg = " \ |
| 95 | ${sbindir}/.debug \ |
| 96 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/tcs \ |
| 97 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/tcsd \ |
| 98 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/tddl \ |
| 99 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/trousers \ |
| 100 | ${prefix}/src/debug/${PN}/${PV}-${PR}/git/src/include/trousers \ |
| 101 | " |
| 102 | FILES_${PN}-doc = " \ |
| 103 | ${mandir}/man5 \ |
| 104 | ${mandir}/man8 \ |
| 105 | " |
| 106 | |
| 107 | INITSCRIPT_NAME = "trousers" |
| 108 | INITSCRIPT_PARAMS = "start 99 2 3 4 5 . stop 19 0 1 6 ." |
| 109 | |
| 110 | USERADD_PACKAGES = "${PN}" |
| 111 | GROUPADD_PARAM_${PN} = "--system tss" |
| 112 | USERADD_PARAM_${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss" |
| 113 | |
| 114 | SYSTEMD_PACKAGES = "${PN}" |
| 115 | SYSTEMD_SERVICE_${PN} = "tcsd.service" |
| 116 | SYSTEMD_AUTO_ENABLE = "disable" |
| 117 | |
| 118 | BBCLASSEXTEND = "native" |