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