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