55b1212
%define username   memcached
55b1212
%define groupname  memcached
55b1212
618683d
Name:           memcached
4041afb
Version:        1.4.17
204d8e1
Release:        1%{?dist}
8ca78cb
Epoch:          0
618683d
Summary:        High Performance, Distributed Memory Object Cache
618683d
618683d
Group:          System Environment/Daemons
618683d
License:        BSD
1ab5cfa
URL:            http://www.memcached.org/
3928f15
Source0:        http://www.memcached.org/files/%{name}-%{version}.tar.gz
618683d
5db2e5a
# custom unit file
5db2e5a
Source1:        memcached.service
618683d
dacc6d4
# Patches
98f11e2
Patch001:       memcached-manpages.patch
dacc6d4
97b23d0
# Fixes
97b23d0
618683d
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
618683d
ad2bc91
BuildRequires:  libevent-devel systemd-units
185350a
BuildRequires:  perl(Test::More), perl(Test::Harness)
55b1212
41935ef
Requires(post): systemd
41935ef
Requires(preun): systemd
41935ef
Requires(postun): systemd
5db2e5a
# For triggerun
5db2e5a
Requires(post): systemd-sysv
55b1212
Requires(pre):  shadow-utils
5db2e5a
618683d
02ba636
# as of 3.5.5-4 selinux has memcache included
02ba636
Obsoletes: memcached-selinux
02ba636
618683d
%description
618683d
memcached is a high-performance, distributed memory object caching
618683d
system, generic in nature, but intended for use in speeding up dynamic
618683d
web applications by alleviating database load.
618683d
91094ee
%package devel
8ca78cb
Summary: Files needed for development using memcached protocol
8ca78cb
Group: Development/Libraries
8ca78cb
Requires: %{name} = %{epoch}:%{version}-%{release}
91094ee
91094ee
%description devel
8ca78cb
Install memcached-devel if you are developing C/C++ applications that require
8ca78cb
access to the memcached binary include files.
55b1212
618683d
%prep
618683d
%setup -q
98f11e2
%patch001 -p1 -b .manpages
618683d
618683d
%build
ec3ba77
# compile with full RELRO
ec3ba77
export CFLAGS="%{optflags} -pie -fpie"
ec3ba77
export LDFLAGS="-Wl,-z,relro,-z,now"
ec3ba77
1ab5cfa
%configure
618683d
make %{?_smp_mflags}
618683d
618683d
%check
dacc6d4
# whitespace tests fail locally on fedpkg systems now that they use git
dacc6d4
rm -f t/whitespace.t
dacc6d4
507fad5
# Parts of the test suite only succeed as non-root.
507fad5
if [ `id -u` -ne 0 ]; then
507fad5
  # remove failing test that doesn't work in
507fad5
  # build systems
8ca78cb
  rm -f t/daemonize.t
507fad5
fi
dacc6d4
make test
618683d
618683d
%install
618683d
rm -rf %{buildroot}
8ca78cb
make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
618683d
# remove memcached-debug
618683d
rm -f %{buildroot}/%{_bindir}/memcached-debug
618683d
618683d
# Perl script for monitoring memcached
618683d
install -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool
98f11e2
install -Dp -m0644 scripts/memcached-tool.1 \
98f11e2
        %{buildroot}%{_mandir}/man1/memcached-tool.1
618683d
5db2e5a
# Unit file
5db2e5a
install -Dp -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/memcached.service
618683d
618683d
# Default configs
618683d
mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig
618683d
cat <<EOF >%{buildroot}/%{_sysconfdir}/sysconfig/%{name}
618683d
PORT="11211"
55b1212
USER="%{username}"
618683d
MAXCONN="1024"
618683d
CACHESIZE="64"
618683d
OPTIONS=""
618683d
EOF
618683d
507fad5
# Constant timestamp on the config file.
507fad5
touch -r %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
507fad5
618683d
%clean
618683d
rm -rf %{buildroot}
618683d
618683d
55b1212
%pre
55b1212
getent group %{groupname} >/dev/null || groupadd -r %{groupname}
55b1212
getent passwd %{username} >/dev/null || \
41935ef
useradd -r -g %{groupname} -d /run/memcached \
55b1212
    -s /sbin/nologin -c "Memcached daemon" %{username}
