]>
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 | |
27 | Version: 1.1.12 | |
3c05cb35 | 28 | Release: 5 |
36bbbd00 ER |
29 | License: BSD |
30 | Group: Daemons | |
31 | Source0: https://launchpad.net/gearmand/1.2/%{version}/+download/%{name}-%{version}.tar.gz | |
32 | # Source0-md5: 99dd0be85b181eccf7fb1ca3c2a28a9f | |
33 | Source1: %{name}.init | |
34 | Source2: %{name}.sysconfig | |
35 | Source3: %{name}.service | |
36 | Patch0: %{name}-1.1.12-ppc64le.patch | |
37 | URL: http://www.gearman.org | |
89dddf3f ER |
38 | BuildRequires: autoconf |
39 | BuildRequires: autoconf-archive | |
40 | BuildRequires: automake | |
36bbbd00 | 41 | BuildRequires: boost-devel >= 1.37.0 |
36bbbd00 ER |
42 | BuildRequires: gperf |
43 | %{?with_gperftools:BuildRequires: gperftools-devel} | |
9ea1c03f | 44 | %{?with_hiredis:BuildRequires: hiredis-devel} |
36bbbd00 | 45 | BuildRequires: libevent-devel |
9ea1c03f | 46 | %{?with_libmemcached:BuildRequires: libmemcached-devel} |
89dddf3f | 47 | BuildRequires: libtool |
36bbbd00 | 48 | BuildRequires: libuuid-devel |
9ea1c03f | 49 | %{?with_mysql:BuildRequires: mysql-devel} |
a1985fcd | 50 | BuildRequires: pkgconfig |
36bbbd00 | 51 | BuildRequires: postgresql-devel |
9ea1c03f | 52 | %{?with_libpq:BuildRequires: postgresql-devel} |
36bbbd00 | 53 | BuildRequires: rpmbuild(macros) >= 1.647 |
9ea1c03f | 54 | %{?with_sqlite3:BuildRequires: sqlite3-devel} |
36bbbd00 ER |
55 | %{?with_tokyocabinet:BuildRequires: tokyocabinet-devel} |
56 | BuildRequires: zlib-devel | |
57 | %if %{with tests} | |
58 | BuildRequires: curl-devel | |
59 | BuildRequires: mysql-server | |
60 | %endif | |
67ee18f3 ER |
61 | Provides: group(gearmand) |
62 | Provides: user(gearmand) | |
36bbbd00 ER |
63 | Requires(post,preun): /sbin/chkconfig |
64 | Requires(post,preun,postun): systemd-units >= 38 | |
67ee18f3 ER |
65 | Requires(postun): /usr/sbin/groupdel |
66 | Requires(postun): /usr/sbin/userdel | |
67 | Requires(pre): /bin/id | |
68 | Requires(pre): /usr/bin/getgid | |
69 | Requires(pre): /usr/sbin/groupadd | |
70 | Requires(pre): /usr/sbin/useradd | |
36bbbd00 | 71 | Requires: procps |
ca65ef86 | 72 | Requires: rc-scripts >= 0.4.0.17 |
36bbbd00 ER |
73 | Requires: systemd-units >= 0.38 |
74 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
75 | ||
76 | # FIXME: add tmpfiles conf | |
77 | %define no_install_post_check_tmpfiles 1 | |
78 | ||
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 | ||
88 | %package -n libgearman | |
89 | Summary: Development libraries for gearman | |
90 | Group: Development/Libraries | |
91 | Provides: libgearman-1.0 = %{version}-%{release} | |
92 | Obsoletes: libgearman-1.0 < %{version}-%{release} | |
93 | # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs | |
94 | Requires: e2fsprogs-libs >= 1.39-32 | |
95 | ||
96 | %description -n libgearman | |
97 | Development libraries for %{name}. | |
98 | ||
99 | %package -n libgearman-devel | |
100 | Summary: Development headers for libgearman | |
101 | Group: Development/Libraries | |
102 | Requires: libevent-devel | |
103 | Requires: libgearman = %{version}-%{release} | |
104 | Provides: libgearman-1.0-devel = %{version}-%{release} | |
105 | Obsoletes: libgearman-1.0-devel < %{version}-%{release} | |
106 | ||
107 | %description -n libgearman-devel | |
108 | Development headers for %{name}. | |
109 | ||
110 | %prep | |
111 | %setup -q | |
112 | %patch0 -p1 | |
113 | ||
89dddf3f ER |
114 | cp -p %{_aclocaldir}/ax_boost_base.m4 m4 |
115 | cp -p %{_aclocaldir}/ax_boost_program_options.m4 m4 | |
116 | ||
117 | # somewhy it does not look into build-aux | |
118 | ln -s build-aux/install-sh . | |
119 | ||
36bbbd00 | 120 | %build |
89dddf3f ER |
121 | %{__libtoolize} |
122 | %{__aclocal} -I m4 | |
123 | %{__automake} | |
124 | %{__autoconf} | |
36bbbd00 ER |
125 | %configure \ |
126 | --disable-silent-rules \ | |
127 | --disable-static \ | |
9ea1c03f ER |
128 | %{__enable_disable hiredis} \ |
129 | %{__enable_disable libdrizzle} \ | |
130 | %{__enable_disable libmemcached} \ | |
131 | %{__enable_disable libpq} \ | |
132 | %{__enable_disable libtokyocabinet} \ | |
133 | %{__with_without mysql} \ | |
134 | %{__with_without postgresql} \ | |
135 | %{__with_without sqlite3} \ | |
136 | --enable-ssl \ | |
137 | --disable-dtrace | |
36bbbd00 ER |
138 | |
139 | %{__make} | |
140 | ||
141 | %if %{with tests} | |
142 | %{__make} check | |
143 | %endif | |
144 | ||
145 | %install | |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | %{__make} install \ | |
148 | DESTDIR=$RPM_BUILD_ROOT | |
149 | ||
150 | rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la | |
151 | ||
364c2c1a ER |
152 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \ |
153 | $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdunitdir}} \ | |
154 | $RPM_BUILD_ROOT/var/{run/gearmand,log} | |
36bbbd00 | 155 | |
364c2c1a | 156 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand |
36bbbd00 | 157 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service |
364c2c1a | 158 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand |
36bbbd00 ER |
159 | touch $RPM_BUILD_ROOT/var/log/gearmand.log |
160 | ||
36bbbd00 ER |
161 | %clean |
162 | rm -rf $RPM_BUILD_ROOT | |
163 | ||
36bbbd00 | 164 | %pre |
67ee18f3 ER |
165 | %groupadd -g 328 gearmand |
166 | %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand | |
36bbbd00 ER |
167 | |
168 | %post | |
7d24d356 ER |
169 | test -e /var/log/gearmand.log || touch /var/log/gearmand.log |
170 | /sbin/chkconfig --add gearmand | |
171 | %service gearmand restart | |
36bbbd00 | 172 | %systemd_post gearmand.service |
36bbbd00 ER |
173 | |
174 | %preun | |
36bbbd00 ER |
175 | if [ "$1" = 0 ] ; then |
176 | %service gearmand stop | |
177 | /sbin/chkconfig --del gearmand | |
178 | fi | |
7d24d356 | 179 | %systemd_preun gearmand.service |
36bbbd00 ER |
180 | |
181 | %postun | |
7d24d356 | 182 | %systemd_reload |
67ee18f3 ER |
183 | if [ "$1" = "0" ]; then |
184 | %userremove gearmand | |
185 | %groupremove gearmand | |
186 | fi | |
187 | ||
36bbbd00 ER |
188 | %post -n libgearman -p /sbin/ldconfig |
189 | %postun -n libgearman -p /sbin/ldconfig | |
190 | ||
191 | %files | |
192 | %defattr(644,root,root,755) | |
193 | %doc README | |
364c2c1a | 194 | %attr(754,root,root) /etc/rc.d/init.d/gearmand |
36bbbd00 ER |
195 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand |
196 | %attr(755,root,root) %{_sbindir}/gearmand | |
197 | %attr(755,root,root) %{_bindir}/gearman | |
198 | %attr(755,root,root) %{_bindir}/gearadmin | |
364c2c1a ER |
199 | %{_mandir}/man1/gearadmin.1* |
200 | %{_mandir}/man1/gearman.1* | |
201 | %{_mandir}/man8/gearmand.8* | |
36bbbd00 | 202 | %{systemdunitdir}/%{name}.service |
4b3195b4 | 203 | %dir %attr(771,root,gearmand) /var/run/gearmand |
364c2c1a | 204 | %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log |
36bbbd00 ER |
205 | |
206 | %files -n libgearman | |
207 | %defattr(644,root,root,755) | |
208 | %doc COPYING | |
209 | %attr(755,root,root) %{_libdir}/libgearman.so.*.*.* | |
210 | %ghost %{_libdir}/libgearman.so.8 | |
211 | ||
212 | %files -n libgearman-devel | |
213 | %defattr(644,root,root,755) | |
214 | %doc AUTHORS ChangeLog | |
364c2c1a | 215 | %{_includedir}/libgearman |
36bbbd00 ER |
216 | %{_pkgconfigdir}/gearmand.pc |
217 | %{_libdir}/libgearman.so | |
218 | %{_includedir}/libgearman-1.0 | |
364c2c1a ER |
219 | %{_mandir}/man3/gearman_* |
220 | %{_mandir}/man3/libgearman.3* |