]>
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 | |
6 | Summary: A Clustered Database based on Samba's Trivial Database (TDB) | |
7 | Name: ctdb | |
8 | Version: 1.0.113 | |
9 | Release: 0.1 | |
10 | License: GPL v3+ | |
11 | Group: Daemons | |
12 | URL: http://ctdb.samba.org/ | |
13 | # Tarfile created using git | |
14 | # git clone git://git.samba.org/sahlberg/ctdb.git ctdb | |
15 | # cd ctdb | |
16 | # git-archive --format=tar --prefix=%{name}-%{version}/ %{name}-%{version} | bzip2 > %{name}-%{version}.tar.bz2 | |
17 | Source0: %{name}-%{version}.tar.bz2 | |
18 | BuildRequires: autoconf | |
19 | BuildRequires: net-tools | |
20 | BuildRequires: rpmbuild(macros) >= 1.268 | |
21 | Requires(post,preun): /sbin/chkconfig | |
22 | Requires: coreutils | |
23 | Requires: psmisc | |
24 | Requires: rc-scripts | |
25 | Requires: sed | |
26 | Requires: tdb-tools | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | CTDB is a cluster implementation of the TDB database used by Samba and | |
31 | other projects to store temporary data. If an application is already | |
32 | using TDB for temporary data it is very easy to convert that | |
33 | application to be cluster aware and use CTDB instead. | |
34 | ||
35 | %package devel | |
36 | Summary: CTDB clustered database development package | |
37 | Group: Development/Libraries | |
38 | Requires: %{name} = %{version}-%{release} | |
39 | ||
40 | %description devel | |
41 | Libraries, include files, etc you can use to develop CTDB | |
42 | applications. CTDB is a cluster implementation of the TDB database | |
43 | used by Samba and other projects to store temporary data. If an | |
44 | application is already using TDB for temporary data it is very easy to | |
45 | convert that application to be cluster aware and use CTDB instead. | |
46 | ||
47 | %prep | |
48 | %setup -q | |
49 | ||
50 | %build | |
51 | sh -x ./autogen.sh | |
52 | ||
53 | CFLAGS="%{rpmcflags} $EXTRA -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\"" | |
54 | %configure | |
55 | %{__make} showflags | |
56 | %{__make} | |
57 | ||
58 | %install | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d} | |
61 | ||
62 | %{__make} install \ | |
63 | DESTDIR=$RPM_BUILD_ROOT | |
64 | ||
65 | cp -a config/ctdb.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/ctdb | |
66 | install -p config/ctdb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ctdb | |
67 | ||
68 | install -d $RPM_BUILD_ROOT%{_docdir}/ctdb/tests/bin | |
69 | install -p tests/bin/ctdb_transaction $RPM_BUILD_ROOT%{_docdir}/ctdb/tests/bin | |
70 | ||
71 | # Remove "*.old" files | |
72 | find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} ';' | |
73 | ||
74 | # fix doc path | |
75 | mv $RPM_BUILD_ROOT%{_docdir}/ctdb $RPM_BUILD_ROOT%{_docdir}/ctdb-%{version} | |
76 | cp -a web $RPM_BUILD_ROOT%{_docdir}/ctdb-%{version} | |
77 | ||
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %post | |
82 | /sbin/chkconfig --add ctdb | |
83 | ||
84 | %preun | |
85 | if [ "$1" -eq "0" ] ; then | |
86 | %service ctdb stop | |
87 | /sbin/chkconfig --del ctdb | |
88 | fi | |
89 | ||
90 | %postun | |
91 | if [ "$1" -ge "1" ]; then | |
92 | %service ctdb restart | |
93 | fi | |
94 | ||
95 | %files | |
96 | %defattr(644,root,root,755) | |
97 | %{_docdir}/ctdb-%{version} | |
98 | %dir %{_sysconfdir}/ctdb | |
99 | %{_sysconfdir}/ctdb/events.d | |
100 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ctdb/notify.sh | |
101 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ctdb/functions | |
102 | %{_sysconfdir}/ctdb/statd-callout | |
103 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ctdb | |
104 | %attr(754,root,root) /etc/rc.d/init.d/ctdb | |
105 | %attr(755,root,root) %{_sbindir}/ctdbd | |
106 | %attr(755,root,root) %{_bindir}/ctdb | |
107 | %attr(755,root,root) %{_bindir}/smnotify | |
108 | %attr(755,root,root) %{_bindir}/ping_pong | |
109 | %attr(755,root,root) %{_bindir}/ctdb_diagnostics | |
110 | %attr(755,root,root) %{_bindir}/onnode | |
111 | %{_mandir}/man1/ctdb.1* | |
112 | %{_mandir}/man1/ctdbd.1* | |
113 | %{_mandir}/man1/onnode.1* | |
114 | ||
115 | %files devel | |
116 | %defattr(644,root,root,755) | |
117 | %{_includedir}/ctdb.h | |
118 | %{_includedir}/ctdb_private.h | |
119 | %{_pkgconfigdir}/ctdb.pc |