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