55b1212
exit 0
55b1212
55b1212
618683d
%post
41935ef
%systemd_post memcached.service
618683d
55b1212
618683d
%preun
41935ef
%systemd_preun memcached.service
618683d
55b1212
618683d
%postun
41935ef
%systemd_postun_with_restart memcached.service
5db2e5a
5db2e5a
%triggerun -- memcached < 0:1.4.13-2
5db2e5a
# Save the current service runlevel info
5db2e5a
# User must manually run systemd-sysv-convert --apply memcached
5db2e5a
# to migrate them to systemd targets
5db2e5a
/usr/bin/systemd-sysv-convert --save memcached >/dev/null 2>&1 ||:
5db2e5a
5db2e5a
# Run these because the SysV package being removed won't do them
5db2e5a
/sbin/chkconfig --del memcached >/dev/null 2>&1 || :
5db2e5a
/bin/systemctl try-restart memcached.service >/dev/null 2>&1 || :
618683d
618683d
618683d
%files
618683d
%defattr(-,root,root,-)
41935ef
%doc AUTHORS ChangeLog COPYING NEWS README.md doc/CONTRIBUTORS doc/*.txt
618683d
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
618683d
%{_bindir}/memcached-tool
618683d
%{_bindir}/memcached
98f11e2
%{_mandir}/man1/memcached-tool.1*
618683d
%{_mandir}/man1/memcached.1*
5db2e5a
%{_unitdir}/memcached.service
618683d
618683d
91094ee
%files devel
91094ee
%defattr(-,root,root,0755)
91094ee
%{_includedir}/memcached/*
55b1212
618683d
%changelog
204d8e1
* Wed Jan 15 2014 Miroslav Lichvar <mlichvar@redhat.com> - 0:1.4.17-1
204d8e1
- update to 1.4.17
d69e001
- fix building with -Werror=format-security in CFLAGS
204d8e1
ebbcfb4
* Wed Aug 07 2013 Miroslav Lichvar <mlichvar@redhat.com> - 0:1.4.15-7
ebbcfb4
- buildrequire systemd-units (#992221)
ebbcfb4
- update memcached man page
ebbcfb4
- add memcached-tool man page
ebbcfb4
c6a7d32
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.15-6
c6a7d32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
c6a7d32
2f6a289
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0:1.4.15-5
2f6a289
- Perl 5.18 rebuild
2f6a289
681e30c
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.15-4
681e30c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
681e30c
a875167
* Thu Dec 20 2012 Miroslav Lichvar <mlichvar@redhat.com> - 0:1.4.15-3
a875167
- compile with full RELRO
a875167
185350a
* Tue Nov 20 2012 Joe Orton <jorton@redhat.com> - 0:1.4.15-2
185350a
- BR perl(Test::Harness)
185350a
41935ef
* Tue Nov 20 2012 Joe Orton <jorton@redhat.com> - 0:1.4.15-1
41935ef
- update to 1.4.15 (#782395)
41935ef
- switch to simple systemd service (#878198)
41935ef
- use systemd scriptlet macros (Václav Pavlín, #850204)
41935ef
b2b1ac2
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.13-3
b2b1ac2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
b2b1ac2
5db2e5a
* Fri May 04 2012 Jon Ciesla <limburgher@gmail.com> - 0:1.4.13-2
5db2e5a
- Migrate to systemd, 783112.
5db2e5a
8797447
* Tue Feb  7 2012 Paul Lindner <lindner@mirth.inuus.com> - 0:1.4.13-1
8797447
- Upgrade to memcached 1.4.13
8797447
- http://code.google.com/p/memcached/wiki/ReleaseNotes1413
8797447
- http://code.google.com/p/memcached/wiki/ReleaseNotes1412
8797447
- http://code.google.com/p/memcached/wiki/ReleaseNotes1411
8797447
60b6370
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.10-2
60b6370
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
60b6370
c492123
* Wed Nov  9 2011 Paul Lindner <lindner@mirth.inuus.com> - 0:1.4.10-1
c492123
- Upgrade to memcached 1.4.10 (http://code.google.com/p/memcached/wiki/ReleaseNotes1410)
c492123
8ca78cb
* Tue Aug 16 2011 Paul Lindner <lindner@inuus.com> - 0:1.4.7-1
8ca78cb
- Upgrade to memcached 1.4.7 (http://code.google.com/p/memcached/wiki/ReleaseNotes147)
8ca78cb
- Fix some rpmlint errors/warnings.
8ca78cb
f45a5bc
* Tue Aug  2 2011 Paul Lindner <lindner@inuus.com> - 0:1.4.6-1
f45a5bc
- Upgrade to memcached-1.4.6
f45a5bc
0c09c03
* Wed Feb 16 2011 Joe Orton <jorton@redhat.com> - 0:1.4.5-7
0c09c03
- fix build
0c09c03
4ad83c2
* Mon Feb 14 2011 Paul Lindner <lindner@inuus.com> - 0:1.4.5-6
4ad83c2
- Rebuild for updated libevent
4ad83c2
992e5a1
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.5-5
992e5a1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
992e5a1
4ad83c2
* Sun Nov 28 2010 Paul Lindner <lindner@inuus.com> - 0:1.4.5-4
f95f6cb
- Add code to deal with /var/run/memcached on tmpfs
f95f6cb
dacc6d4
* Wed Sep  8 2010 Paul Lindner <lindner@inuus.com> - 0:1.4.5-3
dacc6d4
- Apply patch from memcached issue #60, solves Bugzilla 631051
dacc6d4
507fad5
* Wed May 26 2010 Joe Orton <jorton@redhat.com> - 0:1.4.5-2
507fad5
- LSB compliance fixes for init script
507fad5
- don't run the test suite as root
507fad5
- ensure a constant timestamp on the sysconfig file
507fad5
02ba636
* Sun Apr  4 2010 Paul Lindner <lindner@inuus.com> - 0:1.4.5-1
02ba636
- Upgrade to upstream memcached-1.4.5 (http://code.google.com/p/memcached/wiki/ReleaseNotes145)
02ba636
fe67e9f
* Wed Jan 20 2010 Paul Lindner <lindner@inuus.com> - 0:1.4.4-2
fe67e9f
- Remove SELinux policies fixes Bugzilla 557073
fe67e9f
1862bb7
* Sat Nov 28 2009 Paul Lindner <lindner@inuus.com> - 0:1.4.4-1
1862bb7
- Upgraded to upstream memcached-1.4.4 (http://code.google.com/p/memcached/wiki/ReleaseNotes144)
1862bb7
- Add explicit Epoch to fix issue with broken devel dependencies (resolves 542001)
1862bb7
1862bb7
* Thu Nov 12 2009 Paul Lindner <lindner@inuus.com> - 1.4.3-1
1ab5cfa
- Add explicit require on memcached for memcached-devel (resolves 537046)
1ab5cfa
- enable-threads option no longer needed
1ab5cfa
- Update web site address
1ab5cfa
d23f0c6
* Wed Nov 11 2009 Paul Lindner <lindner@inuus.com> - 1.4.3-1
d23f0c6
- Upgrade to memcached-1.4.3
d23f0c6
76248e2
* Mon Oct 12 2009 Paul Lindner <lindner@inuus.com> - 1.4.2-1
76248e2
- Upgrade to memcached-1.4.2
76248e2
- Addresses CVE-2009-2415
76248e2
4dea1b0
* Sat Aug 29 2009 Paul Lindner <lindner@inuus.com> - 1.4.1-1
8ca78cb
- Upgrade to 1.4.1
4dea1b0
- http://code.google.com/p/memcached/wiki/ReleaseNotes141
4dea1b0
f6f5f83
* Wed Apr 29 2009 Paul Lindner <lindner@inuus.com> - 1.2.8-1
f6f5f83
- Upgrade to memcached-1.2.8
f6f5f83
- Addresses CVE-2009-1255
f6f5f83
07c829e
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.6-2
07c829e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
07c829e
cfc5f85
* Tue Jul 29 2008 Paul Lindner <lindner@inuus.com> - 1.2.6-1
cfc5f85
- Upgrade to memcached-1.2.6
cfc5f85
7bbc263
* Tue Mar  4 2008 Paul Lindner <lindner@inuus.com> - 1.2.5-1
7bbc263
- Upgrade to memcached-1.2.5
7bbc263
6fd5609
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.2.4-4
6fd5609
- Autorebuild for GCC 4.3
6fd5609
4e7d0fa
* Sun Jan 27 2008 Paul Lindner <lindner@inuus.com> - 1.2.4-3
4e7d0fa
- Adjust libevent dependencies
4e7d0fa
4e7d0fa
* Sat Dec 22 2007 Paul Lindner <lindner@inuus.com> - 1.2.4-2
55b1212
- Upgrade to memcached-1.2.4
55b1212
55b1212
* Fri Sep 07 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 1.2.3-8
55b1212
- Add selinux policies
55b1212
- Create our own system user
55b1212
fdeed36
* Mon Aug  6 2007 Paul Lindner <lindner@inuus.com> - 1.2.3-7
888f13f
- Fix problem with -P and -d flag combo on x86_64
888f13f
- Fix init script for FC-6
888f13f
f858079
* Fri Jul 13 2007 Paul Lindner <lindner@inuus.com> - 1.2.3-4
f858079
- Remove test that fails in fedora build system on ppc64
80d6042
80d6042
* Sat Jul  7 2007 root <lindner@inuus.com> - 1.2.3-2
618683d
- Upgrade to 1.2.3 upstream
618683d
- Adjust make install to preserve man page timestamp
618683d
- Conform with LSB init scripts standards, add force-reload
618683d
618683d
* Wed Jul  4 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-5
618683d
- Use /var/run/memcached/ directory to hold PID file
618683d
618683d
* Sat May 12 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-4
618683d
- Remove tabs from spec file, rpmlint reports no more errors
618683d
618683d
* Thu May 10 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-3
618683d
- Enable build-time regression tests
618683d
- add dependency on initscripts
618683d
- remove memcached-debug (not needed in dist)
618683d
- above suggestions from Bernard Johnson
618683d
618683d
* Mon May  7 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-2
618683d
- Tidyness improvements suggested by Ruben Kerkhof in bugzilla #238994
618683d
618683d
* Fri May  4 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-1
618683d
- Initial spec file created via rpmdev-newspec