forked from nmilford/rpm-memcached
-
Notifications
You must be signed in to change notification settings - Fork 0
/
memcached.spec
278 lines (223 loc) · 6.5 KB
/
memcached.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# To Build:
#
# sudo yum -y install rpmdevtools && rpmdev-setuptree
# sudo yum -y install libevent-devel
# wget http://www.memcached.org/files/memcached-1.4.17.tar.gz -O ~/rpmbuild/SOURCES/memcached-1.4.17.tar.gz
# wget https://raw.github.com/nmilford/rpm-memcached/master/memcached.spec -O ~/rpmbuild/SPECS/memcached.spec
# rpmbuild -bb ~/rpmbuild/SPECS/memcached.spec
### perl-AnyEvent is rfx on EL5, and so memcached must be as well
%{?el5:# Tag: rfx}
### EL6 ships with memcached-1.4.4-3.el6
%{?el6:# Tag: rfx}
%ifarch %{ix86}
%define build_64bit --disable-64bit
%else
%define build_64bit --enable-64bit
%endif
Summary: Distributed memory object caching system
Name: memcached
Version: 1.4.17
Release: 1%{?dist}
License: BSD
Group: System Environment/Daemons
URL: http://memcached.org/
Packager: Nathan Milford <[email protected]>
Source: http://memcached.googlecode.com/files/memcached-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: libevent
BuildRequires: libevent-devel
AutoReqProv: no
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig, /sbin/service
Requires(postun): /sbin/service
%description
memcached is a high-performance, distributed memory object caching system,
generic in nature, but intended for use in speeding up dynamic web
applications by alleviating database load.
%package devel
Group: Development/Tools
Summary: Header files for memcached
%description devel
Install this package if you want to develop programs that link against
memcached.
%prep
%setup
%{__cat} <<EOF >memcached.sysconfig
PORT="11211"
USER="nobody"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""
EOF
%{__cat} <<'EOF' >memcached.sysv
#!/bin/bash
#
# Init file for memcached
#
# Written by Dag Wieërs <[email protected]>
#
# chkconfig: - 80 12
# description: Distributed memory caching daemon
#
# processname: memcached
# config: /etc/sysconfig/memcached
# config: /etc/memcached.conf
source %{_sysconfdir}/rc.d/init.d/functions
### Default variables
PORT="11211"
USER="nobody"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""
SYSCONFIG="%{_sysconfdir}/sysconfig/memcached"
### Read configuration
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
RETVAL=0
prog="memcached"
desc="Distributed memory caching"
start() {
echo -n $"Starting $desc ($prog): "
daemon $prog -d -p $PORT -u $USER -c $MAXCONN -m $CACHESIZE $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch %{_localstatedir}/lock/subsys/$prog
return $RETVAL
}
stop() {
echo -n $"Shutting down $desc ($prog): "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f %{_localstatedir}/lock/subsys/$prog
return $RETVAL
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading $desc ($prog): "
killproc $prog -HUP
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
[ -e %{_localstatedir}/lock/subsys/$prog ] && restart
RETVAL=$?
;;
reload)
reload
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
RETVAL=1
esac
exit $RETVAL
EOF
%build
%configure \
--program-prefix="%{?_program_prefix}" \
--disable-dependency-tracking \
%{build_64bit}
%{__make} %{?_smp_mflags}
%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR="%{buildroot}"
%{__install} -Dp -m0755 memcached.sysv %{buildroot}%{_sysconfdir}/rc.d/init.d/memcached
%{__install} -Dp -m0644 memcached.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/memcached
%{__install} -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}
%{__install} -Dp -m0755 scripts/damemtop %{buildroot}%{_bindir}
%{__install} -Dp -m0644 scripts/damemtop.yaml %{buildroot}%{_sysconfdir}
%post
/sbin/chkconfig --add memcached
%preun
if [ $1 -eq 0 ]; then
/sbin/service memcached stop &> /dev/null || :
/sbin/chkconfig --del memcached
fi
%postun
/sbin/service memcached condrestart &>/dev/null || :
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-, root, root, 0755)
%doc AUTHORS ChangeLog COPYING doc/*.txt scripts/README.damemtop NEWS README.md
%doc %{_mandir}/man?/*
%config(noreplace) %{_sysconfdir}/sysconfig/memcached
%config(noreplace) %{_sysconfdir}/damemtop.yaml
%config %{_initrddir}/memcached
%{_bindir}/damemtop
%{_bindir}/memcached
%{_bindir}/memcached-tool
%files devel
%{_includedir}/memcached
%changelog
* Thu Feb 27 2014 Nathan Milford <[email protected]> - 1.4.17-1
- Updated to 1.4.17
* Fri Jun 28 2013 Nathan Milford <[email protected]> - 1.4.14-1
- Updated to 1.4.14
* Sat Jan 28 2012 Nathan Milford <[email protected]> - 1.4.12-1
- Updated to 1.4.12
* Sat Jan 28 2012 Nathan Milford <[email protected]> - 1.4.11-1
- Updated to 1.4.11.
* Thu Aug 25 2011 Steve Huff <[email protected]> - 1.4.7-1
- Updated to 1.4.7.
- Install damemtop in a sensible place.
* Fri Aug 05 2011 Steve Huff <[email protected]> - 1.4.6-1
- Updated to 1.4.6.
- Tagged as RFX in el5 as well (due to perl-AnyEvent dependency).
* Fri Apr 16 2010 Steve Huff <[email protected]> - 1.4.5-1
- Updated to 1.4.5.
* Wed Mar 31 2010 Steve Huff <[email protected]> - 1.4.4-2
- Rebuild against libevent-1.4.13 on EL5.
* Mon Feb 08 2010 Steve Huff <[email protected]> - 1.4.4-1
- Updated to 1.4.4.
- Split off include files into memcached-devel.
- Install memcached-tool in %{_bindir}, install damemtop in %{_docdir}.
* Wed Aug 20 2008 Michael Best <[email protected]> 1.2.6
- Update to 1.2.6.
* Tue May 29 2007 Matthias Saou <http://freshrpms.net/> 1.2.2-1
- Update to 1.2.2.
- Enable new threads feature.
* Sun Mar 25 2007 Dag Wieers <[email protected]> - 1.2.1-4
- Rebuild against libevent-1.1a on EL5.
* Wed Mar 07 2007 Dag Wieers <[email protected]> - 1.2.1-3
- Rebuild against libevent-1.3b.
* Tue Feb 20 2007 Dag Wieers <[email protected]> - 1.2.1-2
- Rebuild against libevent-1.3a.
* Mon Feb 19 2007 Dag Wieers <[email protected]> - 1.2.1-1
- Updated to release 1.2.1.
* Wed Nov 01 2006 Dag Wieers <[email protected]> - 1.1.13-1
- Updated to release 1.1.13.
* Sat Aug 19 2006 Dag Wieers <[email protected]> - 1.1.12-3
- Rebuild against libevent-1.1b.
* Mon Apr 03 2006 Dag Wieers <[email protected]> - 1.1.12-2
- Rebuild against libevent-1.1a.
* Wed Jan 11 2006 Matthias Saou <http://freshrpms.net/> 1.1.12-1
- Update to 1.1.12.
- Remove no longer needed segfault patch.
- Add Requires(foo):...
- Remove INSTALL from %%doc.
- Don't have the init script be tagged as config, the config part is all in
the sysconfig file.
- make install now works again.
- Fix non working reload in the init script.
* Mon Mar 07 2005 Dag Wieers <[email protected]> - 1.1.11-1
- Cosmetic changes.
* Thu Feb 24 2005 Rob Starkey <[email protected]> - 1.1.11-1
- Initial package.