2 # - fix make install linking stuff over again
3 # - skip tests build if testing disabled
7 %bcond_with tests # build with tests
8 %bcond_without gperftools # gperftools
9 %bcond_without sqlite3 # use SQLite 3 library
10 %bcond_without tokyocabinet # libtokyocabinet support
11 %bcond_without memcached # libmemcached support
12 %bcond_without hiredis # hiredis support
13 %bcond_without pgsql # PostgreSQL support via libpq
14 %bcond_without mysql # MySQL client library
15 %bcond_with libdrizzle # libdrizzle support
17 # google perftools available only on these
18 %ifnarch %{ix86} %{x8664} ppc64 ppc64le aarch64 %{arm}
19 %undefine with_gperftools
22 Summary: A distributed job system
23 Summary(pl.UTF-8): System do rozpraszania zadań
29 #Source0Download: https://github.com/gearman/gearmand/releases
30 Source0: https://github.com/gearman/gearmand/archive/%{version}/%{name}-%{version}.tar.gz
31 # Source0-md5: 0c86283d6b82c390659d2bd7de6a9e1b
33 Source2: %{name}.sysconfig
34 Source3: %{name}.service
37 URL: http://www.gearman.org
38 BuildRequires: autoconf >= 2.63
39 BuildRequires: autoconf-archive
40 BuildRequires: automake >= 1:1.11
41 BuildRequires: boost-devel >= 1.39
43 %{?with_gperftools:BuildRequires: gperftools-devel}
44 %{?with_hiredis:BuildRequires: hiredis-devel}
45 BuildRequires: libevent-devel
46 %{?with_memcached:BuildRequires: libmemcached-devel}
47 BuildRequires: libstdc++-devel >= 6:4.3
48 BuildRequires: libtool >= 2:2.2
49 BuildRequires: libuuid-devel
50 %{?with_mysql:BuildRequires: mysql-devel}
51 BuildRequires: openssl-devel
52 BuildRequires: pkgconfig
53 %{?with_pgsql:BuildRequires: postgresql-devel}
54 BuildRequires: rpmbuild(macros) >= 1.647
55 BuildRequires: sphinx-pdg >= 1.0
56 %{?with_sqlite3:BuildRequires: sqlite3-devel}
57 %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel}
58 BuildRequires: zlib-devel
60 BuildRequires: curl-devel >= 7.21.7
61 BuildRequires: mysql-server
63 Provides: group(gearmand)
64 Provides: user(gearmand)
65 Requires(post,preun): /sbin/chkconfig
66 Requires(post,preun,postun): systemd-units >= 38
67 Requires(postun): /usr/sbin/groupdel
68 Requires(postun): /usr/sbin/userdel
69 Requires(pre): /bin/id
70 Requires(pre): /usr/bin/getgid
71 Requires(pre): /usr/sbin/groupadd
72 Requires(pre): /usr/sbin/useradd
73 Requires: libgearman = %{version}-%{release}
75 Requires: rc-scripts >= 0.4.0.17
76 Requires: systemd-units >= 0.38
77 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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 %description -l pl.UTF-8
89 Gearman zapewnia ogólny szkielet do rozpraszania zadań na inne maszyny
90 lub ekspediowania wywołań funkcji na maszyny lepiej przystosowane do
91 danego zadania. Pozwala wykonywać zadania równolegle, równoważyć
92 obciążenie oraz wykonywać wywołania funkcji między językami. Może być
93 używany w wielu zastosowaniach, od wysoko dostępnych storn WWW do
94 transportu na potrzeby replikacji bazy danych. Innymi słowy, jest to
95 układ nerwowy, zapewniający komunikację przy przetwarzaniu
98 %package -n libgearman
99 Summary: Shared gearman library
100 Summary(pl.UTF-8): Biblioteka współdzielona gearman
102 Provides: libgearman-1.0 = %{version}-%{release}
103 Obsoletes: libgearman-1.0 < %{version}-%{release}
104 # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs
105 Requires: e2fsprogs-libs >= 1.39-32
107 %description -n libgearman
108 Shared gearman library.
110 %description -n libgearman -l pl.UTF-8
111 Biblioteka współdzielona gearman.
113 %package -n libgearman-devel
114 Summary: Development headers for libgearman
115 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgearman
116 Group: Development/Libraries
117 Requires: libevent-devel
118 Requires: libgearman = %{version}-%{release}
119 Provides: libgearman-1.0-devel = %{version}-%{release}
120 Obsoletes: libgearman-1.0-devel < %{version}-%{release}
122 %description -n libgearman-devel
123 Development headers for libgearman.
125 %description -n libgearman-devel -l pl.UTF-8
126 Pliki nagłówkowe biblioteki libgearman.
135 echo "m4_define([VERSION_NUMBER], %{version})" > version.m4
144 --disable-silent-rules \
146 %{__enable_disable hiredis} \
147 %{__enable_disable libdrizzle} \
148 %{__enable_disable memcached libmemcached} \
149 %{__enable_disable pgsql libpq} \
150 %{__enable_disable tokyocabinet libtokyocabinet} \
151 %{__with_without mysql} \
152 %{__with_without sqlite3} \
156 %{__make} -C docs -j1
164 rm -rf $RPM_BUILD_ROOT
167 DESTDIR=$RPM_BUILD_ROOT
169 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgearman*.la
171 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
172 $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdunitdir},%{systemdtmpfilesdir}} \
173 $RPM_BUILD_ROOT/var/{log,run/gearmand}
175 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
176 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
177 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand
178 touch $RPM_BUILD_ROOT/var/log/gearmand.log
180 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/gearmand.conf <<EOF
181 d /var/run/gearmand 0771 root gearmand -
185 rm -rf $RPM_BUILD_ROOT
188 %groupadd -g 328 gearmand
189 %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
192 test -e /var/log/gearmand.log || touch /var/log/gearmand.log
193 /sbin/chkconfig --add gearmand
194 %service gearmand restart
195 %systemd_post gearmand.service
198 if [ "$1" = 0 ] ; then
199 %service gearmand stop
200 /sbin/chkconfig --del gearmand
202 %systemd_preun gearmand.service
206 if [ "$1" = "0" ]; then
208 %groupremove gearmand
211 %post -n libgearman -p /sbin/ldconfig
212 %postun -n libgearman -p /sbin/ldconfig
215 %defattr(644,root,root,755)
217 %attr(754,root,root) /etc/rc.d/init.d/gearmand
218 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
219 %attr(755,root,root) %{_sbindir}/gearmand
220 %attr(755,root,root) %{_bindir}/gearman
221 %attr(755,root,root) %{_bindir}/gearadmin
222 %{_mandir}/man1/gearadmin.1*
223 %{_mandir}/man1/gearman.1*
224 %{_mandir}/man8/gearmand.8*
225 %{systemdunitdir}/%{name}.service
226 %{systemdtmpfilesdir}/gearmand.conf
227 %dir %attr(771,root,gearmand) /var/run/gearmand
228 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
231 %defattr(644,root,root,755)
232 %doc AUTHORS COPYING ChangeLog
233 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
234 %attr(755,root,root) %ghost %{_libdir}/libgearman.so.8
236 %files -n libgearman-devel
237 %defattr(644,root,root,755)
238 %attr(755,root,root) %{_libdir}/libgearman.so
239 %{_includedir}/libgearman
240 %{_includedir}/libgearman-1.0
241 %{_pkgconfigdir}/gearmand.pc
242 %{_mandir}/man3/gearman_*.3*
243 %{_mandir}/man3/libgearman.3*