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