]> git.pld-linux.org Git - packages/gearmand.git/blob - gearmand.spec
68c1b203157a0fbc4dbfd3fc8ec463f94aaf1dfe
[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 #
6 # Conditional build:
7 %bcond_with     tests           # build with tests
8 %bcond_without  gperftools      # gperftools
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]
17
18 # google perftools available only on these
19 %ifnarch %{ix86} x86_64 ppc64 ppc64le aarch64 %{arm}
20 %undefine       with_gperftools
21 %endif
22
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
37 BuildRequires:  gperf
38 %{?with_gperftools:BuildRequires:       gperftools-devel}
39 %{?with_hiredis:BuildRequires:  hiredis-devel}
40 BuildRequires:  libevent-devel
41 %{?with_libmemcached:BuildRequires:     libmemcached-devel}
42 BuildRequires:  libuuid-devel
43 %{?with_mysql:BuildRequires:    mysql-devel}
44 BuildRequires:  pkgconfig
45 BuildRequires:  postgresql-devel
46 %{?with_libpq:BuildRequires:    postgresql-devel}
47 BuildRequires:  rpmbuild(macros) >= 1.647
48 %{?with_sqlite3:BuildRequires:  sqlite3-devel}
49 %{?with_tokyocabinet:BuildRequires:     tokyocabinet-devel}
50 BuildRequires:  zlib-devel
51 %if %{with tests}
52 BuildRequires:  curl-devel
53 BuildRequires:  mysql-server
54 %endif
55 Provides:       group(gearmand)
56 Provides:       user(gearmand)
57 Requires(post,preun):   /sbin/chkconfig
58 Requires(post,preun,postun):    systemd-units >= 38
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
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
109 %configure \
110         --disable-silent-rules \
111         --disable-static \
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
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
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}
139
140 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
141 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
142 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gearmand
143 touch $RPM_BUILD_ROOT/var/log/gearmand.log
144
145 %clean
146 rm -rf $RPM_BUILD_ROOT
147
148 %pre
149 %groupadd -g 328 gearmand
150 %useradd -u 328 -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
151
152 %if 0
153 %post
154 %systemd_post gearmand.service
155 if [ $1 = 1 ]; then
156         /sbin/chkconfig --add gearmand
157 fi
158 touch /var/log/gearmand.log
159
160 %preun
161 %systemd_preun gearmand.service
162 if [ "$1" = 0 ] ; then
163         %service gearmand stop
164         /sbin/chkconfig --del gearmand
165 fi
166
167 %postun
168 %systemd_postun_with_restart gearmand.service
169 %endif
170
171 %postun
172 if [ "$1" = "0" ]; then
173         %userremove gearmand
174         %groupremove gearmand
175 fi
176
177 %post   -n libgearman -p /sbin/ldconfig
178 %postun -n libgearman -p /sbin/ldconfig
179
180 %files
181 %defattr(644,root,root,755)
182 %doc README
183 %attr(754,root,root) /etc/rc.d/init.d/gearmand
184 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
185 %attr(755,root,root) %{_sbindir}/gearmand
186 %attr(755,root,root) %{_bindir}/gearman
187 %attr(755,root,root) %{_bindir}/gearadmin
188 %{_mandir}/man1/gearadmin.1*
189 %{_mandir}/man1/gearman.1*
190 %{_mandir}/man8/gearmand.8*
191 %{systemdunitdir}/%{name}.service
192 %dir %attr(755,gearmand,gearmand) /var/run/gearmand
193 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
194
195 %files -n libgearman
196 %defattr(644,root,root,755)
197 %doc COPYING
198 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
199 %ghost %{_libdir}/libgearman.so.8
200
201 %files -n libgearman-devel
202 %defattr(644,root,root,755)
203 %doc AUTHORS ChangeLog
204 %{_includedir}/libgearman
205 %{_pkgconfigdir}/gearmand.pc
206 %{_libdir}/libgearman.so
207 %{_includedir}/libgearman-1.0
208 %{_mandir}/man3/gearman_*
209 %{_mandir}/man3/libgearman.3*
This page took 0.081005 seconds and 2 git commands to generate.