]> git.pld-linux.org Git - packages/gearmand.git/blob - gearmand.spec
88f1c9369d63973ad39744a34be99f7bebfcea07
[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 #
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
36 BuildRequires:  boost-thread
37 BuildRequires:  e2fsprogs-devel
38 BuildRequires:  gperf
39 %{?with_gperftools:BuildRequires:       gperftools-devel}
40 BuildRequires:  libevent-devel
41 BuildRequires:  libmemcached-devel
42 BuildRequires:  libuuid-devel
43 #BuildRequires: memcached
44 BuildRequires:  mysql-devel
45 BuildRequires:  postgresql-devel
46 BuildRequires:  rpmbuild(macros) >= 1.647
47 %{?with_sqlite:BuildRequires:   sqlite3-devel}
48 BuildRequires:  systemd-units
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 Requires(post,preun):   /sbin/chkconfig
56 Requires(post,preun,postun):    systemd-units >= 38
57 Requires:       procps
58 Requires:       rc-scripts
59 Requires:       systemd-units >= 0.38
60 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61
62 # FIXME: add tmpfiles conf
63 %define         no_install_post_check_tmpfiles  1
64
65 %description
66 Gearman provides a generic framework to farm out work to other
67 machines or dispatch function calls to machines that are better suited
68 to do the work. It allows you to do work in parallel, to load balance
69 processing, and to call functions between languages. It can be used in
70 a variety of applications, from high-availability web sites to the
71 transport for database replication. In other words, it is the nervous
72 system for how distributed processing communicates.
73
74 %package -n libgearman
75 Summary:        Development libraries for gearman
76 Group:          Development/Libraries
77 Provides:       libgearman-1.0 = %{version}-%{release}
78 Obsoletes:      libgearman-1.0 < %{version}-%{release}
79 # gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs
80 Requires:       e2fsprogs-libs >= 1.39-32
81
82 %description -n libgearman
83 Development libraries for %{name}.
84
85 %package -n libgearman-devel
86 Summary:        Development headers for libgearman
87 Group:          Development/Libraries
88 Requires:       libevent-devel
89 Requires:       libgearman = %{version}-%{release}
90 Provides:       libgearman-1.0-devel = %{version}-%{release}
91 Obsoletes:      libgearman-1.0-devel < %{version}-%{release}
92
93 %description -n libgearman-devel
94 Development headers for %{name}.
95
96 %prep
97 %setup -q
98 %patch0 -p1
99
100 %build
101 # HACK to work around boost issues.
102 #export LDFLAGS="%{rpmldflags} LDFLAGS -lboost_system"
103
104 %configure \
105         --disable-silent-rules \
106         --disable-static \
107 %if %{with tcmalloc}
108         --enable-tcmalloc \
109 %endif
110
111 %{__make}
112
113 %if %{with tests}
114 %{__make} check
115 %endif
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119 %{__make} install \
120         DESTDIR=$RPM_BUILD_ROOT
121
122 rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la
123
124 install -p -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand
125
126 # install systemd unit file
127 install -d $RPM_BUILD_ROOT%{systemdunitdir}
128 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
129
130 # install legacy SysV init script
131 install -p -D %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/gearmand
132 install -d $RPM_BUILD_ROOT/var/run/gearmand
133
134 install -d $RPM_BUILD_ROOT/var/log
135 touch $RPM_BUILD_ROOT/var/log/gearmand.log
136
137 install -d $RPM_BUILD_ROOT/var/run/gearmand
138
139 %clean
140 rm -rf $RPM_BUILD_ROOT
141
142 %if 0
143 %pre
144 %groupadd -r gearmand
145 %useradd -r -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand
146
147 %post
148 %systemd_post gearmand.service
149 if [ $1 = 1 ]; then
150         /sbin/chkconfig --add gearmand
151 fi
152 touch /var/log/gearmand.log
153
154 %preun
155 %systemd_preun gearmand.service
156 if [ "$1" = 0 ] ; then
157         %service gearmand stop
158         /sbin/chkconfig --del gearmand
159 fi
160
161 %postun
162 %systemd_postun_with_restart gearmand.service
163 %endif
164
165 %post   -n libgearman -p /sbin/ldconfig
166 %postun -n libgearman -p /sbin/ldconfig
167
168 %files
169 %defattr(644,root,root,755)
170 %doc README
171 %attr(755,gearmand,gearmand) /var/run/gearmand
172 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand
173 %attr(755,root,root) %{_sbindir}/gearmand
174 %attr(755,root,root) %{_bindir}/gearman
175 %attr(755,root,root) %{_bindir}/gearadmin
176 %{_mandir}/man1/*
177 %{_mandir}/man8/*
178 %attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log
179 %if %{with systemd}
180 %{systemdunitdir}/%{name}.service
181 %else
182 %{_initrddir}/%{name}
183 %endif
184
185 %files -n libgearman
186 %defattr(644,root,root,755)
187 %doc COPYING
188 %attr(755,root,root) %{_libdir}/libgearman.so.*.*.*
189 %ghost %{_libdir}/libgearman.so.8
190
191 %files -n libgearman-devel
192 %defattr(644,root,root,755)
193 %doc AUTHORS ChangeLog
194 %dir %{_includedir}/libgearman
195 %{_includedir}/libgearman/*.h
196 %{_pkgconfigdir}/gearmand.pc
197 %{_libdir}/libgearman.so
198 %{_includedir}/libgearman-1.0
199 %{_mandir}/man3/*
This page took 0.091111 seconds and 2 git commands to generate.