-
Notifications
You must be signed in to change notification settings - Fork 0
/
lrbd.spec
156 lines (134 loc) · 5.52 KB
/
lrbd.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#
# spec file for package lrbd
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
Summary: lrbd
Name: lrbd
Version: 1.1
Release: 0
License: LGPL-2.1+
Group: System Environment/Base
Distribution: SUSE
URL: http://bugs.opensuse.org
Source0: lrbd-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-root
BuildArch: noarch
Requires: python-netifaces
Requires: python-rados
Requires: python-rbd
Requires: ceph-common
Requires: targetcli-rbd
Summary: Configures iSCSI access to Ceph rbd images
%description
This utility creates, modifies and retrieves a centralized, configuration from
Ceph for configuring iSCSI access on a host.
%prep
%build
%__tar xvzf %{SOURCE0}
%__rm -f lrbd/man/*.gz
%__gzip lrbd/man/lrbd.*
%install
%define _samples %{buildroot}%{_docdir}/%{name}/samples
mkdir -p %{buildroot}/var/adm/fillup-templates
mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_docdir}/%{name}/samples
mkdir -p %{buildroot}%{_mandir}/man5
mkdir -p %{buildroot}%{_mandir}/man8
mkdir -p %{buildroot}%{_sbindir}
cd lrbd
install -m 555 lrbd %{buildroot}%{_sbindir}
install -m 644 man/lrbd.conf.5.gz %{buildroot}%{_mandir}/man5
install -m 644 man/lrbd.8.gz %{buildroot}%{_mandir}/man8
install -m 644 sysconfig/lrbd %{buildroot}/var/adm/fillup-templates/sysconfig.lrbd
install -m 644 systemd/lrbd.service %{buildroot}%{_unitdir}
ln -sf %{_sbindir}/service %{buildroot}%_sbindir/rclrbd
install -m 644 README.migration %{buildroot}%{_docdir}/%{name}
install -m 644 samples/acls+discovery.json %{_samples}
install -m 644 samples/acls+discovery+mutual.json %{_samples}
install -m 644 samples/acls.json %{_samples}
install -m 644 samples/acls+mutual+discovery.json %{_samples}
install -m 644 samples/acls+mutual+discovery+mutual.json %{_samples}
install -m 644 samples/acls+mutual.json %{_samples}
install -m 644 samples/complete.json %{_samples}
install -m 644 samples/no_authentication+explicit.json %{_samples}
install -m 644 samples/no_authentication.json %{_samples}
install -m 644 samples/plain.json %{_samples}
install -m 644 samples/simple.json %{_samples}
install -m 644 samples/tpg+discovery.json %{_samples}
install -m 644 samples/tpg+discovery+mutual.json %{_samples}
install -m 644 samples/tpg.json %{_samples}
install -m 644 samples/tpg+mutual+discovery.json %{_samples}
install -m 644 samples/tpg+mutual+discovery+mutual.json %{_samples}
install -m 644 samples/tpg+mutual.json %{_samples}
install -m 644 samples/2gateways+2images+no_authentication.json %{_samples}
install -m 644 samples/2gateways+2portals+2images+isolated+no_authentication.json %{_samples}
install -m 644 samples/2gateways+2portals+2images+no_authentication.json %{_samples}
install -m 644 samples/2gateways+2portals+no_authentication.json %{_samples}
install -m 644 samples/2gateways+no_authentication.json %{_samples}
install -m 644 samples/2plain+3gateways+2portals+2images+isolated+no_authentication.json %{_samples}
install -m 644 samples/3gateways+2portals+2images+isolated+no_authentication.json %{_samples}
install -m 644 samples/3gateways+no_authentication.json %{_samples}
install -m 644 samples/plain+2gateways+2portals+2images+isolated+combined.json %{_samples}
install -m 644 samples/2gateways+tpg+identified.json %{_samples}
install -m 644 samples/3gateways+tpg+identified.json %{_samples}
install -m 644 samples/tpg+identified+mutual+discovery+mutual.json %{_samples}
install -m 644 samples/tpg+identified.json %{_samples}
install -m 644 samples/2gateways+2images+2targets+no_authentication.json %{_samples}
install -m 644 samples/2gateways+2images+assigned_lun+no_authentication.json %{_samples}
install -m 644 samples/plain+uuid.json %{_samples}
install -m 644 samples/plain+wwn_generate.json %{_samples}
install -m 644 samples/nonstandard_port+no_authentication.json %{_samples}
install -m 644 samples/plain+attributes.json %{_samples}
install -m 644 samples/plain+rbd_name.json %{_samples}
install -m 644 samples/plain+retries.json %{_samples}
install -m 644 samples/README.NEW %{_samples}
%pre
if [ "$1" == "2" ]
then
# Upgrade from 1.0
grep -q wwn_generate %{_sbindir}/lrbd
if [ $? -ne 0 ]
then
cat > %{_localstatedir}/lib/misc/lrbd.disabled <<EOF
Please migrate your existing configuration:
lrbd -m 1.0 > /tmp/lrbd.conf-migrated
lrbd -f /tmp/lrbd.conf-migrated
rm -f %{_localstatedir}/lib/misc/lrbd.disabled
See %{_docdir}/%{name}/README.migration for details.
EOF
fi
fi
%service_add_pre lrbd.service
%post
%service_add_post lrbd.service
%fillup_and_insserv
%preun
%service_del_preun lrbd.service
%postun
export DISABLE_RESTART_ON_UPDATE=yes
%service_del_postun lrbd.service
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/var/adm/fillup-templates/sysconfig.lrbd
%{_sbindir}/lrbd
%{_sbindir}/rclrbd
%{_mandir}/man5/lrbd.conf.5.gz
%{_mandir}/man8/lrbd.8.gz
%{_unitdir}/lrbd.service
%dir %attr(-, root, root) %{_docdir}/%{name}
%dir %attr(-, root, root) %{_docdir}/%{name}/samples
%{_docdir}/%{name}/README.migration
%{_docdir}/%{name}/samples/*
%changelog