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