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
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
154 %systemd_post gearmand.service
156 /sbin/chkconfig --add gearmand
158 touch /var/log/gearmand.log
161 %systemd_preun gearmand.service
162 if [ "$1" = 0 ] ; then
163 %service gearmand stop
164 /sbin/chkconfig --del gearmand
168 %systemd_postun_with_restart gearmand.service
172 if [ "$1" = "0" ]; then
174 %groupremove gearmand
177 %post -n libgearman -p /sbin/ldconfig
178 %postun -n libgearman -p /sbin/ldconfig
181 %defattr(644,root,root,755)
183 %attr(754,root,root) /etc/rc.d/init.d/gearmand
184 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
185 %attr(755,root,root) %{_sbindir}/gearmand
186 %attr(755,root,root) %{_bindir}/gearman
187 %attr(755,root,root) %{_bindir}/gearadmin
188 %{_mandir}/man1/gearadmin.1*
189 %{_mandir}/man1/gearman.1*
190 %{_mandir}/man8/gearmand.8*
191 %{systemdunitdir}/%{name}.service
192 %dir %attr(755,gearmand,gearmand) /var/run/gearmand
193 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
196 %defattr(644,root,root,755)
198 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
199 %ghost %{_libdir}/libgearman.so.8
201 %files -n libgearman-devel
202 %defattr(644,root,root,755)
203 %doc AUTHORS ChangeLog
204 %{_includedir}/libgearman
205 %{_pkgconfigdir}/gearmand.pc
206 %{_libdir}/libgearman.so
207 %{_includedir}/libgearman-1.0
208 %{_mandir}/man3/gearman_*
209 %{_mandir}/man3/libgearman.3*