42n4

ctdb255.spec

Feb 10th, 2016
708
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %global _hardened_build 1
  2.  
  3. %define initdir %{_sysconfdir}/rc.d/init.d
  4. %define with_systemd 1
  5.  
  6. Summary: A Clustered Database based on Samba's Trivial Database (TDB)
  7. Name: ctdb
  8. Version: 2.5.5
  9. Release: 2%{?dist}
  10. License: GPLv3+
  11. Group: System Environment/Daemons
  12. URL: http://ctdb.samba.org/
  13.  
  14. Source0: https://ftp.samba.org/pub/ctdb/%{name}-%{version}.tar.gz
  15.  
  16. Requires: chkconfig coreutils psmisc
  17. Requires: fileutils sed
  18. Requires: tdb-tools
  19. %if %{with_systemd}
  20. Requires(post): systemd-units
  21. Requires(preun): systemd-units
  22. Requires(postun): systemd-units
  23. %else
  24. Requires(preun): chkconfig initscripts
  25. Requires(post): chkconfig
  26. Requires(postun): initscripts
  27. %endif
  28.  
  29. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  30. BuildRequires: autoconf net-tools popt-devel
  31. # For make check
  32. BuildRequires: procps iproute
  33.  
  34. # Always use the bundled versions of these libraries.
  35. %define with_included_talloc 0
  36. %define with_included_tdb 0
  37. %define with_included_tevent 0
  38.  
  39. # If the above options are changed then mandate minimum system
  40. # versions.
  41. %define libtalloc_version 2.0.8
  42. %define libtdb_version 1.2.11
  43. %define libtevent_version 0.9.18
  44.  
  45. %if ! %with_included_talloc
  46. BuildRequires: libtalloc-devel >= %{libtalloc_version}
  47. %endif
  48. %if ! %with_included_tdb
  49. BuildRequires: libtdb-devel >= %{libtdb_version}
  50. %endif
  51. %if ! %with_included_tevent
  52. BuildRequires: libtevent-devel >= %{libtevent_version}
  53. %endif
  54.  
  55.  
  56. %description
  57. CTDB is a cluster implementation of the TDB database used by Samba and other
  58. projects to store temporary data. If an application is already using TDB for
  59. temporary data it is very easy to convert that application to be cluster aware
  60. and use CTDB instead.
  61.  
  62. %package devel
  63. Group: Development/Libraries
  64. Summary: CTDB clustered database development package
  65. Requires: ctdb = %{version}-%{release}
  66. Provides: ctdb-static = %{version}-%{release}
  67. %description devel
  68. Libraries, include files, etc you can use to develop CTDB applications.
  69. CTDB is a cluster implementation of the TDB database used by Samba and other
  70. projects to store temporary data. If an application is already using TDB for
  71. temporary data it is very easy to convert that application to be cluster aware
  72. and use CTDB instead.
  73.  
  74. %package tests
  75. Summary: CTDB clustered database test suite
  76. Group: Development/Tools
  77. Requires: ctdb = %{version}
  78. Requires: nc
  79.  
  80. %description tests
  81. Test suite for CTDB.
  82. CTDB is a cluster implementation of the TDB database used by Samba and other
  83. projects to store temporary data. If an application is already using TDB for
  84. temporary data it is very easy to convert that application to be cluster aware
  85. and use CTDB instead.
  86.  
  87. #######################################################################
  88.  
  89. %prep
  90. %setup -q
  91. # setup the init script and sysconfig file
  92. %setup -T -D -n ctdb-%{version} -q
  93.  
  94. %build
  95.  
  96. CC="gcc"
  97.  
  98. ## always run autogen.sh
  99. ./autogen.sh
  100.  
  101. CFLAGS="$(echo '%{optflags}') $EXTRA -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\"" %configure \
  102. %if %with_included_talloc
  103.         --with-included-talloc \
  104. %endif
  105. %if %with_included_tdb
  106.         --with-included-tdb \
  107. %endif
  108. %if %with_included_tevent
  109.         --with-included-tevent
  110. %endif
  111.  
  112. make showflags
  113. make %{_smp_mflags}
  114.  
  115. # make test does not work in koji
  116. #%check
  117. #make test
  118.  
  119. %install
  120. # Clean up in case there is trash left from a previous build
  121. rm -rf %{buildroot}
  122.  
  123. # Create the target build directory hierarchy
  124. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  125. mkdir -p %{buildroot}%{_sysconfdir}/sudoers.d
  126. mkdir -p %{buildroot}%{initdir}
  127.  
  128. make DESTDIR=%{buildroot} install
  129.  
  130. make DESTDIR=%{buildroot} docdir=%{_docdir} install install_tests
  131.  
  132. install -m644 config/ctdb.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/ctdb
  133.  
  134. %if %{with_systemd}
  135. mkdir -p %{buildroot}%{_unitdir}
  136. install -m 755 config/ctdb.service %{buildroot}%{_unitdir}
  137. %else
  138. mkdir -p %{buildroot}%{initdir}
  139. install -m755 config/ctdb.init %{buildroot}%{initdir}/ctdb
  140. %endif
  141.  
  142. # create /run/ctdbd
  143. mkdir -p %{buildroot}%{_tmpfilesdir}
  144. echo "d /run/ctdb  755 root root" >> %{buildroot}%{_tmpfilesdir}/%{name}.conf
  145.  
  146. mkdir -p %{buildroot}/run
  147. install -d -m 0755 %{buildroot}/run/ctdb/
  148.  
  149. install -d -m 0755 %{buildroot}%{_localstatedir}/lib/ctdb/
  150.  
  151. mkdir -p %{buildroot}%{_docdir}/ctdb/tests/bin
  152. install -m755 tests/bin/ctdb_transaction %{buildroot}%{_docdir}/ctdb/tests/bin
  153.  
  154.  
  155. # Remove "*.old" files
  156. find %{buildroot} -name "*.old" -exec rm -f {} \;
  157.  
  158. cp -r COPYING web %{buildroot}%{_docdir}/ctdb
  159.  
  160. %clean
  161. rm -rf %{buildroot}
  162.  
  163. %if %{with_systemd}
  164. %post
  165. %systemd_post ctdb.service
  166.  
  167. %preun
  168. %systemd_preun ctdb.service
  169.  
  170. %postun
  171. %systemd_postun_with_restart ctdb.service
  172. %else
  173. %post
  174. /sbin/chkconfig --add ctdb
  175.  
  176. %preun
  177. if [ "$1" -eq "0" ] ; then
  178.  /sbin/service ctdb stop > /dev/null 2>&1
  179.  /sbin/chkconfig --del ctdb
  180. fi
  181.  
  182. %postun
  183. if [ "$1" -ge "1" ]; then
  184.  /sbin/service ctdb condrestart >/dev/null 2>&1 || true
  185. fi
  186. %endif
  187.  
  188. # Files section
  189.  
  190. %files
  191. %defattr(-,root,root,-)
  192.  
  193. %config(noreplace) %{_sysconfdir}/sysconfig/ctdb
  194. %config(noreplace) %{_sysconfdir}/ctdb/notify.sh
  195. %config(noreplace) %{_sysconfdir}/ctdb/debug-hung-script.sh
  196. %config(noreplace) %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh
  197. %config(noreplace) %{_sysconfdir}/ctdb/gcore_trace.sh
  198. %config(noreplace) %{_sysconfdir}/ctdb/functions
  199. %config(noreplace) %{_sysconfdir}/ctdb/debug_locks.sh
  200. %dir /run/ctdb/
  201. %dir %{_localstatedir}/lib/ctdb/
  202. %{_tmpfilesdir}/%{name}.conf
  203.  
  204. %if %{with_systemd}
  205. %{_unitdir}/ctdb.service
  206. %else
  207. %attr(755,root,root) %{initdir}/ctdb
  208. %endif
  209.  
  210. %{_docdir}/ctdb
  211. %dir %{_sysconfdir}/ctdb
  212. %{_sysconfdir}/ctdb/statd-callout
  213. %dir %{_sysconfdir}/ctdb/nfs-rpc-checks.d
  214. %{_sysconfdir}/ctdb/nfs-rpc-checks.d/10.statd.check
  215. %{_sysconfdir}/ctdb/nfs-rpc-checks.d/20.nfsd.check
  216. %{_sysconfdir}/ctdb/nfs-rpc-checks.d/30.lockd.check
  217. %{_sysconfdir}/ctdb/nfs-rpc-checks.d/40.mountd.check
  218. %{_sysconfdir}/ctdb/nfs-rpc-checks.d/50.rquotad.check
  219. %{_sysconfdir}/sudoers.d/ctdb
  220. %{_sysconfdir}/ctdb/events.d/
  221. %{_sbindir}/ctdbd
  222. %{_sbindir}/ctdbd_wrapper
  223. %{_bindir}/ctdb
  224. %{_bindir}/smnotify
  225. %{_bindir}/ping_pong
  226. %{_bindir}/ltdbtool
  227. %{_bindir}/ctdb_diagnostics
  228. %{_bindir}/onnode
  229. %{_bindir}/ctdb_lock_helper
  230. %{_bindir}/ctdb_event_helper
  231.  
  232. %{_mandir}/man1/ctdb.1.gz
  233. %{_mandir}/man1/ctdbd.1.gz
  234. %{_mandir}/man1/onnode.1.gz
  235. %{_mandir}/man1/ltdbtool.1.gz
  236. %{_mandir}/man1/ping_pong.1.gz
  237. %{_mandir}/man1/ctdbd_wrapper.1.gz
  238. %{_mandir}/man5/ctdbd.conf.5.gz
  239. %{_mandir}/man7/ctdb-statistics.7.gz
  240. %{_mandir}/man7/ctdb-tunables.7.gz
  241. %{_mandir}/man7/ctdb.7.gz
  242.  
  243. %files devel
  244. %defattr(-,root,root,-)
  245. %{_includedir}/ctdb.h
  246. %{_includedir}/ctdb_client.h
  247. %{_includedir}/ctdb_protocol.h
  248. %{_includedir}/ctdb_private.h
  249. %{_includedir}/ctdb_typesafe_cb.h
  250. %{_libdir}/pkgconfig/ctdb.pc
  251.  
  252. %files tests
  253. %defattr(-,root,root,-)
  254. %dir %{_datadir}/%{name}-tests
  255. %{_datadir}/%{name}-tests/*
  256. %dir %{_libdir}/%{name}-tests
  257. %{_libdir}/%{name}-tests/*
  258. %{_bindir}/ctdb_run_tests
  259. %{_bindir}/ctdb_run_cluster_tests
  260. %doc tests/README
  261.  
  262. %changelog
  263. * Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 2.5.5-2
  264. - Mass rebuild 2014-01-24
RAW Paste Data