]>
Commit | Line | Data |
---|---|---|
36bbbd00 ER |
1 | # TODO |
2 | # - fix make install linking stuff over again | |
3 | # - skip tests build if testing disabled | |
586943c9 | 4 | # - logrotate |
36bbbd00 ER |
5 | # |
6 | # Conditional build: | |
7 | %bcond_with tests # build with tests | |
8 | %bcond_without gperftools # gperftools | |
a5013be6 JB |
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 | |
36bbbd00 ER |
16 | |
17 | # google perftools available only on these | |
a5013be6 | 18 | %ifnarch %{ix86} %{x8664} ppc64 ppc64le aarch64 %{arm} |
36bbbd00 ER |
19 | %undefine with_gperftools |
20 | %endif | |
21 | ||
36bbbd00 | 22 | Summary: A distributed job system |
6809ddf2 | 23 | Summary(pl.UTF-8): System do rozpraszania zadań |
36bbbd00 | 24 | Name: gearmand |
6809ddf2 | 25 | Version: 1.1.19.1 |
758fff35 | 26 | Release: 3 |
36bbbd00 ER |
27 | License: BSD |
28 | Group: Daemons | |
6809ddf2 | 29 | #Source0Download: https://github.com/gearman/gearmand/releases |
aa7b9951 | 30 | Source0: https://github.com/gearman/gearmand/archive/%{version}/%{name}-%{version}.tar.gz |
6809ddf2 | 31 | # Source0-md5: 0c86283d6b82c390659d2bd7de6a9e1b |
36bbbd00 ER |
32 | Source1: %{name}.init |
33 | Source2: %{name}.sysconfig | |
34 | Source3: %{name}.service | |
aa7b9951 | 35 | Patch0: no-git.patch |
8bcbf8d9 | 36 | Patch1: x32.patch |
36bbbd00 | 37 | URL: http://www.gearman.org |
a5013be6 | 38 | BuildRequires: autoconf >= 2.63 |
89dddf3f | 39 | BuildRequires: autoconf-archive |
a5013be6 JB |
40 | BuildRequires: automake >= 1:1.11 |
41 | BuildRequires: boost-devel >= 1.39 | |
36bbbd00 ER |
42 | BuildRequires: gperf |
43 | %{?with_gperftools:BuildRequires: gperftools-devel} | |
9ea1c03f | 44 | %{?with_hiredis:BuildRequires: hiredis-devel} |
36bbbd00 | 45 | BuildRequires: libevent-devel |
a5013be6 | 46 | %{?with_memcached:BuildRequires: libmemcached-devel} |
6809ddf2 | 47 | BuildRequires: libstdc++-devel >= 6:4.3 |
a5013be6 | 48 | BuildRequires: libtool >= 2:2.2 |
36bbbd00 | 49 | BuildRequires: libuuid-devel |
9ea1c03f | 50 | %{?with_mysql:BuildRequires: mysql-devel} |
a5013be6 | 51 | BuildRequires: openssl-devel |
a1985fcd | 52 | BuildRequires: pkgconfig |
a5013be6 | 53 | %{?with_pgsql:BuildRequires: postgresql-devel} |
36bbbd00 | 54 | BuildRequires: rpmbuild(macros) >= 1.647 |
6809ddf2 | 55 | BuildRequires: sphinx-pdg >= 1.0 |
9ea1c03f | 56 | %{?with_sqlite3:BuildRequires: sqlite3-devel} |
36bbbd00 ER |
57 | %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel} |
58 | BuildRequires: zlib-devel | |
59 | %if %{with tests} | |
a5013be6 | 60 | BuildRequires: curl-devel >= 7.21.7 |
36bbbd00 ER |
61 | BuildRequires: mysql-server |
62 | %endif | |
67ee18f3 ER |
63 | Provides: group(gearmand) |
64 | Provides: user(gearmand) | |
36bbbd00 ER |
65 | Requires(post,preun): /sbin/chkconfig |
66 | Requires(post,preun,postun): systemd-units >= 38 | |
67ee18f3 ER |
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 | |
6809ddf2 | 73 | Requires: libgearman = %{version}-%{release} |
36bbbd00 | 74 | Requires: procps |
ca65ef86 | 75 | Requires: rc-scripts >= 0.4.0.17 |
36bbbd00 ER |
76 | Requires: systemd-units >= 0.38 |
77 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
78 | ||
36bbbd00 ER |
79 | %description |
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. | |
87 | ||
6809ddf2 JB |
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 | |
96 | rozproszonym. | |
97 | ||
36bbbd00 | 98 | %package -n libgearman |
6809ddf2 JB |
99 | Summary: Shared gearman library |
100 | Summary(pl.UTF-8): Biblioteka współdzielona gearman | |
101 | Group: Libraries | |
36bbbd00 ER |
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 | |
106 | ||
107 | %description -n libgearman | |
6809ddf2 JB |
108 | Shared gearman library. |
109 | ||
110 | %description -n libgearman -l pl.UTF-8 | |
111 | Biblioteka współdzielona gearman. | |
36bbbd00 ER |
112 | |
113 | %package -n libgearman-devel | |
114 | Summary: Development headers for libgearman | |
6809ddf2 | 115 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgearman |
36bbbd00 ER |
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} | |
121 | ||
122 | %description -n libgearman-devel | |
6809ddf2 JB |
123 | Development headers for libgearman. |
124 | ||
125 | %description -n libgearman-devel -l pl.UTF-8 | |
126 | Pliki nagłówkowe biblioteki libgearman. | |
36bbbd00 ER |
127 | |
128 | %prep | |
129 | %setup -q | |
130 | %patch0 -p1 | |
8bcbf8d9 JR |
131 | %ifarch x32 |
132 | %patch1 -p1 | |
133 | %endif | |
36bbbd00 | 134 | |
aa7b9951 | 135 | echo "m4_define([VERSION_NUMBER], %{version})" > version.m4 |
89dddf3f | 136 | |
36bbbd00 | 137 | %build |
89dddf3f | 138 | %{__libtoolize} |
aa7b9951 | 139 | %{__aclocal} |
89dddf3f | 140 | %{__autoconf} |
aa7b9951 JR |
141 | %{__autoheader} |
142 | %{__automake} | |
36bbbd00 ER |
143 | %configure \ |
144 | --disable-silent-rules \ | |
145 | --disable-static \ | |
9ea1c03f ER |
146 | %{__enable_disable hiredis} \ |
147 | %{__enable_disable libdrizzle} \ | |
a5013be6 JB |
148 | %{__enable_disable memcached libmemcached} \ |
149 | %{__enable_disable pgsql libpq} \ | |
150 | %{__enable_disable tokyocabinet libtokyocabinet} \ | |
9ea1c03f | 151 | %{__with_without mysql} \ |
9ea1c03f ER |
152 | %{__with_without sqlite3} \ |
153 | --enable-ssl \ | |
154 | --disable-dtrace | |
36bbbd00 | 155 | |
aa7b9951 JR |
156 | %{__make} -C docs -j1 |
157 | %{__make} -j1 | |
36bbbd00 ER |
158 | |
159 | %if %{with tests} | |
160 | %{__make} check | |
161 | %endif | |
162 | ||
163 | %install | |
164 | rm -rf $RPM_BUILD_ROOT | |
6809ddf2 | 165 | |
36bbbd00 ER |
166 | %{__make} install \ |
167 | DESTDIR=$RPM_BUILD_ROOT | |
168 | ||
6809ddf2 | 169 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgearman*.la |
36bbbd00 | 170 | |
364c2c1a | 171 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \ |
6809ddf2 JB |
172 | $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdunitdir},%{systemdtmpfilesdir}} \ |
173 | $RPM_BUILD_ROOT/var/{log,run/gearmand} | |
36bbbd00 | 174 | |
364c2c1a | 175 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand |
36bbbd00 | 176 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service |
364c2c1a | 177 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand |
36bbbd00 ER |
178 | touch $RPM_BUILD_ROOT/var/log/gearmand.log |
179 | ||
6809ddf2 JB |
180 | cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/gearmand.conf <<EOF |
181 | d /var/run/gearmand 0771 root gearmand - | |
182 | EOF | |
183 | ||
36bbbd00 ER |
184 | %clean |
185 | rm -rf $RPM_BUILD_ROOT | |
186 | ||
36bbbd00 | 187 | %pre |
67ee18f3 ER |
188 | %groupadd -g 328 gearmand |
189 | %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand | |
36bbbd00 ER |
190 | |
191 | %post | |
7d24d356 ER |
192 | test -e /var/log/gearmand.log || touch /var/log/gearmand.log |
193 | /sbin/chkconfig --add gearmand | |
194 | %service gearmand restart | |
36bbbd00 | 195 | %systemd_post gearmand.service |
36bbbd00 ER |
196 | |
197 | %preun | |
36bbbd00 ER |
198 | if [ "$1" = 0 ] ; then |
199 | %service gearmand stop | |
200 | /sbin/chkconfig --del gearmand | |
201 | fi | |
7d24d356 | 202 | %systemd_preun gearmand.service |
36bbbd00 ER |
203 | |
204 | %postun | |
7d24d356 | 205 | %systemd_reload |
67ee18f3 ER |
206 | if [ "$1" = "0" ]; then |
207 | %userremove gearmand | |
208 | %groupremove gearmand | |
209 | fi | |
210 | ||
36bbbd00 ER |
211 | %post -n libgearman -p /sbin/ldconfig |
212 | %postun -n libgearman -p /sbin/ldconfig | |
213 | ||
214 | %files | |
215 | %defattr(644,root,root,755) | |
aa7b9951 | 216 | %doc README.md |
364c2c1a | 217 | %attr(754,root,root) /etc/rc.d/init.d/gearmand |
36bbbd00 ER |
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 | |
364c2c1a ER |
222 | %{_mandir}/man1/gearadmin.1* |
223 | %{_mandir}/man1/gearman.1* | |
224 | %{_mandir}/man8/gearmand.8* | |
36bbbd00 | 225 | %{systemdunitdir}/%{name}.service |
6809ddf2 | 226 | %{systemdtmpfilesdir}/gearmand.conf |
4b3195b4 | 227 | %dir %attr(771,root,gearmand) /var/run/gearmand |
364c2c1a | 228 | %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log |
36bbbd00 ER |
229 | |
230 | %files -n libgearman | |
231 | %defattr(644,root,root,755) | |
6809ddf2 | 232 | %doc AUTHORS COPYING ChangeLog |
36bbbd00 | 233 | %attr(755,root,root) %{_libdir}/libgearman.so.*.*.* |
6809ddf2 | 234 | %attr(755,root,root) %ghost %{_libdir}/libgearman.so.8 |
36bbbd00 ER |
235 | |
236 | %files -n libgearman-devel | |
237 | %defattr(644,root,root,755) | |
6809ddf2 | 238 | %attr(755,root,root) %{_libdir}/libgearman.so |
364c2c1a | 239 | %{_includedir}/libgearman |
36bbbd00 | 240 | %{_includedir}/libgearman-1.0 |
6809ddf2 JB |
241 | %{_pkgconfigdir}/gearmand.pc |
242 | %{_mandir}/man3/gearman_*.3* | |
364c2c1a | 243 | %{_mandir}/man3/libgearman.3* |