blob: a746103de8035afa7505e07c8e1c34af1f56d3c8 [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 Geissler9d3cc052021-03-31 13:36:22 -05009SRCREV = "94144b0a1dcef6e31845d6c319e9bd7357208eb9"
10PV = "0.3.15+git${SRCPV}"
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053011
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
Patrick Williams213cb262021-08-07 19:21:33 -050033do_install:append() {
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053034 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
Patrick Williams213cb262021-08-07 19:21:33 -050046CONFFILES:${PN} += "${sysconfig}/tcsd.conf"
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053047
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.
Patrick Williams213cb262021-08-07 19:21:33 -050062RRECOMMENDS:libtspi = "${PN}"
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053063
Patrick Williams213cb262021-08-07 19:21:33 -050064FILES:libtspi = " \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053065 ${libdir}/*.so.1 \
66 ${libdir}/*.so.1.2.0 \
67 "
Patrick Williams213cb262021-08-07 19:21:33 -050068FILES:libtspi-dbg = " \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053069 ${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 "
Patrick Williams213cb262021-08-07 19:21:33 -050075FILES:libtspi-dev = " \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053076 ${includedir} \
77 ${libdir}/*.so \
78 "
Patrick Williams213cb262021-08-07 19:21:33 -050079FILES:libtspi-doc = " \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053080 ${mandir}/man3 \
81 "
Patrick Williams213cb262021-08-07 19:21:33 -050082FILES:libtspi-staticdev = " \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053083 ${libdir}/*.la \
84 ${libdir}/*.a \
85 "
Patrick Williams213cb262021-08-07 19:21:33 -050086FILES:${PN} = " \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053087 ${sbindir}/tcsd \
88 ${sysconfdir} \
89 ${localstatedir} \
90 "
91
Patrick Williams213cb262021-08-07 19:21:33 -050092FILES:${PN}-dev += "${libdir}/trousers"
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053093
Patrick Williams213cb262021-08-07 19:21:33 -050094FILES:${PN}-dbg = " \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053095 ${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 "
Patrick Williams213cb262021-08-07 19:21:33 -0500102FILES:${PN}-doc = " \
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +0530103 ${mandir}/man5 \
104 ${mandir}/man8 \
105 "
106
Patrick Williams213cb262021-08-07 19:21:33 -0500107FILES:${PN} += "${systemd_unitdir}/*"
Andrew Geisslercc589282020-09-18 13:34:40 -0500108
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}"
Patrick Williams213cb262021-08-07 19:21:33 -0500113GROUPADD_PARAM:${PN} = "--system tss"
114USERADD_PARAM:${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss"
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +0530115
116SYSTEMD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -0500117SYSTEMD_SERVICE:${PN} = "tcsd.service"
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +0530118SYSTEMD_AUTO_ENABLE = "disable"
119
120BBCLASSEXTEND = "native"