blob: 27b4e2f517aab08079f1974cb6cd733c81525889 [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
Andrew Geisslercc589282020-09-18 13:34:40 -05009SRCREV = "e74dd1d96753b0538192143adf58d04fcd3b242b"
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053010PV = "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 \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053019 "
20
21S = "${WORKDIR}/git"
22
23inherit autotools pkgconfig useradd update-rc.d ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
24
25PACKAGECONFIG ?= "gmp "
26PACKAGECONFIG[gmp] = "--with-gmp, --with-gmp=no, gmp"
27PACKAGECONFIG[gtk] = "--with-gui=gtk, --with-gui=none, gtk+"
28
29do_install () {
30 oe_runmake DESTDIR=${D} install
31}
32
33do_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
46CONFFILES_${PN} += "${sysconfig}/tcsd.conf"
47
48PROVIDES = "${PACKAGES}"
49PACKAGES = " \
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.
62RRECOMMENDS_libtspi = "${PN}"
63
64FILES_libtspi = " \
65 ${libdir}/*.so.1 \
66 ${libdir}/*.so.1.2.0 \
67 "
68FILES_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 "
75FILES_libtspi-dev = " \
76 ${includedir} \
77 ${libdir}/*.so \
78 "
79FILES_libtspi-doc = " \
80 ${mandir}/man3 \
81 "
82FILES_libtspi-staticdev = " \
83 ${libdir}/*.la \
84 ${libdir}/*.a \
85 "
86FILES_${PN} = " \
87 ${sbindir}/tcsd \
88 ${sysconfdir} \
89 ${localstatedir} \
90 "
91
92FILES_${PN}-dev += "${libdir}/trousers"
93
94FILES_${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 "
102FILES_${PN}-doc = " \
103 ${mandir}/man5 \
104 ${mandir}/man8 \
105 "
106
Andrew Geisslercc589282020-09-18 13:34:40 -0500107FILES_${PN} += "${systemd_unitdir}/*"
108
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +0530109INITSCRIPT_NAME = "trousers"
110INITSCRIPT_PARAMS = "start 99 2 3 4 5 . stop 19 0 1 6 ."
111
112USERADD_PACKAGES = "${PN}"
113GROUPADD_PARAM_${PN} = "--system tss"
114USERADD_PARAM_${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss"
115
116SYSTEMD_PACKAGES = "${PN}"
117SYSTEMD_SERVICE_${PN} = "tcsd.service"
118SYSTEMD_AUTO_ENABLE = "disable"
119
120BBCLASSEXTEND = "native"