]>
Commit | Line | Data |
---|---|---|
36bbbd00 ER |
1 | # TODO |
2 | # - fix make install linking stuff over again | |
3 | # - skip tests build if testing disabled | |
9ea1c03f | 4 | # - libpq vs postgresql, which one matters? |
586943c9 ER |
5 | # - tmpfiles conf |
6 | # - logrotate | |
36bbbd00 ER |
7 | # |
8 | # Conditional build: | |
9 | %bcond_with tests # build with tests | |
10 | %bcond_without gperftools # gperftools | |
9ea1c03f ER |
11 | %bcond_without sqlite3 # use SQLite 3 library [default=yes] |
12 | %bcond_without libtokyocabinet # Build with libtokyocabinet support [default=on] | |
13 | %bcond_without libmemcached # Build with libmemcached support [default=on] | |
14 | %bcond_without hiredis # Build with hiredis support [default=on] | |
15 | %bcond_without libpq # Build with libpq, ie Postgres, support [default=on] | |
16 | %bcond_without mysql # use MySQL client library [default=yes] | |
17 | %bcond_without postgresql # use PostgreSQL library [default=yes] | |
18 | %bcond_with libdrizzle # Build with libdrizzle support [default=on] | |
36bbbd00 ER |
19 | |
20 | # google perftools available only on these | |
21 | %ifnarch %{ix86} x86_64 ppc64 ppc64le aarch64 %{arm} | |
22 | %undefine with_gperftools | |
23 | %endif | |
24 | ||
36bbbd00 ER |
25 | Summary: A distributed job system |
26 | Name: gearmand | |
aa7b9951 | 27 | Version: 1.1.18 |
8d63cb2b | 28 | Release: 3 |
36bbbd00 ER |
29 | License: BSD |
30 | Group: Daemons | |
aa7b9951 JR |
31 | Source0: https://github.com/gearman/gearmand/archive/%{version}/%{name}-%{version}.tar.gz |
32 | # Source0-md5: e947647db2a23239cead1c0960f2b5a0 | |
36bbbd00 ER |
33 | Source1: %{name}.init |
34 | Source2: %{name}.sysconfig | |
35 | Source3: %{name}.service | |
aa7b9951 | 36 | Patch0: no-git.patch |
8bcbf8d9 | 37 | Patch1: x32.patch |
36bbbd00 | 38 | URL: http://www.gearman.org |
89dddf3f ER |
39 | BuildRequires: autoconf |
40 | BuildRequires: autoconf-archive | |
41 | BuildRequires: automake | |
36bbbd00 | 42 | BuildRequires: boost-devel >= 1.37.0 |
36bbbd00 ER |
43 | BuildRequires: gperf |
44 | %{?with_gperftools:BuildRequires: gperftools-devel} | |
9ea1c03f | 45 | %{?with_hiredis:BuildRequires: hiredis-devel} |
36bbbd00 | 46 | BuildRequires: libevent-devel |
9ea1c03f | 47 | %{?with_libmemcached:BuildRequires: libmemcached-devel} |
89dddf3f | 48 | BuildRequires: libtool |
36bbbd00 | 49 | BuildRequires: libuuid-devel |
9ea1c03f | 50 | %{?with_mysql:BuildRequires: mysql-devel} |
a1985fcd | 51 | BuildRequires: pkgconfig |
36bbbd00 | 52 | BuildRequires: postgresql-devel |
9ea1c03f | 53 | %{?with_libpq:BuildRequires: postgresql-devel} |
36bbbd00 | 54 | BuildRequires: rpmbuild(macros) >= 1.647 |
9ea1c03f | 55 | %{?with_sqlite3:BuildRequires: sqlite3-devel} |
36bbbd00 ER |
56 | %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel} |
57 | BuildRequires: zlib-devel | |
58 | %if %{with tests} | |
59 | BuildRequires: curl-devel | |
60 | BuildRequires: mysql-server | |
61 | %endif | |
67ee18f3 ER |
62 | Provides: group(gearmand) |
63 | Provides: user(gearmand) | |
36bbbd00 ER |
64 | Requires(post,preun): /sbin/chkconfig |
65 | Requires(post,preun,postun): systemd-units >= 38 | |
67ee18f3 ER |
66 | Requires(postun): /usr/sbin/groupdel |
67 | Requires(postun): /usr/sbin/userdel | |
68 | Requires(pre): /bin/id | |
69 | Requires(pre): /usr/bin/getgid | |
70 | Requires(pre): /usr/sbin/groupadd | |
71 | Requires(pre): /usr/sbin/useradd | |
36bbbd00 | 72 | Requires: procps |
ca65ef86 | 73 | Requires: rc-scripts >= 0.4.0.17 |
36bbbd00 ER |
74 | Requires: systemd-units >= 0.38 |
75 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
76 | ||
77 | # FIXME: add tmpfiles conf | |
78 | %define no_install_post_check_tmpfiles 1 | |
79 | ||
80 | %description | |
81 | Gearman provides a generic framework to farm out work to other | |
82 | machines or dispatch function calls to machines that are better suited | |
83 | to do the work. It allows you to do work in parallel, to load balance | |
84 | processing, and to call functions between languages. It can be used in | |
85 | a variety of applications, from high-availability web sites to the | |
86 | transport for database replication. In other words, it is the nervous | |
87 | system for how distributed processing communicates. | |
88 | ||
89 | %package -n libgearman | |
90 | Summary: Development libraries for gearman | |
91 | Group: Development/Libraries | |
92 | Provides: libgearman-1.0 = %{version}-%{release} | |
93 | Obsoletes: libgearman-1.0 < %{version}-%{release} | |
94 | # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs | |
95 | Requires: e2fsprogs-libs >= 1.39-32 | |
96 | ||
97 | %description -n libgearman | |
98 | Development libraries for %{name}. | |
99 | ||
100 | %package -n libgearman-devel | |
101 | Summary: Development headers for libgearman | |
102 | Group: Development/Libraries | |
103 | Requires: libevent-devel | |
104 | Requires: libgearman = %{version}-%{release} | |
105 | Provides: libgearman-1.0-devel = %{version}-%{release} | |
106 | Obsoletes: libgearman-1.0-devel < %{version}-%{release} | |
107 | ||
108 | %description -n libgearman-devel | |
109 | Development headers for %{name}. | |
110 | ||
111 | %prep | |
112 | %setup -q | |
113 | %patch0 -p1 | |
8bcbf8d9 JR |
114 | %ifarch x32 |
115 | %patch1 -p1 | |
116 | %endif | |
36bbbd00 | 117 | |
aa7b9951 | 118 | echo "m4_define([VERSION_NUMBER], %{version})" > version.m4 |
89dddf3f | 119 | |
36bbbd00 | 120 | %build |
89dddf3f | 121 | %{__libtoolize} |
aa7b9951 | 122 | %{__aclocal} |
89dddf3f | 123 | %{__autoconf} |
aa7b9951 JR |
124 | %{__autoheader} |
125 | %{__automake} | |
36bbbd00 ER |
126 | %configure \ |
127 | --disable-silent-rules \ | |
128 | --disable-static \ | |
9ea1c03f ER |
129 | %{__enable_disable hiredis} \ |
130 | %{__enable_disable libdrizzle} \ | |
131 | %{__enable_disable libmemcached} \ | |
132 | %{__enable_disable libpq} \ | |
133 | %{__enable_disable libtokyocabinet} \ | |
134 | %{__with_without mysql} \ | |
135 | %{__with_without postgresql} \ | |
136 | %{__with_without sqlite3} \ | |
137 | --enable-ssl \ | |
138 | --disable-dtrace | |
36bbbd00 | 139 | |
aa7b9951 JR |
140 | %{__make} -C docs -j1 |
141 | %{__make} -j1 | |
36bbbd00 ER |
142 | |
143 | %if %{with tests} | |
144 | %{__make} check | |
145 | %endif | |
146 | ||
147 | %install | |
148 | rm -rf $RPM_BUILD_ROOT | |
149 | %{__make} install \ | |
150 | DESTDIR=$RPM_BUILD_ROOT | |
151 | ||
152 | rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la | |
153 | ||
364c2c1a ER |
154 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \ |
155 | $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdunitdir}} \ | |
156 | $RPM_BUILD_ROOT/var/{run/gearmand,log} | |
36bbbd00 | 157 | |
364c2c1a | 158 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand |
36bbbd00 | 159 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service |
364c2c1a | 160 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand |
36bbbd00 ER |
161 | touch $RPM_BUILD_ROOT/var/log/gearmand.log |
162 | ||
36bbbd00 ER |
163 | %clean |
164 | rm -rf $RPM_BUILD_ROOT | |
165 | ||
36bbbd00 | 166 | %pre |
67ee18f3 ER |
167 | %groupadd -g 328 gearmand |
168 | %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand | |
36bbbd00 ER |
169 | |
170 | %post | |
7d24d356 ER |
171 | test -e /var/log/gearmand.log || touch /var/log/gearmand.log |
172 | /sbin/chkconfig --add gearmand | |
173 | %service gearmand restart | |
36bbbd00 | 174 | %systemd_post gearmand.service |
36bbbd00 ER |
175 | |
176 | %preun | |
36bbbd00 ER |
177 | if [ "$1" = 0 ] ; then |
178 | %service gearmand stop | |
179 | /sbin/chkconfig --del gearmand | |
180 | fi | |
7d24d356 | 181 | %systemd_preun gearmand.service |
36bbbd00 ER |
182 | |
183 | %postun | |
7d24d356 | 184 | %systemd_reload |
67ee18f3 ER |
185 | if [ "$1" = "0" ]; then |
186 | %userremove gearmand | |
187 | %groupremove gearmand | |
188 | fi | |
189 | ||
36bbbd00 ER |
190 | %post -n libgearman -p /sbin/ldconfig |
191 | %postun -n libgearman -p /sbin/ldconfig | |
192 | ||
193 | %files | |
194 | %defattr(644,root,root,755) | |
aa7b9951 | 195 | %doc README.md |
364c2c1a | 196 | %attr(754,root,root) /etc/rc.d/init.d/gearmand |
36bbbd00 ER |
197 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand |
198 | %attr(755,root,root) %{_sbindir}/gearmand | |
199 | %attr(755,root,root) %{_bindir}/gearman | |
200 | %attr(755,root,root) %{_bindir}/gearadmin | |
364c2c1a ER |
201 | %{_mandir}/man1/gearadmin.1* |
202 | %{_mandir}/man1/gearman.1* | |
203 | %{_mandir}/man8/gearmand.8* | |
36bbbd00 | 204 | %{systemdunitdir}/%{name}.service |
4b3195b4 | 205 | %dir %attr(771,root,gearmand) /var/run/gearmand |
364c2c1a | 206 | %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log |
36bbbd00 ER |
207 | |
208 | %files -n libgearman | |
209 | %defattr(644,root,root,755) | |
210 | %doc COPYING | |
211 | %attr(755,root,root) %{_libdir}/libgearman.so.*.*.* | |
212 | %ghost %{_libdir}/libgearman.so.8 | |
213 | ||
214 | %files -n libgearman-devel | |
215 | %defattr(644,root,root,755) | |
216 | %doc AUTHORS ChangeLog | |
364c2c1a | 217 | %{_includedir}/libgearman |
36bbbd00 ER |
218 | %{_pkgconfigdir}/gearmand.pc |
219 | %{_libdir}/libgearman.so | |
220 | %{_includedir}/libgearman-1.0 | |
364c2c1a ER |
221 | %{_mandir}/man3/gearman_* |
222 | %{_mandir}/man3/libgearman.3* |