-
Notifications
You must be signed in to change notification settings - Fork 1
/
nova-dns.spec
93 lines (73 loc) · 2.1 KB
/
nova-dns.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
87
88
89
90
91
92
93
%global with_doc 0
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
%define mod_name nova_dns
Name: nova-dns
Version: 0.3.0
Release: 1
Summary: REST API for DNS configuration and service to add records for fixed ips
License: GNU LGPL v2.1
Vendor: Grid Dynamics International, Inc.
URL: http://www.griddynamics.com/openstack
Group: Development/Languages/Python
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel python-setuptools make
BuildArch: noarch
Requires: python-nova
Requires: python-keystoneclient
Requires: start-stop-daemon
%description
This package contains the service to add dns records for instances and
REST API to control DNS
%if 0%{?with_doc}
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildRequires: python-sphinx make
%description doc
Documentation and examples for %{name}.
%endif
%prep
%setup -q -n %{name}-%{version}
%build
%{__python} setup.py build
%install
%__rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot}
%if 0%{?with_doc}
export PYTHONPATH=%{buildroot}%{python_sitelib}
make -C doc html
%endif
install -p -D -m 755 redhat/nova-dns.init %{buildroot}%{_initrddir}/%{name}
mkdir -p %{buildroot}/etc
cp -a etc/nova-dns %{buildroot}/etc
%clean
%__rm -rf %{buildroot}
%post
/sbin/chkconfig --add %{name}
%preun
if [ $1 -eq 0 ] ; then
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
%postun
if [ $1 -eq 1 ] ; then
/sbin/service %{name} condrestart
fi
%files
%defattr(-,root,root,-)
%doc README
%doc Changelog
%{_initrddir}/*
%{python_sitelib}/%{mod_name}*
%{_usr}/bin/*
%config(noreplace) /etc/nova-dns
%if 0%{?with_doc}
%files doc
%defattr(-,root,root,-)
%doc doc/build/html
%endif
%changelog