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