2 # - fix make install linking stuff over again
3 # - skip tests build if testing disabled
4 # - add gearman user/group
5 # - libpq vs postgresql, which one matters?
8 %bcond_with tests # build with tests
9 %bcond_without gperftools # gperftools
10 %bcond_without sqlite3 # use SQLite 3 library [default=yes]
11 %bcond_without libtokyocabinet # Build with libtokyocabinet support [default=on]
12 %bcond_without libmemcached # Build with libmemcached support [default=on]
13 %bcond_without hiredis # Build with hiredis support [default=on]
14 %bcond_without libpq # Build with libpq, ie Postgres, support [default=on]
15 %bcond_without mysql # use MySQL client library [default=yes]
16 %bcond_without postgresql # use PostgreSQL library [default=yes]
17 %bcond_with libdrizzle # Build with libdrizzle support [default=on]
19 # google perftools available only on these
20 %ifnarch %{ix86} x86_64 ppc64 ppc64le aarch64 %{arm}
21 %undefine with_gperftools
24 Summary: A distributed job system
30 Source0: https://launchpad.net/gearmand/1.2/%{version}/+download/%{name}-%{version}.tar.gz
31 # Source0-md5: 99dd0be85b181eccf7fb1ca3c2a28a9f
33 Source2: %{name}.sysconfig
34 Source3: %{name}.service
35 Patch0: %{name}-1.1.12-ppc64le.patch
36 URL: http://www.gearman.org
37 BuildRequires: boost-devel >= 1.37.0
39 %{?with_gperftools:BuildRequires: gperftools-devel}
40 %{?with_hiredis:BuildRequires: hiredis-devel}
41 BuildRequires: libevent-devel
42 %{?with_libmemcached:BuildRequires: libmemcached-devel}
43 BuildRequires: libuuid-devel
44 %{?with_mysql:BuildRequires: mysql-devel}
45 BuildRequires: pkgconfig
46 BuildRequires: postgresql-devel
47 %{?with_libpq:BuildRequires: postgresql-devel}
48 BuildRequires: rpmbuild(macros) >= 1.647
49 %{?with_sqlite3:BuildRequires: sqlite3-devel}
50 %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel}
51 BuildRequires: zlib-devel
53 BuildRequires: curl-devel
54 BuildRequires: mysql-server
56 Requires(post,preun): /sbin/chkconfig
57 Requires(post,preun,postun): systemd-units >= 38
60 Requires: systemd-units >= 0.38
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 # FIXME: add tmpfiles conf
64 %define no_install_post_check_tmpfiles 1
67 Gearman provides a generic framework to farm out work to other
68 machines or dispatch function calls to machines that are better suited
69 to do the work. It allows you to do work in parallel, to load balance
70 processing, and to call functions between languages. It can be used in
71 a variety of applications, from high-availability web sites to the
72 transport for database replication. In other words, it is the nervous
73 system for how distributed processing communicates.
75 %package -n libgearman
76 Summary: Development libraries for gearman
77 Group: Development/Libraries
78 Provides: libgearman-1.0 = %{version}-%{release}
79 Obsoletes: libgearman-1.0 < %{version}-%{release}
80 # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs
81 Requires: e2fsprogs-libs >= 1.39-32
83 %description -n libgearman
84 Development libraries for %{name}.
86 %package -n libgearman-devel
87 Summary: Development headers for libgearman
88 Group: Development/Libraries
89 Requires: libevent-devel
90 Requires: libgearman = %{version}-%{release}
91 Provides: libgearman-1.0-devel = %{version}-%{release}
92 Obsoletes: libgearman-1.0-devel < %{version}-%{release}
94 %description -n libgearman-devel
95 Development headers for %{name}.
103 --disable-silent-rules \
105 %{__enable_disable hiredis} \
106 %{__enable_disable libdrizzle} \
107 %{__enable_disable libmemcached} \
108 %{__enable_disable libpq} \
109 %{__enable_disable libtokyocabinet} \
110 %{__with_without mysql} \
111 %{__with_without postgresql} \
112 %{__with_without sqlite3} \
123 rm -rf $RPM_BUILD_ROOT
125 DESTDIR=$RPM_BUILD_ROOT
127 rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la
129 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
130 $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdunitdir}} \
131 $RPM_BUILD_ROOT/var/{run/gearmand,log}
133 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
134 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
135 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand
136 touch $RPM_BUILD_ROOT/var/log/gearmand.log
139 rm -rf $RPM_BUILD_ROOT
143 %groupadd -r gearmand
144 %useradd -r -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
147 %systemd_post gearmand.service
149 /sbin/chkconfig --add gearmand
151 touch /var/log/gearmand.log
154 %systemd_preun gearmand.service
155 if [ "$1" = 0 ] ; then
156 %service gearmand stop
157 /sbin/chkconfig --del gearmand
161 %systemd_postun_with_restart gearmand.service
164 %post -n libgearman -p /sbin/ldconfig
165 %postun -n libgearman -p /sbin/ldconfig
168 %defattr(644,root,root,755)
170 %attr(754,root,root) /etc/rc.d/init.d/gearmand
171 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
172 %attr(755,root,root) %{_sbindir}/gearmand
173 %attr(755,root,root) %{_bindir}/gearman
174 %attr(755,root,root) %{_bindir}/gearadmin
175 %{_mandir}/man1/gearadmin.1*
176 %{_mandir}/man1/gearman.1*
177 %{_mandir}/man8/gearmand.8*
178 %{systemdunitdir}/%{name}.service
179 %dir %attr(755,gearmand,gearmand) /var/run/gearmand
180 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
183 %defattr(644,root,root,755)
185 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
186 %ghost %{_libdir}/libgearman.so.8
188 %files -n libgearman-devel
189 %defattr(644,root,root,755)
190 %doc AUTHORS ChangeLog
191 %{_includedir}/libgearman
192 %{_pkgconfigdir}/gearmand.pc
193 %{_libdir}/libgearman.so
194 %{_includedir}/libgearman-1.0
195 %{_mandir}/man3/gearman_*
196 %{_mandir}/man3/libgearman.3*