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://github.com/gearman/gearmand/archive/%{version}/%{name}-%{version}.tar.gz
32 # Source0-md5: e947647db2a23239cead1c0960f2b5a0
34 Source2: %{name}.sysconfig
35 Source3: %{name}.service
38 URL: http://www.gearman.org
39 BuildRequires: autoconf
40 BuildRequires: autoconf-archive
41 BuildRequires: automake
42 BuildRequires: boost-devel >= 1.37.0
44 %{?with_gperftools:BuildRequires: gperftools-devel}
45 %{?with_hiredis:BuildRequires: hiredis-devel}
46 BuildRequires: libevent-devel
47 %{?with_libmemcached:BuildRequires: libmemcached-devel}
48 BuildRequires: libtool
49 BuildRequires: libuuid-devel
50 %{?with_mysql:BuildRequires: mysql-devel}
51 BuildRequires: pkgconfig
52 BuildRequires: postgresql-devel
53 %{?with_libpq:BuildRequires: postgresql-devel}
54 BuildRequires: rpmbuild(macros) >= 1.647
55 %{?with_sqlite3:BuildRequires: sqlite3-devel}
56 %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel}
57 BuildRequires: zlib-devel
59 BuildRequires: curl-devel
60 BuildRequires: mysql-server
62 Provides: group(gearmand)
63 Provides: user(gearmand)
64 Requires(post,preun): /sbin/chkconfig
65 Requires(post,preun,postun): systemd-units >= 38
66 Requires(postun): /usr/sbin/groupdel
67 Requires(postun): /usr/sbin/userdel
68 Requires(pre): /bin/id
69 Requires(pre): /usr/bin/getgid
70 Requires(pre): /usr/sbin/groupadd
71 Requires(pre): /usr/sbin/useradd
73 Requires: rc-scripts >= 0.4.0.17
74 Requires: systemd-units >= 0.38
75 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
77 # FIXME: add tmpfiles conf
78 %define no_install_post_check_tmpfiles 1
81 Gearman provides a generic framework to farm out work to other
82 machines or dispatch function calls to machines that are better suited
83 to do the work. It allows you to do work in parallel, to load balance
84 processing, and to call functions between languages. It can be used in
85 a variety of applications, from high-availability web sites to the
86 transport for database replication. In other words, it is the nervous
87 system for how distributed processing communicates.
89 %package -n libgearman
90 Summary: Development libraries for gearman
91 Group: Development/Libraries
92 Provides: libgearman-1.0 = %{version}-%{release}
93 Obsoletes: libgearman-1.0 < %{version}-%{release}
94 # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs
95 Requires: e2fsprogs-libs >= 1.39-32
97 %description -n libgearman
98 Development libraries for %{name}.
100 %package -n libgearman-devel
101 Summary: Development headers for libgearman
102 Group: Development/Libraries
103 Requires: libevent-devel
104 Requires: libgearman = %{version}-%{release}
105 Provides: libgearman-1.0-devel = %{version}-%{release}
106 Obsoletes: libgearman-1.0-devel < %{version}-%{release}
108 %description -n libgearman-devel
109 Development headers for %{name}.
118 echo "m4_define([VERSION_NUMBER], %{version})" > version.m4
127 --disable-silent-rules \
129 %{__enable_disable hiredis} \
130 %{__enable_disable libdrizzle} \
131 %{__enable_disable libmemcached} \
132 %{__enable_disable libpq} \
133 %{__enable_disable libtokyocabinet} \
134 %{__with_without mysql} \
135 %{__with_without postgresql} \
136 %{__with_without sqlite3} \
140 %{__make} -C docs -j1
148 rm -rf $RPM_BUILD_ROOT
150 DESTDIR=$RPM_BUILD_ROOT
152 rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la
154 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
155 $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdunitdir}} \
156 $RPM_BUILD_ROOT/var/{run/gearmand,log}
158 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
159 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
160 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand
161 touch $RPM_BUILD_ROOT/var/log/gearmand.log
164 rm -rf $RPM_BUILD_ROOT
167 %groupadd -g 328 gearmand
168 %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
171 test -e /var/log/gearmand.log || touch /var/log/gearmand.log
172 /sbin/chkconfig --add gearmand
173 %service gearmand restart
174 %systemd_post gearmand.service
177 if [ "$1" = 0 ] ; then
178 %service gearmand stop
179 /sbin/chkconfig --del gearmand
181 %systemd_preun gearmand.service
185 if [ "$1" = "0" ]; then
187 %groupremove gearmand
190 %post -n libgearman -p /sbin/ldconfig
191 %postun -n libgearman -p /sbin/ldconfig
194 %defattr(644,root,root,755)
196 %attr(754,root,root) /etc/rc.d/init.d/gearmand
197 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
198 %attr(755,root,root) %{_sbindir}/gearmand
199 %attr(755,root,root) %{_bindir}/gearman
200 %attr(755,root,root) %{_bindir}/gearadmin
201 %{_mandir}/man1/gearadmin.1*
202 %{_mandir}/man1/gearman.1*
203 %{_mandir}/man8/gearmand.8*
204 %{systemdunitdir}/%{name}.service
205 %dir %attr(771,root,gearmand) /var/run/gearmand
206 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
209 %defattr(644,root,root,755)
211 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
212 %ghost %{_libdir}/libgearman.so.8
214 %files -n libgearman-devel
215 %defattr(644,root,root,755)
216 %doc AUTHORS ChangeLog
217 %{_includedir}/libgearman
218 %{_pkgconfigdir}/gearmand.pc
219 %{_libdir}/libgearman.so
220 %{_includedir}/libgearman-1.0
221 %{_mandir}/man3/gearman_*
222 %{_mandir}/man3/libgearman.3*