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 , glib-devel
14 BuildRequires: jansson-devel >= 2.4
15 BuildRequires: sqlite-devel, openssl-devel, libtalloc-devel
16 Requires: moonshot-gss-eap >= 0.9.3, sqlite
19 The trust router provides a mechanism for discovering the topology of
20 trust graphs in a topology and establishing temporary identities
25 Summary: Development files for %{name}
26 Group: Development/Libraries
27 Requires: %{name}-libs = %{version}-%{release}
30 The %{name}-devel package contains libraries and header files for
31 developing applications that use %{name}-libs.
34 Summary: Libraries needed by %{Name}
37 This package includes libraries needed by the %{Name} package or
38 packages that wish trust_router functionality.
48 %configure --disable-static
53 rm -rf $RPM_BUILD_ROOT
54 make install DESTDIR=$RPM_BUILD_ROOT
55 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
57 # Install config files
58 install -D -m 755 redhat/init $RPM_BUILD_ROOT/%{_initrddir}/trust_router
59 install -D -m 640 redhat/trusts.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/trusts.cfg
60 install -D -m 640 redhat/default-main.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/main.cfg
61 install -D -m 640 redhat/tr-test-main.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/main.cfg
62 install -D -m 640 redhat/sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/trust_router
63 install -D -m 640 redhat/sysconfig.tids $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/tids
64 install -D -m 755 redhat/tids.init $RPM_BUILD_ROOT/%{_initrddir}/tids
67 ln -s ../../trusts.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/trusts.cfg
68 ln -s ../../trusts.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/trusts.cfg
70 # Install wrapper scripts
71 install -D -m 755 redhat/tidc-wrapper $RPM_BUILD_ROOT/%{_bindir}/tidc-wrapper
72 install -D -m 755 redhat/tids-wrapper $RPM_BUILD_ROOT/%{_bindir}/tids-wrapper
73 install -D -m 755 redhat/trust_router-wrapper $RPM_BUILD_ROOT/%{_bindir}/trust_router-wrapper
75 # As we're building an RPM, we don't need the init scripts etc. in /usr/share
76 rm -rf $RPM_BUILD_ROOT/%{_datadir}/trust_router/redhat
80 rm -rf $RPM_BUILD_ROOT
84 getent group trustrouter > /dev/null || groupadd -r trustrouter
85 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
89 %post libs -p /sbin/ldconfig
91 %postun libs -p /sbin/ldconfig
95 tr_home=/var/lib/trust_router
96 tr_schema=${tr_home}/.schema_1.5.1
97 test -d ${tr_home} ||mkdir ${tr_home}
98 chown trustrouter:trustrouter ${tr_home}
99 test -e $tr_schema || rm -f $tr_home/keys
100 sqlite3 </usr/share/trust_router/schema.sql ${tr_home}/keys
102 chown trustrouter:trustrouter ${tr_home}/keys
103 chmod 660 ${tr_home}/keys
106 test -d /var/log/trust_router ||mkdir /var/log/trust_router
107 chown root:trustrouter /var/log/trust_router
108 chmod 770 /var/log/trust_router
113 %defattr(-,root,root,-)
116 %{_datadir}/trust_router/schema.sql
117 #/lib/systemd/system/tids.service
120 %{_initrddir}/trust_router
122 %config(noreplace) %{_sysconfdir}/sysconfig/tids
123 %config(noreplace) %{_sysconfdir}/sysconfig/trust_router
125 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router
126 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/
127 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/default
128 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/tr-test
130 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/trusts.cfg
131 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/main.cfg
132 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/main.cfg
133 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/trusts.cfg
134 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/trusts.cfg
137 %defattr(-,root,root,-)
141 %defattr(-,root,root,-)