%global optflags %{optflags} -Wno-parentheses
Name: trust_router
-Version: 1.5
+Version: 2.0.0
Release: 1%{?dist}
Summary: Moonshot Trust Router
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: krb5-devel , glib-devel
+BuildRequires: krb5-devel, glib2-devel
BuildRequires: jansson-devel >= 2.4
-BuildRequires: sqlite-devel, openssl-devel, libtalloc-devel
-Requires: moonshot-gss-eap, sqlite
+BuildRequires: sqlite-devel, openssl-devel, libtalloc-devel, libevent-devel
+%{?el7:BuildRequires: systemd}
+Requires: moonshot-gss-eap >= 0.9.3, sqlite
%description
The trust router provides a mechanism for discovering the topology of
%prep
%setup -q
-
+autoreconf -f -i
%build
%configure --disable-static
%post
# Data directory
-test -d /var/lib/trust_router ||mkdir /var/lib/trust_router
-chown trustrouter:trustrouter /var/lib/trust_router
-sqlite3 </usr/share/trust_router/schema.sql /var/lib/trust_router/keys
-chown trustrouter:trustrouter /var/lib/trust_router/keys
-chmod 660 /var/lib/trust_router/keys
+tr_home=/var/lib/trust_router
+tr_schema=${tr_home}/.schema_1.5.2
+test -d ${tr_home} ||mkdir ${tr_home}
+chown trustrouter:trustrouter ${tr_home}
+test -e $tr_schema || rm -f $tr_home/keys
+sqlite3 </usr/share/trust_router/schema.sql ${tr_home}/keys
+touch $tr_schema
+chown trustrouter:trustrouter ${tr_home}/keys
+chmod 660 ${tr_home}/keys
# Log Directory
test -d /var/log/trust_router ||mkdir /var/log/trust_router
%files
%defattr(-,root,root,-)
%doc README
+#%{_bindir}/tidc
+#%{_bindir}/tidc-wrapper
+#%{_bindir}/tids
+#%{_bindir}/tids-wrapper
+#%{_bindir}/trust_router
+#%{_bindir}/trust_router-wrapper
%{_bindir}/*
%{_datadir}/trust_router/schema.sql
-#/lib/systemd/system/tids.service
%{_initrddir}/tids
%{_initrddir}/trust_router
+%{?el7:%{_unitdir}/tids.service}
+
%config(noreplace) %{_sysconfdir}/sysconfig/tids
%config(noreplace) %{_sysconfdir}/sysconfig/trust_router