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