2 # - fix make install linking stuff over again
3 # - skip tests build if testing disabled
4 # - libpq vs postgresql, which one matters?
7 %bcond_with tests # build with tests
8 %bcond_without gperftools # gperftools
9 %bcond_without sqlite3 # use SQLite 3 library [default=yes]
10 %bcond_without libtokyocabinet # Build with libtokyocabinet support [default=on]
11 %bcond_without libmemcached # Build with libmemcached support [default=on]
12 %bcond_without hiredis # Build with hiredis support [default=on]
13 %bcond_without libpq # Build with libpq, ie Postgres, support [default=on]
14 %bcond_without mysql # use MySQL client library [default=yes]
15 %bcond_without postgresql # use PostgreSQL library [default=yes]
16 %bcond_with libdrizzle # Build with libdrizzle support [default=on]
18 # google perftools available only on these
19 %ifnarch %{ix86} x86_64 ppc64 ppc64le aarch64 %{arm}
20 %undefine with_gperftools
23 Summary: A distributed job system
29 Source0: https://launchpad.net/gearmand/1.2/%{version}/+download/%{name}-%{version}.tar.gz
30 # Source0-md5: 99dd0be85b181eccf7fb1ca3c2a28a9f
32 Source2: %{name}.sysconfig
33 Source3: %{name}.service
34 Patch0: %{name}-1.1.12-ppc64le.patch
35 URL: http://www.gearman.org
36 BuildRequires: boost-devel >= 1.37.0
38 %{?with_gperftools:BuildRequires: gperftools-devel}
39 %{?with_hiredis:BuildRequires: hiredis-devel}
40 BuildRequires: libevent-devel
41 %{?with_libmemcached:BuildRequires: libmemcached-devel}
42 BuildRequires: libuuid-devel
43 %{?with_mysql:BuildRequires: mysql-devel}
44 BuildRequires: pkgconfig
45 BuildRequires: postgresql-devel
46 %{?with_libpq:BuildRequires: postgresql-devel}
47 BuildRequires: rpmbuild(macros) >= 1.647
48 %{?with_sqlite3:BuildRequires: sqlite3-devel}
49 %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel}
50 BuildRequires: zlib-devel
52 BuildRequires: curl-devel
53 BuildRequires: mysql-server
55 Provides: group(gearmand)
56 Provides: user(gearmand)
57 Requires(post,preun): /sbin/chkconfig
58 Requires(post,preun,postun): systemd-units >= 38
59 Requires(postun): /usr/sbin/groupdel
60 Requires(postun): /usr/sbin/userdel
61 Requires(pre): /bin/id
62 Requires(pre): /usr/bin/getgid
63 Requires(pre): /usr/sbin/groupadd
64 Requires(pre): /usr/sbin/useradd
66 Requires: rc-scripts >= 0.4.0.17
67 Requires: systemd-units >= 0.38
68 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70 # FIXME: add tmpfiles conf
71 %define no_install_post_check_tmpfiles 1
74 Gearman provides a generic framework to farm out work to other
75 machines or dispatch function calls to machines that are better suited
76 to do the work. It allows you to do work in parallel, to load balance
77 processing, and to call functions between languages. It can be used in
78 a variety of applications, from high-availability web sites to the
79 transport for database replication. In other words, it is the nervous
80 system for how distributed processing communicates.
82 %package -n libgearman
83 Summary: Development libraries for gearman
84 Group: Development/Libraries
85 Provides: libgearman-1.0 = %{version}-%{release}
86 Obsoletes: libgearman-1.0 < %{version}-%{release}
87 # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs
88 Requires: e2fsprogs-libs >= 1.39-32
90 %description -n libgearman
91 Development libraries for %{name}.
93 %package -n libgearman-devel
94 Summary: Development headers for libgearman
95 Group: Development/Libraries
96 Requires: libevent-devel
97 Requires: libgearman = %{version}-%{release}
98 Provides: libgearman-1.0-devel = %{version}-%{release}
99 Obsoletes: libgearman-1.0-devel < %{version}-%{release}
101 %description -n libgearman-devel
102 Development headers for %{name}.
110 --disable-silent-rules \
112 %{__enable_disable hiredis} \
113 %{__enable_disable libdrizzle} \
114 %{__enable_disable libmemcached} \
115 %{__enable_disable libpq} \
116 %{__enable_disable libtokyocabinet} \
117 %{__with_without mysql} \
118 %{__with_without postgresql} \
119 %{__with_without sqlite3} \
130 rm -rf $RPM_BUILD_ROOT
132 DESTDIR=$RPM_BUILD_ROOT
134 rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la
136 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
137 $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdunitdir}} \
138 $RPM_BUILD_ROOT/var/{run/gearmand,log}
140 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
141 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
142 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand
143 touch $RPM_BUILD_ROOT/var/log/gearmand.log
146 rm -rf $RPM_BUILD_ROOT
149 %groupadd -g 328 gearmand
150 %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
153 test -e /var/log/gearmand.log || touch /var/log/gearmand.log
154 /sbin/chkconfig --add gearmand
155 %service gearmand restart
156 %systemd_post gearmand.service
159 if [ "$1" = 0 ] ; then
160 %service gearmand stop
161 /sbin/chkconfig --del gearmand
163 %systemd_preun gearmand.service
167 if [ "$1" = "0" ]; then
169 %groupremove gearmand
172 %post -n libgearman -p /sbin/ldconfig
173 %postun -n libgearman -p /sbin/ldconfig
176 %defattr(644,root,root,755)
178 %attr(754,root,root) /etc/rc.d/init.d/gearmand
179 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
180 %attr(755,root,root) %{_sbindir}/gearmand
181 %attr(755,root,root) %{_bindir}/gearman
182 %attr(755,root,root) %{_bindir}/gearadmin
183 %{_mandir}/man1/gearadmin.1*
184 %{_mandir}/man1/gearman.1*
185 %{_mandir}/man8/gearmand.8*
186 %{systemdunitdir}/%{name}.service
187 %dir %attr(771,root,gearmand) /var/run/gearmand
188 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
191 %defattr(644,root,root,755)
193 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
194 %ghost %{_libdir}/libgearman.so.8
196 %files -n libgearman-devel
197 %defattr(644,root,root,755)
198 %doc AUTHORS ChangeLog
199 %{_includedir}/libgearman
200 %{_pkgconfigdir}/gearmand.pc
201 %{_libdir}/libgearman.so
202 %{_includedir}/libgearman-1.0
203 %{_mandir}/man3/gearman_*
204 %{_mandir}/man3/libgearman.3*