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