]> git.pld-linux.org Git - packages/fedmsg.git/blob - fedmsg.spec
e132ddad7fae615b6345adcb76eee82107ae1be3
[packages/fedmsg.git] / fedmsg.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build with tests
4
5 Summary:        Tools for Fedora Infrastructure real-time messaging
6 Name:           fedmsg
7 Version:        0.11.1
8 Release:        0.4
9 License:        LGPL v2+
10 Group:          Applications/Networking
11 Source0:        http://pypi.python.org/packages/source/f/fedmsg/%{name}-%{version}.tar.gz
12 # Source0-md5:  3074d89b779929b338ac609081e10340
13 Source1:        %{name}-tmpfiles.conf
14 Patch0:         %{name}-kojitests.patch
15 Patch1:         config.patch
16 URL:            http://github.com/ralphbean/fedmsg
17 BuildRequires:  python-devel
18 BuildRequires:  python-setuptools
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.219
21 %if %{with tests}
22 BuildRequires:  python-mock
23 BuildRequires:  python-nose
24 BuildRequires:  python-six
25 # Only for the test-replay test which is patched out
26 BuildRequires:  python-M2Crypto
27 BuildRequires:  python-arrow
28 BuildRequires:  python-bunch
29 BuildRequires:  python-daemon
30 BuildRequires:  python-fabulous
31 BuildRequires:  python-fedora
32 BuildRequires:  python-m2ext
33 BuildRequires:  python-moksha-hub >= 1.3.2
34 BuildRequires:  python-psutil
35 BuildRequires:  python-pygments
36 BuildRequires:  python-requests
37 #BuidlRequires:  python-sqlalchemy
38 %endif
39 Requires:       python-M2Crypto
40 Requires:       python-arrow
41 #Requires:      python-daemon
42 #Requires:      python-fabulous
43 #Requires:      python-fedora
44 Requires:       python-kitchen
45 Requires:       python-m2ext
46 Requires:       python-moksha-hub >= 1.3.2
47 Requires:       python-psutil
48 Requires:       python-pygments
49 Requires:       python-requests
50 #Requires:      python-simplejson
51 Requires:       python-six
52 Requires:       python-zmq
53 BuildArch:      noarch
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %description
57 Python API used around Fedora Infrastructure to send and receive
58 messages with zeromq. Includes some CLI tools.
59
60 %package announce
61 Summary:        The fedmsg-announce command
62 Group:          Applications/Networking
63 Requires:       %{name} = %{version}-%{release}
64
65 %description announce
66 This package contains the fedmsg-announce command for sending
67 announcements.
68
69 %package collectd
70 Summary:        A fedmsg plugin for collectd
71 Group:          Applications/Networking
72 Requires:       %{name} = %{version}-%{release}
73
74 %description collectd
75 This package contains the fedmsg-collectd command which produces
76 output suitable for consumption by a collectd plugin.
77
78 %package hub
79 Summary:        The FedMsg Hub
80 Group:          Applications/Networking
81 Requires:       %{name} = %{version}-%{release}
82
83 %description hub
84 This package contains configuration and init scripts for the FedMsg
85 hub.
86
87 %package relay
88 Summary:        The FedMsg Relay
89 Group:          Applications/Networking
90 Requires:       %{name} = %{version}-%{release}
91
92 %description relay
93 This package contains configuration and init scripts for the FedMsg
94 relay.
95
96 %package irc
97 Summary:        The FedMsg IRC Bot
98 Group:          Applications/Networking
99 Requires:       %{name} = %{version}-%{release}
100
101 %description irc
102 This package contains configuration and init scripts for the FedMsg
103 IRC bot.
104
105 %package gateway
106 Summary:        The FedMsg Gateway daemon
107 Group:          Applications/Networking
108 Requires:       %{name} = %{version}-%{release}
109
110 %description gateway
111 This package contains configuration and init scripts for the FedMsg
112 Gateway. It will rebroadcast messages from the bus to a specially
113 designated ZMQ pub socket. Useful for repeating messages outside a
114 firewall.
115
116 %prep
117 %setup -q
118 %patch0 -p1
119 %patch1 -p1
120
121 # This only got shipped with fedmsg-0.6.3
122 rm -f fedmsg.d/_tweet-real.py
123
124 # These are failing in mock for fedora.  Investigate why.
125 # We probably just need a new BuildReq
126 rm -f fedmsg/tests/test_replay.py
127 rm -f fedmsg/tests/test_crypto_gpg.py
128
129 # Also, sqlalchemy is required for those tests we're knocking out,
130 # so knock it out too.
131 sed -i "/'sqlalchemy.*$/d" setup.py
132
133 # Temporarily disable signature validation while the timestamp precision bug is
134 # worked out upstream. -- https://github.com/fedora-infra/fedmsg/pull/186
135 sed -i "s/validate_signatures=True/validate_signatures=False/g" fedmsg.d/ssl.py
136
137 # Copy the development config into the tests dir for the check section
138 cp -rf fedmsg.d fedmsg/tests/
139
140 %build
141 %{__python} setup.py build
142
143 # Create this temporary symlink that's only needed for the test suite.
144 ln -s fedmsg/tests/test_certs dev_certs
145
146 # Unfortunately, neither of these tests will run on koji since they require
147 # some network connectivity.  With a note of sadness, we destroy them.
148 rm fedmsg/tests/test_hub.py
149 rm fedmsg/tests/test_threads.py
150
151 %if %{with tests}
152 %check
153 %if 0%{?rhel} && 0%{?rhel} <= 6
154 # Check section removed until a RHEL6 bug with python-repoze-what-plugins-sql
155 # can be fixed.  It causes a fatal error in the test suite.
156 # https://bugzilla.redhat.com/show_bug.cgi?id=813925
157 %else
158 PYTHONPATH=$(pwd) python setup.py test
159 %endif
160 %endif
161
162 %install
163 rm -rf $RPM_BUILD_ROOT
164 %{__python} setup.py install \
165         --skip-build \
166         --optimize=2 \
167     --install-data=%{_datadir} \
168         --root $RPM_BUILD_ROOT
169
170 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/fedmsg/tests
171
172 %py_postclean
173
174 install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}/fedmsg.d,%{systemdtmpfilesdir},%{systemdunitdir},/var/{run,log}/fedmsg}
175 cp -p fedmsg.d/*.py $RPM_BUILD_ROOT%{_sysconfdir}/fedmsg.d
176
177 cp -p initsys/sysv/fedmsg-hub.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-hub
178 cp -p initsys/sysv/fedmsg-relay.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-relay
179 cp -p initsys/sysv/fedmsg-irc.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-irc
180 cp -p initsys/sysv/fedmsg-gateway.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-gateway
181
182 cp -p initsys/systemd/fedmsg-hub.service $RPM_BUILD_ROOT%{systemdunitdir}
183 cp -p initsys/systemd/fedmsg-relay.service $RPM_BUILD_ROOT%{systemdunitdir}
184 cp -p initsys/systemd/fedmsg-irc.service $RPM_BUILD_ROOT%{systemdunitdir}
185 cp -p initsys/systemd/fedmsg-gateway.service $RPM_BUILD_ROOT%{systemdunitdir}
186
187 # Logrotate configuration
188 cp -p logrotate $RPM_BUILD_ROOT/etc/logrotate.d/fedmsg
189
190 # tmpfiles.d
191 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
192
193 %clean
194 rm -rf $RPM_BUILD_ROOT
195
196 %pre
197 %groupadd -g 313 -r fedmsg
198 %useradd -u 313  -r -s /sbin/nologin -d %{_datadir}/%{name} -M -c 'FedMsg' -g fedmsg fedmsg
199
200 %preun hub
201 if [ $1 -eq 0 ]; then
202         %service fedmsg-hub stop
203         /sbin/chkconfig --del fedmsg-hub
204 fi
205
206 %preun relay
207 if [ $1 -eq 0 ]; then
208         %service fedmsg-relay stop
209         /sbin/chkconfig --del fedmsg-relay
210 fi
211
212 %preun irc
213 if [ $1 -eq 0 ]; then
214         %service fedmsg-irc stop
215         /sbin/chkconfig --del fedmsg-irc
216 fi
217
218 %preun gateway
219 if [ $1 -eq 0 ]; then
220         %service fedmsg-gateway stop
221         /sbin/chkconfig --del fedmsg-gateway
222 fi
223
224 %files
225 %defattr(644,root,root,755)
226 %doc doc/* README.rst LICENSE
227 %dir %{_sysconfdir}/fedmsg.d
228 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/base.py*
229 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/endpoints.py*
230 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/logging.py*
231 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/ssl.py*
232 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fedmsg
233 %attr(755,root,root) %{_bindir}/fedmsg-logger
234 %attr(755,root,root) %{_bindir}/fedmsg-tail
235 %attr(755,root,root) %{_bindir}/fedmsg-trigger
236 %attr(755,root,root) %{_bindir}/fedmsg-config
237 %attr(755,root,root) %{_bindir}/fedmsg-dg-replay
238 %attr(755,fedmsg,fedmsg) %dir /var/log/fedmsg
239 %attr(775,fedmsg,fedmsg) %dir /var/run/fedmsg
240 %dir %{py_sitescriptdir}/fedmsg
241 %{py_sitescriptdir}/fedmsg/*.py[co]
242 %{py_sitescriptdir}/fedmsg/commands
243 %{py_sitescriptdir}/fedmsg/consumers
244 %{py_sitescriptdir}/fedmsg/crypto
245 %{py_sitescriptdir}/fedmsg/encoding
246 %{py_sitescriptdir}/fedmsg/meta
247 %{py_sitescriptdir}/fedmsg/replay
248 %{py_sitescriptdir}/fedmsg/text
249 %{py_sitescriptdir}/fedmsg-%{version}-py*.egg-info
250 %{systemdtmpfilesdir}/%{name}.conf
251
252 %files announce
253 %defattr(644,root,root,755)
254 %attr(755,root,root) %{_bindir}/fedmsg-announce
255
256 %files collectd
257 %defattr(644,root,root,755)
258 %attr(755,root,root) %{_bindir}/fedmsg-collectd
259
260 %files hub
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_bindir}/fedmsg-hub
263 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-hub
264 %{systemdunitdir}/fedmsg-hub.service
265
266 %files relay
267 %defattr(644,root,root,755)
268 %attr(755,root,root) %{_bindir}/fedmsg-relay
269 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-relay
270 %{systemdunitdir}/fedmsg-relay.service
271 %config(noreplace) %{_sysconfdir}/fedmsg.d/relay.py*
272
273 %files irc
274 %defattr(644,root,root,755)
275 %attr(755,root,root) %{_bindir}/fedmsg-irc
276 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-irc
277 %{systemdunitdir}/fedmsg-irc.service
278
279 %config(noreplace) %{_sysconfdir}/fedmsg.d/ircbot.py*
280
281 %files gateway
282 %defattr(644,root,root,755)
283 %attr(755,root,root) %{_bindir}/fedmsg-gateway
284 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-gateway
285 %{systemdunitdir}/fedmsg-gateway.service
286 %config(noreplace) %{_sysconfdir}/fedmsg.d/gateway.py*
This page took 0.072116 seconds and 2 git commands to generate.