1 %global optflags %{optflags} -Wno-parentheses
5 Summary: Moonshot Trust Router
7 Group: System Environment/Libraries
9 URL: http://www.project-moonshot.org/
10 Source0: %{name}-%{version}.tar.gz
11 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
13 BuildRequires: krb5-devel, glib2-devel
14 BuildRequires: jansson-devel >= 2.4
15 BuildRequires: sqlite-devel, openssl-devel, libtalloc-devel, libevent-devel
16 %{?el7:BuildRequires: systemd}
17 Requires: moonshot-gss-eap >= 0.9.3, sqlite
20 The trust router provides a mechanism for discovering the topology of
21 trust graphs in a topology and establishing temporary identities
26 Summary: Development files for %{name}
27 Group: Development/Libraries
28 Requires: %{name}-libs = %{version}-%{release}
31 The %{name}-devel package contains libraries and header files for
32 developing applications that use %{name}-libs.
35 Summary: Libraries needed by %{Name}
38 This package includes libraries needed by the %{Name} package or
39 packages that wish trust_router functionality.
49 %configure --disable-static
54 rm -rf $RPM_BUILD_ROOT
55 make install DESTDIR=$RPM_BUILD_ROOT
56 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
58 # Install config files
59 install -D -m 755 redhat/init $RPM_BUILD_ROOT/%{_initrddir}/trust_router
60 install -D -m 640 redhat/organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/organizations.cfg
61 install -D -m 640 redhat/default-internal.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/internal.cfg
62 install -D -m 640 redhat/tr-test-internal.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/internal.cfg
63 install -D -m 640 redhat/sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/trust_router
64 install -D -m 640 redhat/sysconfig.tids $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/tids
65 install -D -m 755 redhat/tids.init $RPM_BUILD_ROOT/%{_initrddir}/tids
68 ln -s ../../organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/organizations.cfg
69 ln -s ../../organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/organizations.cfg
71 # Install wrapper scripts
72 install -D -m 755 redhat/tidc-wrapper $RPM_BUILD_ROOT/%{_bindir}/tidc-wrapper
73 install -D -m 755 redhat/tids-wrapper $RPM_BUILD_ROOT/%{_bindir}/tids-wrapper
74 install -D -m 755 redhat/trust_router-wrapper $RPM_BUILD_ROOT/%{_bindir}/trust_router-wrapper
76 # As we're building an RPM, we don't need the init scripts etc. in /usr/share
77 rm -rf $RPM_BUILD_ROOT/%{_datadir}/trust_router/redhat
81 rm -rf $RPM_BUILD_ROOT
85 getent group trustrouter > /dev/null || groupadd -r trustrouter
86 getent passwd trustrouter > /dev/null || useradd -r -g trustrouter -d /var/lib/trust_router -s /sbin/nologin -c "GSS-EAP Trust Router service account" trustrouter
90 %post libs -p /sbin/ldconfig
92 %postun libs -p /sbin/ldconfig
96 tr_home=/var/lib/trust_router
97 tr_schema=${tr_home}/.schema_1.5.2
98 test -d ${tr_home} ||mkdir ${tr_home}
99 chown trustrouter:trustrouter ${tr_home}
100 test -e $tr_schema || rm -f $tr_home/keys
101 sqlite3 </usr/share/trust_router/schema.sql ${tr_home}/keys
103 chown trustrouter:trustrouter ${tr_home}/keys
104 chmod 660 ${tr_home}/keys
107 test -d /var/log/trust_router ||mkdir /var/log/trust_router
108 chown root:trustrouter /var/log/trust_router
109 chmod 770 /var/log/trust_router
114 %defattr(-,root,root,-)
117 #%{_bindir}/tidc-wrapper
119 #%{_bindir}/tids-wrapper
120 #%{_bindir}/trust_router
121 #%{_bindir}/trust_router-wrapper
123 %{_datadir}/trust_router/schema.sql
126 %{_initrddir}/trust_router
128 %{?el7:%{_unitdir}/tids.service}
130 %config(noreplace) %{_sysconfdir}/sysconfig/tids
131 %config(noreplace) %{_sysconfdir}/sysconfig/trust_router
133 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router
134 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/
135 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/default
136 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/tr-test
138 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/organizations.cfg
139 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/internal.cfg
140 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/internal.cfg
141 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/organizations.cfg
142 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/organizations.cfg
145 %defattr(-,root,root,-)
149 %defattr(-,root,root,-)