2 # - fix make install linking stuff over again
3 # - skip tests build if testing disabled
4 # - add gearman user/group
7 %bcond_with tests # build with tests
8 %bcond_without gperftools # gperftools
9 %bcond_without sqlite # sqlite
10 %bcond_without tokyocabinet # tokyocabinet
11 %bcond_with tcmalloc # tcmalloc
13 # google perftools available only on these
14 %ifnarch %{ix86} x86_64 ppc64 ppc64le aarch64 %{arm}
15 %undefine with_gperftools
19 %undefine with_tcmalloc
22 Summary: A distributed job system
28 Source0: https://launchpad.net/gearmand/1.2/%{version}/+download/%{name}-%{version}.tar.gz
29 # Source0-md5: 99dd0be85b181eccf7fb1ca3c2a28a9f
31 Source2: %{name}.sysconfig
32 Source3: %{name}.service
33 Patch0: %{name}-1.1.12-ppc64le.patch
34 URL: http://www.gearman.org
35 BuildRequires: boost-devel >= 1.37.0
36 BuildRequires: boost-thread
37 BuildRequires: e2fsprogs-devel
39 %{?with_gperftools:BuildRequires: gperftools-devel}
40 BuildRequires: libevent-devel
41 BuildRequires: libmemcached-devel
42 BuildRequires: libuuid-devel
43 #BuildRequires: memcached
44 BuildRequires: mysql-devel
45 BuildRequires: postgresql-devel
46 BuildRequires: rpmbuild(macros) >= 1.647
47 %{?with_sqlite:BuildRequires: sqlite3-devel}
48 BuildRequires: systemd-units
49 %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel}
50 BuildRequires: zlib-devel
52 BuildRequires: curl-devel
53 BuildRequires: mysql-server
55 Requires(post,preun): /sbin/chkconfig
56 Requires(post,preun,postun): systemd-units >= 38
59 Requires: systemd-units >= 0.38
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 # FIXME: add tmpfiles conf
63 %define no_install_post_check_tmpfiles 1
66 Gearman provides a generic framework to farm out work to other
67 machines or dispatch function calls to machines that are better suited
68 to do the work. It allows you to do work in parallel, to load balance
69 processing, and to call functions between languages. It can be used in
70 a variety of applications, from high-availability web sites to the
71 transport for database replication. In other words, it is the nervous
72 system for how distributed processing communicates.
74 %package -n libgearman
75 Summary: Development libraries for gearman
76 Group: Development/Libraries
77 Provides: libgearman-1.0 = %{version}-%{release}
78 Obsoletes: libgearman-1.0 < %{version}-%{release}
79 # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs
80 Requires: e2fsprogs-libs >= 1.39-32
82 %description -n libgearman
83 Development libraries for %{name}.
85 %package -n libgearman-devel
86 Summary: Development headers for libgearman
87 Group: Development/Libraries
88 Requires: libevent-devel
89 Requires: libgearman = %{version}-%{release}
90 Provides: libgearman-1.0-devel = %{version}-%{release}
91 Obsoletes: libgearman-1.0-devel < %{version}-%{release}
93 %description -n libgearman-devel
94 Development headers for %{name}.
101 # HACK to work around boost issues.
102 #export LDFLAGS="%{rpmldflags} LDFLAGS -lboost_system"
105 --disable-silent-rules \
118 rm -rf $RPM_BUILD_ROOT
120 DESTDIR=$RPM_BUILD_ROOT
122 rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la
124 install -p -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
126 # install systemd unit file
127 install -d $RPM_BUILD_ROOT%{systemdunitdir}
128 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
130 # install legacy SysV init script
131 install -p -D %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/gearmand
132 install -d $RPM_BUILD_ROOT/var/run/gearmand
134 install -d $RPM_BUILD_ROOT/var/log
135 touch $RPM_BUILD_ROOT/var/log/gearmand.log
137 install -d $RPM_BUILD_ROOT/var/run/gearmand
140 rm -rf $RPM_BUILD_ROOT
144 %groupadd -r gearmand
145 %useradd -r -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
148 %systemd_post gearmand.service
150 /sbin/chkconfig --add gearmand
152 touch /var/log/gearmand.log
155 %systemd_preun gearmand.service
156 if [ "$1" = 0 ] ; then
157 %service gearmand stop
158 /sbin/chkconfig --del gearmand
162 %systemd_postun_with_restart gearmand.service
165 %post -n libgearman -p /sbin/ldconfig
166 %postun -n libgearman -p /sbin/ldconfig
169 %defattr(644,root,root,755)
171 %attr(755,gearmand,gearmand) /var/run/gearmand
172 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
173 %attr(755,root,root) %{_sbindir}/gearmand
174 %attr(755,root,root) %{_bindir}/gearman
175 %attr(755,root,root) %{_bindir}/gearadmin
178 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
180 %{systemdunitdir}/%{name}.service
182 %{_initrddir}/%{name}
186 %defattr(644,root,root,755)
188 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
189 %ghost %{_libdir}/libgearman.so.8
191 %files -n libgearman-devel
192 %defattr(644,root,root,755)
193 %doc AUTHORS ChangeLog
194 %dir %{_includedir}/libgearman
195 %{_includedir}/libgearman/*.h
196 %{_pkgconfigdir}/gearmand.pc
197 %{_libdir}/libgearman.so
198 %{_includedir}/libgearman-1.0