forked from memcached/memcached
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rpm spec file, new sysv init script
git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@543 b0b603af-a30f-0410-a34e-baf09ae79d0b
- Loading branch information
Showing
4 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
2007-05-04 Paul Lindner <[email protected]> | ||
|
||
* Add fedora/redhat style init script and RPM spec file | ||
|
||
2007-05-12 [Version 1.2.2 released] | ||
|
||
2007-04-16 Steven Grimm <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
Name: memcached | ||
Version: 1.2.2 | ||
Release: 1%{?dist} | ||
Summary: High Performance, Distributed Memory Object Cache | ||
|
||
Group: System Environment/Daemons | ||
License: BSD | ||
URL: http://www.danga.com/memcached/ | ||
Source0: http://www.danga.com/memcached/dist/%{name}-%{version}.tar.gz | ||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||
|
||
BuildRequires: libevent-devel | ||
|
||
Requires: libevent | ||
Requires: perl | ||
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. | ||
|
||
Available rpmbuild rebuild options : | ||
--with=threads - build a multiprocessor optimized memcached server | ||
|
||
%prep | ||
%setup -q | ||
|
||
|
||
%build | ||
%configure \ | ||
%{?_with_threads:--enable-threads} | ||
|
||
make %{?_smp_mflags} | ||
|
||
%check | ||
# skip this for now, this requires perl and a bunch of other stuff | ||
# and may not work from within rpmbuild | ||
#make test | ||
|
||
%install | ||
rm -rf $RPM_BUILD_ROOT | ||
make install DESTDIR=$RPM_BUILD_ROOT | ||
|
||
# Perl script monitoring memcached | ||
install -Dp -m0755 $RPM_BUILD_DIR/%{name}-%{version}/scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool | ||
|
||
# Init script | ||
install -Dp -m0755 $RPM_BUILD_DIR/%{name}-%{version}/scripts/memcached.sysv %{buildroot}%{_sysconfdir}/rc.d/init.d/memcached | ||
|
||
# Default configs | ||
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig | ||
cat <<EOF >$RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/%{name} | ||
PORT="11211" | ||
USER="nobody" | ||
MAXCONN="1024" | ||
CACHESIZE="64" | ||
OPTIONS="" | ||
EOF | ||
|
||
%clean | ||
rm -rf $RPM_BUILD_ROOT | ||
|
||
|
||
%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 TODO doc/CONTRIBUTORS doc/*.txt | ||
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} | ||
%{_bindir}/memcached-tool | ||
%{_bindir}/memcached | ||
%{_bindir}/memcached-debug | ||
%{_mandir}/man1/memcached.1* | ||
%{_sysconfdir}/rc.d/init.d/memcached | ||
|
||
|
||
%changelog | ||
* Fri May 4 2007 Paul Lindner <[email protected]> - 1.2.2-1 | ||
- Initial spec file created via rpmdev-newspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#! /bin/sh | ||
# | ||
# chkconfig: - 55 45 | ||
# description: The memcached daemon is a network memory cache service. | ||
# processname: memcached | ||
# config: /etc/sysconfig/memcached | ||
|
||
# Source function library. | ||
. /etc/rc.d/init.d/functions | ||
|
||
PORT=11211 | ||
USER=nobody | ||
MAXCONN=1024 | ||
CACHESIZE=64 | ||
OPTIONS="" | ||
|
||
if [ -f /etc/sysconfig/memcached ];then | ||
. /etc/sysconfig/memcached | ||
fi | ||
|
||
# Check that networking is up. | ||
if [ "$NETWORKING" = "no" ] | ||
then | ||
exit 0 | ||
fi | ||
|
||
RETVAL=0 | ||
prog="memcached" | ||
|
||
start () { | ||
echo -n $"Starting $prog: " | ||
daemon memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P /var/run/memcached.pid $OPTIONS | ||
RETVAL=$? | ||
echo | ||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached | ||
} | ||
stop () { | ||
echo -n $"Stopping $prog: " | ||
killproc memcached | ||
RETVAL=$? | ||
echo | ||
if [ $RETVAL -eq 0 ] ; then | ||
rm -f /var/lock/subsys/memcached | ||
rm -f /var/run/memcached.pid | ||
fi | ||
} | ||
|
||
restart () { | ||
stop | ||
start | ||
} | ||
|
||
|
||
# See how we were called. | ||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
status) | ||
status memcached | ||
;; | ||
restart|reload) | ||
restart | ||
;; | ||
condrestart) | ||
[ -f /var/lock/subsys/memcached ] && restart || : | ||
;; | ||
*) | ||
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" | ||
exit 1 | ||
esac | ||
|
||
exit $? |