forked from Cloudxtreme/cloudrouter-component-python-exabgp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpython-exabgp.spec
86 lines (66 loc) · 2.52 KB
/
python-exabgp.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
Name: python-exabgp
Version: 3.4.17
Release: 1%{?dist}
Summary: The BGP swiss army knife of networking (Library)
Group: Development/Libraries
License: BSD
URL: http://pypi.python.org/pypi/exabgp/
Source0: https://github.com/Exa-Networks/exabgp/archive/%{version}/exabgp-%{version}.tar.gz
BuildArch: noarch
Provides: exabgp-libs
BuildRequires: python-setuptools
Requires: python2 >= 2.6, python-ipaddr
%description
ExaBGP python module
%package -n exabgp
Summary: The BGP swiss army knife of networking
Group: Applications/Internet
BuildRequires: systemd-units
Requires: systemd, exabgp-libs == %{version}
%description -n exabgp
ExaBGP allows engineers to control their network from commodity servers. Think
of it as Software Defined Networking using BGP by transforming BGP messages
into friendly plain text or JSON. Current documented use cases include DDOS
mitigation, network visualisation, anycast, service high availability.
%prep
%setup -q -n exabgp-%{version}
%build
%{__python2} setup.py build
%install
%{__python2} setup.py install -O1 --root ${RPM_BUILD_ROOT}
# fix file locations
mv ${RPM_BUILD_ROOT}%{_bindir} ${RPM_BUILD_ROOT}%{_sbindir}
install -d -m 744 ${RPM_BUILD_ROOT}/%{_sysconfdir}/
mv ${RPM_BUILD_ROOT}/usr/etc/exabgp ${RPM_BUILD_ROOT}/%{_sysconfdir}/
install -d %{buildroot}/%{_unitdir}
install etc/systemd/exabgp.service %{buildroot}/%{_unitdir}/
install -d %{buildroot}/%{_mandir}/man1
install doc/man/exabgp.1 %{buildroot}/%{_mandir}/man1
install -d %{buildroot}/%{_mandir}/man5
install doc/man/exabgp.conf.5 %{buildroot}/%{_mandir}/man5
%post -n exabgp
%systemd_post exabgp.service
%preun -n exabgp
%systemd_preun exabgp.service
%postun -n exabgp
%systemd_postun_with_restart exabgp.service
%files
%defattr(-,root,root,-)
%{python2_sitelib}/*
%doc COPYRIGHT CHANGELOG README.md
%files -n exabgp
%defattr(-,root,root,-)
%attr(755, root, root) %{_sbindir}/exabgp
%dir %{_sysconfdir}/exabgp
%attr(744, root, root) %{_sysconfdir}/exabgp/*
%{_unitdir}/exabgp.service
%doc COPYRIGHT CHANGELOG README.md
%{_mandir}/man1/*
%{_mandir}/man5/*
%changelog
* Mon Oct 17 2016 John Siegrist <[email protected]> - 3.4.17-1
- Update to version 3.4.17
* Tue Jun 09 2015 Arun Babu Neelicattu <[email protected]> - 3.4.11-1
- Initial release