]>
Commit | Line | Data |
---|---|---|
0194a002 ER |
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 | |
2e30401f JB |
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) | |
14010407 | 8 | # - patch scripts for pld |
8eca7ff5 JB |
9 | # |
10 | # Conditional build: | |
11 | %bcond_without ibverbs # InfiniBand support | |
2aadb1bb | 12 | %bcond_without pcp # Performance Co-Pilot support |
8eca7ff5 | 13 | # |
0194a002 | 14 | Summary: A Clustered Database based on Samba's Trivial Database (TDB) |
12c08eb2 | 15 | Summary(pl.UTF-8): Klastrowa baza danych oparta na bazie danych Trivial Database z Samby (TDB) |
0194a002 | 16 | Name: ctdb |
34ee3b4c | 17 | Version: 2.5.6 |
b57de2c4 | 18 | Release: 1 |
0194a002 ER |
19 | License: GPL v3+ |
20 | Group: Daemons | |
b57de2c4 | 21 | Source0: https://www.samba.org/ftp/ctdb/%{name}-%{version}.tar.gz |
34ee3b4c | 22 | # Source0-md5: efc50109f90a4c790124c35e4ba234ad |
7f6e7f77 | 23 | Patch0: %{name}-format.patch |
0194a002 | 24 | URL: http://ctdb.samba.org/ |
2aadb1bb | 25 | %{?with_pcp:BuildRequires: pcp-devel} |
12c08eb2 | 26 | BuildRequires: popt-devel |
0194a002 | 27 | BuildRequires: rpmbuild(macros) >= 1.268 |
8eca7ff5 JB |
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 | |
0194a002 ER |
35 | Requires(post,preun): /sbin/chkconfig |
36 | Requires: coreutils | |
37 | Requires: psmisc | |
38 | Requires: rc-scripts | |
39 | Requires: sed | |
0194a002 ER |
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 | ||
12c08eb2 JB |
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 | ||
0194a002 ER |
54 | %package devel |
55 | Summary: CTDB clustered database development package | |
12c08eb2 | 56 | Summary(pl.UTF-8): Pakiet programistyczny klastrowej bazy danych CTDB |
0194a002 | 57 | Group: Development/Libraries |
8eca7ff5 | 58 | Requires: tdb-devel |
14010407 | 59 | # does not require base |
0194a002 ER |
60 | |
61 | %description devel | |
12c08eb2 JB |
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. | |
0194a002 | 67 | |
2aadb1bb JB |
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 | ||
0194a002 ER |
83 | %prep |
84 | %setup -q | |
c63e09ab | 85 | %patch0 -p1 |
0194a002 ER |
86 | |
87 | %build | |
8eca7ff5 | 88 | %configure \ |
b14063e3 | 89 | %{?with_pcp:--enable-pmda} \ |
8eca7ff5 | 90 | %{?with_ibverbs:--enable-infiniband} |
0194a002 ER |
91 | %{__make} showflags |
92 | %{__make} | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
34bdfca7 | 96 | install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{systemdunitdir}} |
0194a002 ER |
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 | |
34bdfca7 | 103 | cp -p config/ctdb.service $RPM_BUILD_ROOT%{systemdunitdir} |
d8b39754 JB |
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 | |
0194a002 ER |
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 | |
85deb581 | 113 | find $RPM_BUILD_ROOT -name "*.old" -exec rm -fv {} ';' |
0194a002 ER |
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 | |
85deb581 | 124 | %service ctdb restart |
0194a002 ER |
125 | |
126 | %preun | |
127 | if [ "$1" -eq "0" ] ; then | |
128 | %service ctdb stop | |
129 | /sbin/chkconfig --del ctdb | |
130 | fi | |
131 | ||
0194a002 ER |
132 | %files |
133 | %defattr(644,root,root,755) | |
134 | %{_docdir}/ctdb-%{version} | |
135 | %dir %{_sysconfdir}/ctdb | |
136 | %{_sysconfdir}/ctdb/events.d | |
b14063e3 JB |
137 | %{_sysconfdir}/ctdb/nfs-rpc-checks.d |
138 | %{_sysconfdir}/ctdb/notify.d | |
8eca7ff5 JB |
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 | |
76796c3e | 141 | %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) %{_sysconfdir}/ctdb/debug_locks.sh |
8eca7ff5 | 142 | %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) %{_sysconfdir}/ctdb/gcore_trace.sh |
14010407 | 143 | %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) %{_sysconfdir}/ctdb/notify.sh |
0194a002 ER |
144 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ctdb/functions |
145 | %{_sysconfdir}/ctdb/statd-callout | |
0194a002 | 146 | %attr(755,root,root) %{_sbindir}/ctdbd |
fc43d071 | 147 | %attr(755,root,root) %{_sbindir}/ctdbd_wrapper |
0194a002 | 148 | %attr(755,root,root) %{_bindir}/ctdb |
0194a002 | 149 | %attr(755,root,root) %{_bindir}/ctdb_diagnostics |
f17fecda | 150 | %attr(755,root,root) %{_bindir}/ctdb_event_helper |
b14063e3 | 151 | %attr(755,root,root) %{_bindir}/ctdb_lock_helper |
8eca7ff5 | 152 | %attr(755,root,root) %{_bindir}/ltdbtool |
0194a002 | 153 | %attr(755,root,root) %{_bindir}/onnode |
8eca7ff5 JB |
154 | %attr(755,root,root) %{_bindir}/ping_pong |
155 | %attr(755,root,root) %{_bindir}/smnotify | |
34bdfca7 | 156 | %{systemdunitdir}/ctdb.service |
d8b39754 | 157 | %{systemdtmpfilesdir}/ctdb.conf |
34bdfca7 JB |
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 | |
d8b39754 | 161 | %dir /var/run/ctdb |
0194a002 ER |
162 | %{_mandir}/man1/ctdb.1* |
163 | %{_mandir}/man1/ctdbd.1* | |
f17fecda | 164 | %{_mandir}/man1/ctdbd_wrapper.1* |
8eca7ff5 | 165 | %{_mandir}/man1/ltdbtool.1* |
0194a002 | 166 | %{_mandir}/man1/onnode.1* |
8eca7ff5 | 167 | %{_mandir}/man1/ping_pong.1* |
f17fecda JB |
168 | %{_mandir}/man5/ctdbd.conf.5* |
169 | %{_mandir}/man7/ctdb.7* | |
7f6e7f77 | 170 | %{_mandir}/man7/ctdb-statistics.7* |
f17fecda | 171 | %{_mandir}/man7/ctdb-tunables.7* |
0194a002 ER |
172 | |
173 | %files devel | |
174 | %defattr(644,root,root,755) | |
8eca7ff5 | 175 | %{_includedir}/ctdb*.h |
0194a002 | 176 | %{_pkgconfigdir}/ctdb.pc |
2aadb1bb JB |
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 |