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