]> git.pld-linux.org Git - packages/gearmand.git/blob - gearmand.spec
- rebuild with boost 1.63.0
[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.12
28 Release:        5
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:  autoconf
39 BuildRequires:  autoconf-archive
40 BuildRequires:  automake
41 BuildRequires:  boost-devel >= 1.37.0
42 BuildRequires:  gperf
43 %{?with_gperftools:BuildRequires:       gperftools-devel}
44 %{?with_hiredis:BuildRequires:  hiredis-devel}
45 BuildRequires:  libevent-devel
46 %{?with_libmemcached:BuildRequires:     libmemcached-devel}
47 BuildRequires:  libtool
48 BuildRequires:  libuuid-devel
49 %{?with_mysql:BuildRequires:    mysql-devel}
50 BuildRequires:  pkgconfig
51 BuildRequires:  postgresql-devel
52 %{?with_libpq:BuildRequires:    postgresql-devel}
53 BuildRequires:  rpmbuild(macros) >= 1.647
54 %{?with_sqlite3:BuildRequires:  sqlite3-devel}
55 %{?with_tokyocabinet:BuildRequires:     tokyocabinet-devel}
56 BuildRequires:  zlib-devel
57 %if %{with tests}
58 BuildRequires:  curl-devel
59 BuildRequires:  mysql-server
60 %endif
61 Provides:       group(gearmand)
62 Provides:       user(gearmand)
63 Requires(post,preun):   /sbin/chkconfig
64 Requires(post,preun,postun):    systemd-units >= 38
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
71 Requires:       procps
72 Requires:       rc-scripts >= 0.4.0.17
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
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
120 %build
121 %{__libtoolize}
122 %{__aclocal} -I m4
123 %{__automake}
124 %{__autoconf}
125 %configure \
126         --disable-silent-rules \
127         --disable-static \
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
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
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}
155
156 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
157 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
158 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand
159 touch $RPM_BUILD_ROOT/var/log/gearmand.log
160
161 %clean
162 rm -rf $RPM_BUILD_ROOT
163
164 %pre
165 %groupadd -g 328 gearmand
166 %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
167
168 %post
169 test -e /var/log/gearmand.log || touch /var/log/gearmand.log
170 /sbin/chkconfig --add gearmand
171 %service gearmand restart
172 %systemd_post gearmand.service
173
174 %preun
175 if [ "$1" = 0 ] ; then
176         %service gearmand stop
177         /sbin/chkconfig --del gearmand
178 fi
179 %systemd_preun gearmand.service
180
181 %postun
182 %systemd_reload
183 if [ "$1" = "0" ]; then
184         %userremove gearmand
185         %groupremove gearmand
186 fi
187
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
194 %attr(754,root,root) /etc/rc.d/init.d/gearmand
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
199 %{_mandir}/man1/gearadmin.1*
200 %{_mandir}/man1/gearman.1*
201 %{_mandir}/man8/gearmand.8*
202 %{systemdunitdir}/%{name}.service
203 %dir %attr(771,root,gearmand) /var/run/gearmand
204 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
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
215 %{_includedir}/libgearman
216 %{_pkgconfigdir}/gearmand.pc
217 %{_libdir}/libgearman.so
218 %{_includedir}/libgearman-1.0
219 %{_mandir}/man3/gearman_*
220 %{_mandir}/man3/libgearman.3*
This page took 0.098862 seconds and 3 git commands to generate.