]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - skip interfaces check: | |
3 | # checking for iface getifaddrs... | |
4 | # lo IP=127.0.0.1 NETMASK=255.0.0.0 | |
5 | # eth0 IP=x.x.x.x NETMASK=255.255.252.0 | |
6 | # - add support for /sbin/ss instead of /bin/netstat (ss uses kernel netlink | |
7 | # which is huge win on server with loads of open tcp sockets) | |
8 | # - patch scripts for pld | |
9 | # | |
10 | # Conditional build: | |
11 | %bcond_without ibverbs # InfiniBand support | |
12 | %bcond_without pcp # Performance Co-Pilot support | |
13 | # | |
14 | Summary: A Clustered Database based on Samba's Trivial Database (TDB) | |
15 | Summary(pl.UTF-8): Klastrowa baza danych oparta na bazie danych Trivial Database z Samby (TDB) | |
16 | Name: ctdb | |
17 | Version: 2.5.4 | |
18 | Release: 1 | |
19 | License: GPL v3+ | |
20 | Group: Daemons | |
21 | Source0: http://www.samba.org/ftp/ctdb/%{name}-%{version}.tar.gz | |
22 | # Source0-md5: c73fceb69f192d629150b84b10567497 | |
23 | Patch0: %{name}-format.patch | |
24 | URL: http://ctdb.samba.org/ | |
25 | %{?with_pcp:BuildRequires: pcp-devel} | |
26 | BuildRequires: popt-devel | |
27 | BuildRequires: rpmbuild(macros) >= 1.268 | |
28 | BuildRequires: talloc-devel | |
29 | BuildRequires: tdb-devel | |
30 | BuildRequires: tevent-devel | |
31 | %if %{with ibverbs} | |
32 | BuildRequires: libibverbs-devel | |
33 | BuildRequires: librdmacm-devel | |
34 | %endif | |
35 | Requires(post,preun): /sbin/chkconfig | |
36 | Requires: coreutils | |
37 | Requires: psmisc | |
38 | Requires: rc-scripts | |
39 | Requires: sed | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | CTDB is a cluster implementation of the TDB database used by Samba and | |
44 | other projects to store temporary data. If an application is already | |
45 | using TDB for temporary data it is very easy to convert that | |
46 | application to be cluster aware and use CTDB instead. | |
47 | ||
48 | %description -l pl.UTF-8 | |
49 | CTDB to klastrowa implementacja bazy danych TDB używanej w Sambie oraz | |
50 | innych projektach do przechowywania danych tymczasowych. Jeśli jakaś | |
51 | aplikacja już wykorzystuje TDB do trzymania danych tymczasowych, | |
52 | bardzo przerobić ją na klastrowalną, wykorzystującą CTDB. | |
53 | ||
54 | %package devel | |
55 | Summary: CTDB clustered database development package | |
56 | Summary(pl.UTF-8): Pakiet programistyczny klastrowej bazy danych CTDB | |
57 | Group: Development/Libraries | |
58 | Requires: tdb-devel | |
59 | # does not require base | |
60 | ||
61 | %description devel | |
62 | Header files etc. you can use to develop CTDB applications. | |
63 | ||
64 | %description devel -l pl.UTF-8 | |
65 | Pliki nagłówkowe i inne, przy użyciu których można tworzyć aplikacje | |
66 | wykorzystujące CTDB. | |
67 | ||
68 | %package -n pcp-ctdb | |
69 | Summary: CTDB PMDA | |
70 | Summary(pl.UTF-8): PMDA CTDB | |
71 | Group: Applications/System | |
72 | Requires: %{name} = %{version}-%{release} | |
73 | Requires: pcp | |
74 | ||
75 | %description -n pcp-ctdb | |
76 | This PMDA extracts metrics from the locally running ctdbd daemon for | |
77 | export to PMCD. | |
78 | ||
79 | %description -n pcp-ctdb -l pl.UTF-8 | |
80 | Ten PMDA odczytuje pomiary z lokalnie działającego demona ctdbd w celu | |
81 | wyeksportowania do PMCD. | |
82 | ||
83 | %prep | |
84 | %setup -q | |
85 | %patch0 -p1 | |
86 | ||
87 | %build | |
88 | %configure \ | |
89 | %{?with_pcp:--enable-pmda} \ | |
90 | %{?with_ibverbs:--enable-infiniband} | |
91 | %{__make} showflags | |
92 | %{__make} | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{systemdunitdir}} | |
97 | ||
98 | %{__make} install \ | |
99 | DESTDIR=$RPM_BUILD_ROOT | |
100 | ||
101 | cp -a config/ctdb.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/ctdb | |
102 | install -p config/ctdb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ctdb | |
103 | cp -p config/ctdb.service $RPM_BUILD_ROOT%{systemdunitdir} | |
104 | install -d $RPM_BUILD_ROOT%{systemdtmpfilesdir} | |
105 | cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/ctdb.conf <<EOF | |
106 | d /var/run/ctdb 0755 root root - | |
107 | EOF | |
108 | ||
109 | install -d $RPM_BUILD_ROOT%{_docdir}/ctdb/tests/bin | |
110 | install -p tests/bin/ctdb_transaction $RPM_BUILD_ROOT%{_docdir}/ctdb/tests/bin | |
111 | ||
112 | # Remove "*.old" files | |
113 | find $RPM_BUILD_ROOT -name "*.old" -exec rm -fv {} ';' | |
114 | ||
115 | # fix doc path | |
116 | mv $RPM_BUILD_ROOT%{_docdir}/ctdb $RPM_BUILD_ROOT%{_docdir}/ctdb-%{version} | |
117 | cp -a web $RPM_BUILD_ROOT%{_docdir}/ctdb-%{version} | |
118 | ||
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %post | |
123 | /sbin/chkconfig --add ctdb | |
124 | %service ctdb restart | |
125 | ||
126 | %preun | |
127 | if [ "$1" -eq "0" ] ; then | |
128 | %service ctdb stop | |
129 | /sbin/chkconfig --del ctdb | |
130 | fi | |
131 | ||
132 | %files | |
133 | %defattr(644,root,root,755) | |
134 | %{_docdir}/ctdb-%{version} | |
135 | %dir %{_sysconfdir}/ctdb | |
136 | %{_sysconfdir}/ctdb/events.d | |
137 | %{_sysconfdir}/ctdb/nfs-rpc-checks.d | |
138 | %{_sysconfdir}/ctdb/notify.d | |
139 | %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh | |
140 | %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) %{_sysconfdir}/ctdb/debug-hung-script.sh | |
141 | %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) %{_sysconfdir}/ctdb/debug_locks.sh | |
142 | %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) %{_sysconfdir}/ctdb/gcore_trace.sh | |
143 | %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) %{_sysconfdir}/ctdb/notify.sh | |
144 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ctdb/functions | |
145 | %{_sysconfdir}/ctdb/statd-callout | |
146 | %attr(755,root,root) %{_sbindir}/ctdbd | |
147 | %attr(755,root,root) %{_sbindir}/ctdbd_wrapper | |
148 | %attr(755,root,root) %{_bindir}/ctdb | |
149 | %attr(755,root,root) %{_bindir}/ctdb_diagnostics | |
150 | %attr(755,root,root) %{_bindir}/ctdb_event_helper | |
151 | %attr(755,root,root) %{_bindir}/ctdb_lock_helper | |
152 | %attr(755,root,root) %{_bindir}/ltdbtool | |
153 | %attr(755,root,root) %{_bindir}/onnode | |
154 | %attr(755,root,root) %{_bindir}/ping_pong | |
155 | %attr(755,root,root) %{_bindir}/smnotify | |
156 | %{systemdunitdir}/ctdb.service | |
157 | %{systemdtmpfilesdir}/ctdb.conf | |
158 | %attr(754,root,root) /etc/rc.d/init.d/ctdb | |
159 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ctdb | |
160 | %attr(440,root,root) /etc/sudoers.d/ctdb | |
161 | %dir /var/run/ctdb | |
162 | %{_mandir}/man1/ctdb.1* | |
163 | %{_mandir}/man1/ctdbd.1* | |
164 | %{_mandir}/man1/ctdbd_wrapper.1* | |
165 | %{_mandir}/man1/ltdbtool.1* | |
166 | %{_mandir}/man1/onnode.1* | |
167 | %{_mandir}/man1/ping_pong.1* | |
168 | %{_mandir}/man5/ctdbd.conf.5* | |
169 | %{_mandir}/man7/ctdb.7* | |
170 | %{_mandir}/man7/ctdb-statistics.7* | |
171 | %{_mandir}/man7/ctdb-tunables.7* | |
172 | ||
173 | %files devel | |
174 | %defattr(644,root,root,755) | |
175 | %{_includedir}/ctdb*.h | |
176 | %{_pkgconfigdir}/ctdb.pc | |
177 | ||
178 | %files -n pcp-ctdb | |
179 | %defattr(644,root,root,755) | |
180 | %dir /var/lib/pcp/pmdas/ctdb | |
181 | %doc /var/lib/pcp/pmdas/ctdb/README | |
182 | %attr(755,root,root) /var/lib/pcp/pmdas/ctdb/Install | |
183 | %attr(755,root,root) /var/lib/pcp/pmdas/ctdb/Remove | |
184 | %attr(755,root,root) /var/lib/pcp/pmdas/ctdb/pmdactdb | |
185 | /var/lib/pcp/pmdas/ctdb/domain.h | |
186 | /var/lib/pcp/pmdas/ctdb/help | |
187 | /var/lib/pcp/pmdas/ctdb/pmns |