memcached/memcached.spec

118 lines
3.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package memcached (Version 1.4.5)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: memcached
Version: 1.4.5
Release: 1
%define pkg_name memcached
%define pkg_version %{version}
#
License: BSD3c
Group: Productivity/Networking/Other
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1100
BuildRequires: libevent-devel
%else
BuildRequires: libevent
%endif
PreReq: %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/sbin/useradd
Conflicts: memcached-unstable
%define home_dir /var/lib/%{pkg_name}
#
Url: http://memcached.org/
# http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
Source: %{pkg_name}-%{pkg_version}.tar.bz2
Source1: %{pkg_name}.init
Source2: %{pkg_name}.sysconfig
Source3: memcached-rpmlintrc
#
Patch0: fix-strict-aliasing.patch
Patch1: memcached-1.4.5.dif
#
Summary: A high-performance, distributed memory object caching system
%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.
Danga Interactive developed memcached to enhance the speed of
LiveJournal.com, a site which was already doing 20 million+ dynamic
page views per day for 1 million users with a bunch of webservers and a
bunch of database servers. memcached dropped the database load to
almost nothing, yielding faster page load times for users, better
resource utilization, and faster access to the databases on a memcache
miss.
%prep
%setup -n %{pkg_name}-%{pkg_version}
%patch0 -p1
%patch1
%build
export CFLAGS="%{optflags} -g"
%configure --bindir=%{_sbindir}
sed -i 's/-Werror/ /' Makefile
%{__make}
%check
%{__make} test || true
%install
%makeinstall
%{__install} -D -m 0755 scripts/memcached-tool %{buildroot}%{_sbindir}/memcached-tool
%{__install} -Dd -m 0755 %{buildroot}%{home_dir}
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{pkg_name}
%{__ln_s} -f ../..%{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}
%{__install} -D -m 0644 %{S:2} %{buildroot}/var/adm/fillup-templates/sysconfig.%{pkg_name}
%clean
%{__rm} -rf %{buildroot};
%pre
/usr/sbin/groupadd -r %{pkg_name} &>/dev/null || :
/usr/sbin/useradd -o -g %{pkg_name} -s /bin/false -r -c "user for %{pkg_name}" -d %{home_dir} %{pkg_name} &>/dev/null || :
%post
%fillup_and_insserv %{pkg_name}
%preun
%stop_on_removal %{pkg_name}
%postun
%restart_on_update %{pkg_name}
%{insserv_cleanup}
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README doc/*.txt
%{_sbindir}/%{pkg_name}
# %{_sbindir}/%{pkg_name}-debug
%{_sbindir}/memcached-tool
%{_sbindir}/rc%{pkg_name}
%{_mandir}/man1/%{pkg_name}.*
%{_sysconfdir}/init.d/%{pkg_name}
%{_includedir}/%{pkg_name}
/var/adm/fillup-templates/sysconfig.%{pkg_name}
%dir %attr(755,root,root) %{home_dir}
%changelog