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