forked from naver/arcus-memcached
-
Notifications
You must be signed in to change notification settings - Fork 0
/
memcached.spec.in
124 lines (94 loc) · 3.24 KB
/
memcached.spec.in
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
Name: memcached
Version: @VERSION@
Release: @RELEASE@%{?dist}
Summary: High Performance, Distributed Memory Object Cache
Group: System Environment/Daemons
License: BSD
URL: http://www.danga.com/memcached/
Source0: http://memcached.googlecode.com/files/%{name}-@[email protected]
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libevent-devel
BuildRequires: perl(Test::More)
BuildRequires: /usr/bin/prove
Requires: initscripts
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.
%prep
%setup -q -n %{name}-@FULLVERSION@
%build
%configure
make %{?_smp_mflags}
%check
make test
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
# Don't install the .la-files
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
# Perl script for monitoring memcached
install -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool
# Init script
install -Dp -m0755 scripts/memcached.sysv %{buildroot}%{_initrddir}/memcached
# Default configs
mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig
cat <<EOF >%{buildroot}/%{_sysconfdir}/sysconfig/%{name}
PORT="11211"
USER="nobody"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""
EOF
# pid directory
mkdir -p %{buildroot}/%{_localstatedir}/run/memcached
%clean
rm -rf %{buildroot}
%post
/sbin/chkconfig --add %{name}
%preun
if [ "$1" = 0 ] ; then
/sbin/service %{name} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
exit 0
%postun
if [ "$1" -ge 1 ]; then
/sbin/service %{name} condrestart > /dev/null 2>&1
fi
exit 0
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README doc/CONTRIBUTORS doc/*.txt
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%dir %attr(750,nobody,nobody) %{_localstatedir}/run/memcached
%{_bindir}/memcached-tool
%{_bindir}/memcached
%{_mandir}/man1/memcached.1*
%{_initrddir}/memcached
%{_includedir}/memcached
%dir %attr (0755, root, bin) %{_libdir}
%attr (-, root, bin) %{_libdir}/default_engine.so*
%changelog
* Mon Feb 8 2010 Trond Norbye <[email protected]> - 1.4.4-1
- Added the default engine to the package.
* Mon Nov 2 2009 Dormando <[email protected]> - 1.4.3-1
- Fix autogen more.
* Sat Aug 29 2009 Dustin Sallings <[email protected]> - 1.4.1-1
- Autogenerate the version number from tags.
* Wed Jul 4 2007 Paul Lindner <[email protected]> - 1.2.2-5
- Use /var/run/memcached/ directory to hold PID file
* Sat May 12 2007 Paul Lindner <[email protected]> - 1.2.2-4
- Remove tabs from spec file, rpmlint reports no more errors
* Thu May 10 2007 Paul Lindner <[email protected]> - 1.2.2-3
- Enable build-time regression tests
- add dependency on initscripts
- remove memcached-debug (not needed in dist)
- above suggestions from Bernard Johnson
* Mon May 7 2007 Paul Lindner <[email protected]> - 1.2.2-2
- Tidyness improvements suggested by Ruben Kerkhof in bugzilla #238994
* Fri May 4 2007 Paul Lindner <[email protected]> - 1.2.2-1
- Initial spec file created via rpmdev-newspec