Merge branch 'master' of git://git.samba.org/tridge/ctdb
[sahlberg/ctdb.git] / packaging / RPM / ctdb.spec
1 %define initdir %{_sysconfdir}/init.d
2
3 Summary: Clustered TDB
4 Vendor: Samba Team
5 Packager: Samba Team <samba@samba.org>
6 Name: ctdb
7 Version: 1.0
8 Release: 26
9 Epoch: 0
10 License: GNU GPL version 3
11 Group: System Environment/Daemons
12 URL: http://ctdb.samba.org/
13
14 Source: ctdb-%{version}.tar.gz
15
16 Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
17 Prereq: fileutils sed /etc/init.d
18
19 Provides: ctdb = %{version}
20
21 Prefix: /usr
22 BuildRoot: %{_tmppath}/%{name}-%{version}-root
23
24 %description
25 ctdb is the clustered database used by samba
26
27
28 #######################################################################
29
30 %prep
31 %setup -q
32 # setup the init script and sysconfig file
33 %setup -T -D -n ctdb-%{version} -q
34
35 %build
36
37 CC="gcc"
38
39 ## always run autogen.sh
40 ./autogen.sh
41
42 CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE" ./configure \
43         --prefix=%{_prefix} \
44         --sysconfdir=%{_sysconfdir} \
45         --mandir=%{_mandir} \
46         --localstatedir="/var"
47
48 make showflags
49 make   
50
51 %install
52 # Clean up in case there is trash left from a previous build
53 rm -rf $RPM_BUILD_ROOT
54
55 # Create the target build directory hierarchy
56 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
57 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
58
59 make DESTDIR=$RPM_BUILD_ROOT install
60
61 install -m644 config/ctdb.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb
62 install -m755 config/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
63
64 # Remove "*.old" files
65 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
66
67 %clean
68 rm -rf $RPM_BUILD_ROOT
69
70 %post
71 [ -x /sbin/chkconfig ] && /sbin/chkconfig --add ctdb
72
73 %preun
74 if [ $1 = 0 ] ; then
75     [ -x /sbin/chkconfig ] && /sbin/chkconfig --del ctdb
76 fi
77 exit 0
78
79 %postun
80 if [ "$1" -ge "1" ]; then
81         %{initdir}/ctdb restart >/dev/null 2>&1
82 fi      
83
84
85 #######################################################################
86 ## Files section                                                     ##
87 #######################################################################
88
89 %files
90 %defattr(-,root,root)
91
92 %config(noreplace) %{_sysconfdir}/sysconfig/ctdb
93 %attr(755,root,root) %config %{initdir}/ctdb
94
95 %{_sysconfdir}/ctdb/functions
96 %{_sysconfdir}/ctdb/events.d/README
97 %{_sysconfdir}/ctdb/events.d/00.ctdb
98 %{_sysconfdir}/ctdb/events.d/10.interface
99 %{_sysconfdir}/ctdb/events.d/40.vsftpd
100 %{_sysconfdir}/ctdb/events.d/41.httpd
101 %{_sysconfdir}/ctdb/events.d/50.samba
102 %{_sysconfdir}/ctdb/events.d/60.nfs
103 %{_sysconfdir}/ctdb/events.d/61.nfstickle
104 %{_sysconfdir}/ctdb/events.d/90.ipmux
105 %{_sysconfdir}/ctdb/events.d/91.lvs
106 %{_sysconfdir}/ctdb/statd-callout
107 %{_sbindir}/ctdbd
108 %{_bindir}/ctdb
109 %{_bindir}/smnotify
110 %{_bindir}/ctdb_ipmux
111 %{_bindir}/ctdb_diagnostics
112 %{_bindir}/onnode.ssh
113 %{_bindir}/onnode.rsh
114 %{_bindir}/onnode
115 %{_mandir}/man1/ctdb.1.gz
116 %{_mandir}/man1/ctdbd.1.gz
117 %{_mandir}/man1/onnode.1.gz
118 %{_includedir}/ctdb.h
119 %{_includedir}/ctdb_private.h
120
121 %changelog
122 * Thu Jan 31 2008 : Version 1.0.26
123  - Fix crashbug in tdb transaction code
124 * Tue Jan 29 2008 : Version 1.0.25
125  - added async recovery code
126  - make event scripts more portable
127  - fixed ctdb dumpmemory
128  - more efficient tdb allocation code
129  - improved machine readable ctdb status output
130  - added ctdb uptime
131 * Wed Jan 16 2008 : Version 1.0.24
132  - added syslog support
133  - documentation updates
134 * Wed Jan 16 2008 : Version 1.0.23
135  - fixed a memory leak in the recoveryd
136  - fixed a corruption bug in the new transaction code
137  - fixed a case where an packet for a disconnected client could be processed
138  - added http event script
139  - updated documentation
140 * Thu Jan 10 2008 : Version 1.0.22
141  - auto-run vacuum and repack ops
142 * Wed Jan 09 2008 : Version 1.0.21
143  - added ctdb vacuum and ctdb repack code
144 * Sun Jan 06 2008 : Version 1.0.20
145  - new transaction based recovery code
146 * Sat Jan 05 2008 : Version 1.0.19
147  - fixed non-master bug
148  - big speedup in recovery for large databases
149  - lots of changes to improve tdb and ctdb for high churn databases
150 * Thu Dec 27 2007 : Version 1.0.18
151  - fixed crash bug in monitor_handler
152 * Tue Dec 04 2007 : Version 1.0.17
153  - fixed bugs related to ban/unban of nodes
154  - fixed a race condition that could lead to monitoring being permanently disabled,
155    which would lead to long recovery times
156  - make deterministic IPs the default
157  - fixed a bug related to continuous recovery 
158  - added a debugging option --node-ip