2 # - fix make install linking stuff over again
3 # - skip tests build if testing disabled
4 # - libpq vs postgresql, which one matters?
9 %bcond_with tests # build with tests
10 %bcond_without gperftools # gperftools
11 %bcond_without sqlite3 # use SQLite 3 library [default=yes]
12 %bcond_without libtokyocabinet # Build with libtokyocabinet support [default=on]
13 %bcond_without libmemcached # Build with libmemcached support [default=on]
14 %bcond_without hiredis # Build with hiredis support [default=on]
15 %bcond_without libpq # Build with libpq, ie Postgres, support [default=on]
16 %bcond_without mysql # use MySQL client library [default=yes]
17 %bcond_without postgresql # use PostgreSQL library [default=yes]
18 %bcond_with libdrizzle # Build with libdrizzle support [default=on]
20 # google perftools available only on these
21 %ifnarch %{ix86} x86_64 ppc64 ppc64le aarch64 %{arm}
22 %undefine with_gperftools
25 Summary: A distributed job system
31 Source0: https://launchpad.net/gearmand/1.2/%{version}/+download/%{name}-%{version}.tar.gz
32 # Source0-md5: 99dd0be85b181eccf7fb1ca3c2a28a9f
34 Source2: %{name}.sysconfig
35 Source3: %{name}.service
36 Patch0: %{name}-1.1.12-ppc64le.patch
37 URL: http://www.gearman.org
38 BuildRequires: autoconf
39 BuildRequires: autoconf-archive
40 BuildRequires: automake
41 BuildRequires: boost-devel >= 1.37.0
43 %{?with_gperftools:BuildRequires: gperftools-devel}
44 %{?with_hiredis:BuildRequires: hiredis-devel}
45 BuildRequires: libevent-devel
46 %{?with_libmemcached:BuildRequires: libmemcached-devel}
47 BuildRequires: libtool
48 BuildRequires: libuuid-devel
49 %{?with_mysql:BuildRequires: mysql-devel}
50 BuildRequires: pkgconfig
51 BuildRequires: postgresql-devel
52 %{?with_libpq:BuildRequires: postgresql-devel}
53 BuildRequires: rpmbuild(macros) >= 1.647
54 %{?with_sqlite3:BuildRequires: sqlite3-devel}
55 %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel}
56 BuildRequires: zlib-devel
58 BuildRequires: curl-devel
59 BuildRequires: mysql-server
61 Provides: group(gearmand)
62 Provides: user(gearmand)
63 Requires(post,preun): /sbin/chkconfig
64 Requires(post,preun,postun): systemd-units >= 38
65 Requires(postun): /usr/sbin/groupdel
66 Requires(postun): /usr/sbin/userdel
67 Requires(pre): /bin/id
68 Requires(pre): /usr/bin/getgid
69 Requires(pre): /usr/sbin/groupadd
70 Requires(pre): /usr/sbin/useradd
72 Requires: rc-scripts >= 0.4.0.17
73 Requires: systemd-units >= 0.38
74 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76 # FIXME: add tmpfiles conf
77 %define no_install_post_check_tmpfiles 1
80 Gearman provides a generic framework to farm out work to other
81 machines or dispatch function calls to machines that are better suited
82 to do the work. It allows you to do work in parallel, to load balance
83 processing, and to call functions between languages. It can be used in
84 a variety of applications, from high-availability web sites to the
85 transport for database replication. In other words, it is the nervous
86 system for how distributed processing communicates.
88 %package -n libgearman
89 Summary: Development libraries for gearman
90 Group: Development/Libraries
91 Provides: libgearman-1.0 = %{version}-%{release}
92 Obsoletes: libgearman-1.0 < %{version}-%{release}
93 # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs
94 Requires: e2fsprogs-libs >= 1.39-32
96 %description -n libgearman
97 Development libraries for %{name}.
99 %package -n libgearman-devel
100 Summary: Development headers for libgearman
101 Group: Development/Libraries
102 Requires: libevent-devel
103 Requires: libgearman = %{version}-%{release}
104 Provides: libgearman-1.0-devel = %{version}-%{release}
105 Obsoletes: libgearman-1.0-devel < %{version}-%{release}
107 %description -n libgearman-devel
108 Development headers for %{name}.
114 cp -p %{_aclocaldir}/ax_boost_base.m4 m4
115 cp -p %{_aclocaldir}/ax_boost_program_options.m4 m4
117 # somewhy it does not look into build-aux
118 ln -s build-aux/install-sh .
126 --disable-silent-rules \
128 %{__enable_disable hiredis} \
129 %{__enable_disable libdrizzle} \
130 %{__enable_disable libmemcached} \
131 %{__enable_disable libpq} \
132 %{__enable_disable libtokyocabinet} \
133 %{__with_without mysql} \
134 %{__with_without postgresql} \
135 %{__with_without sqlite3} \
146 rm -rf $RPM_BUILD_ROOT
148 DESTDIR=$RPM_BUILD_ROOT
150 rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la
152 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
153 $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdunitdir}} \
154 $RPM_BUILD_ROOT/var/{run/gearmand,log}
156 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
157 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
158 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand
159 touch $RPM_BUILD_ROOT/var/log/gearmand.log
162 rm -rf $RPM_BUILD_ROOT
165 %groupadd -g 328 gearmand
166 %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
169 test -e /var/log/gearmand.log || touch /var/log/gearmand.log
170 /sbin/chkconfig --add gearmand
171 %service gearmand restart
172 %systemd_post gearmand.service
175 if [ "$1" = 0 ] ; then
176 %service gearmand stop
177 /sbin/chkconfig --del gearmand
179 %systemd_preun gearmand.service
183 if [ "$1" = "0" ]; then
185 %groupremove gearmand
188 %post -n libgearman -p /sbin/ldconfig
189 %postun -n libgearman -p /sbin/ldconfig
192 %defattr(644,root,root,755)
194 %attr(754,root,root) /etc/rc.d/init.d/gearmand
195 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
196 %attr(755,root,root) %{_sbindir}/gearmand
197 %attr(755,root,root) %{_bindir}/gearman
198 %attr(755,root,root) %{_bindir}/gearadmin
199 %{_mandir}/man1/gearadmin.1*
200 %{_mandir}/man1/gearman.1*
201 %{_mandir}/man8/gearmand.8*
202 %{systemdunitdir}/%{name}.service
203 %dir %attr(771,root,gearmand) /var/run/gearmand
204 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
207 %defattr(644,root,root,755)
209 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
210 %ghost %{_libdir}/libgearman.so.8
212 %files -n libgearman-devel
213 %defattr(644,root,root,755)
214 %doc AUTHORS ChangeLog
215 %{_includedir}/libgearman
216 %{_pkgconfigdir}/gearmand.pc
217 %{_libdir}/libgearman.so
218 %{_includedir}/libgearman-1.0
219 %{_mandir}/man3/gearman_*
220 %{_mandir}/man3/libgearman.3*