Use json_is_true() in place of json_boolean_value() for compatibility
[trust_router.git] / trust_router.spec
1 %global optflags %{optflags} -Wno-parentheses
2 %{!?_release_number: %define _release_number 2}
3 Name:           trust_router
4 Version:        3.4.0
5 Release:        %{_release_number}%{?dist}
6 Summary:        Moonshot Trust Router
7
8 Group:          System Environment/Libraries
9 License:        BSD
10 URL:            http://www.project-moonshot.org/
11 Source0:        %{name}-%{version}.tar.gz
12 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
13
14 BuildRequires: autoconf, automake, m4, libtool
15 BuildRequires:  krb5-devel, glib2-devel
16 BuildRequires: jansson-devel >= 2.4
17 BuildRequires: sqlite-devel, openssl-devel, libtalloc-devel, libevent-devel
18 %{?el7:BuildRequires: systemd}
19 Requires:       moonshot-gss-eap >= 0.9.3, sqlite
20
21 %description
22 The trust router provides a mechanism for discovering the topology of
23 trust graphs in a topology and establishing temporary identities
24 between them.
25
26
27 %package        devel
28 Summary:        Development files for %{name}
29 Group:          Development/Libraries
30 Requires:       %{name}-libs = %{version}-%{release}
31
32 %description    devel
33 The %{name}-devel package contains libraries and header files for
34 developing applications that use %{name}-libs.
35
36 %package libs
37 Summary: Libraries needed by %{Name}
38
39 %description libs
40 This package includes libraries needed by the %{Name} package or
41 packages that wish trust_router functionality.
42
43
44
45
46 %prep
47 %setup -q
48 autoreconf -f -i
49
50 %build
51 %configure --disable-static
52 make %{?_smp_mflags}
53
54
55 %install
56 rm -rf $RPM_BUILD_ROOT
57 make install DESTDIR=$RPM_BUILD_ROOT
58 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
59
60 # Install config files
61 install -D -m 755 redhat/init $RPM_BUILD_ROOT/%{_initrddir}/trust_router
62 install -D -m 640 redhat/organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/organizations.cfg
63 install -D -m 640 redhat/default-internal.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/internal.cfg
64 install -D -m 640 redhat/tr-test-internal.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/internal.cfg
65 install -D -m 640 redhat/sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/trust_router
66 install -D -m 640 redhat/sysconfig.tids $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/tids
67 install -D -m 755 redhat/tids.init $RPM_BUILD_ROOT/%{_initrddir}/tids
68
69 # Link shared config
70 ln -s ../../organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/organizations.cfg
71 ln -s ../../organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/organizations.cfg
72
73 # Install wrapper scripts
74 install -D -m 755 redhat/tidc-wrapper $RPM_BUILD_ROOT/%{_bindir}/tidc-wrapper
75 install -D -m 755 redhat/tids-wrapper $RPM_BUILD_ROOT/%{_bindir}/tids-wrapper
76 install -D -m 755 redhat/trust_router-wrapper $RPM_BUILD_ROOT/%{_bindir}/trust_router-wrapper
77
78 # As we're building an RPM, we don't need the init scripts etc. in /usr/share
79 rm -rf $RPM_BUILD_ROOT/%{_datadir}/trust_router/redhat
80
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85
86 %pre
87 getent group trustrouter > /dev/null || groupadd -r trustrouter
88 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 exit 0
90
91
92 %post libs -p /sbin/ldconfig
93
94 %postun libs -p /sbin/ldconfig
95
96 %post
97 # Data directory
98 tr_home=/var/lib/trust_router
99 tr_schema=${tr_home}/.schema_1.5.2
100 test -d ${tr_home} ||mkdir ${tr_home}
101 chown trustrouter:trustrouter ${tr_home}
102 test -e $tr_schema || rm -f $tr_home/keys
103 sqlite3 </usr/share/trust_router/schema.sql ${tr_home}/keys
104 touch $tr_schema
105 chown trustrouter:trustrouter ${tr_home}/keys
106 chmod 660 ${tr_home}/keys
107
108 # Log Directory
109 test -d /var/log/trust_router ||mkdir /var/log/trust_router
110 chown root:trustrouter /var/log/trust_router
111 chmod 770 /var/log/trust_router
112
113
114
115 %files
116 %defattr(-,root,root,-)
117 %doc README
118 #%{_bindir}/tidc
119 #%{_bindir}/tidc-wrapper
120 #%{_bindir}/tids
121 #%{_bindir}/tids-wrapper
122 #%{_bindir}/trmon
123 #%{_bindir}/trust_router
124 #%{_bindir}/trust_router-wrapper
125 %{_bindir}/*
126 %{_datadir}/trust_router/schema.sql
127
128 %{_initrddir}/tids
129 %{_initrddir}/trust_router
130
131 %{?el7:%{_unitdir}/tids.service}
132
133 %config(noreplace) %{_sysconfdir}/sysconfig/tids
134 %config(noreplace) %{_sysconfdir}/sysconfig/trust_router
135
136 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router
137 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/
138 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/default
139 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/tr-test
140
141 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/organizations.cfg
142 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/internal.cfg
143 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/internal.cfg
144 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/organizations.cfg
145 %attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/organizations.cfg
146
147 %files libs
148 %defattr(-,root,root,-)
149 %{_libdir}/*.so.*
150
151 %files devel
152 %defattr(-,root,root,-)
153 %{_includedir}/*
154 %{_libdir}/*.so