summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-12-21 14:34:10 +0100
committerRemi Collet <remi@remirepo.net>2020-12-21 14:34:10 +0100
commit23309081a6e6e16776abc0b46baac7a9ebe120f5 (patch)
tree3403e9cd9d50e4386e6785ef51e4237f6f18154e
parentf4ebfa847fb09c672c7d0a26eb53b891612737ac (diff)
build with --enable-sasl-pwdb
-rw-r--r--memcached.spec98
1 files changed, 28 insertions, 70 deletions
diff --git a/memcached.spec b/memcached.spec
index 4d389ad..39519fb 100644
--- a/memcached.spec
+++ b/memcached.spec
@@ -11,23 +11,19 @@
%global username memcached
%global groupname memcached
-%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
-%global with_systemd 1
-%else
-%global with_systemd 0
-%endif
-%global with_extstore 1
-%global with_sasl 1
-%global with_seccomp 0
+%bcond_without extstore
+%bcond_without sasl
+%bcond_without sasl_pwdb
+%bcond_with seccomp
%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8
-%global with_tls 1
+%bcond_without tls
%else
-%global with_tls 0
+%bcond_with tls
%endif
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
-%global with_selinux 1
+%bcond_without selinux
%else
-%global with_selinux 0
+%bcond_with selinux
%endif
%global selinuxtype targeted
%global selinuxmoduletype contrib
@@ -40,7 +36,7 @@
Name: memcached
Version: 1.6.9
-Release: 1%{?dist}
+Release: 2%{?dist}
Epoch: 0
Summary: High Performance, Distributed Memory Object Cache
@@ -60,35 +56,24 @@ Patch1: memcached-unit.patch
BuildRequires: gcc
BuildRequires: pkgconfig(libevent) >= 2
-%if %{with_systemd}
BuildRequires: systemd
-%endif
%if 0%{?fedora} >= 23 || 0%{?rhel} >= 8
BuildRequires: perl-generators
%endif
BuildRequires: perl(Test::More), perl(Test::Harness)
-%if %{with_sasl}
+%if %{with sasl}
BuildRequires: cyrus-sasl-devel
%endif
-%if %{with_seccomp}
+%if %{with seccomp}
BuildRequires: libseccomp-devel
%endif
-%if %{with_tls}
+%if %{with tls}
BuildRequires: openssl-devel >= 1.1
%endif
-%if %{with_systemd}
%{?systemd_requires}
-# For triggerun
-Requires(post): systemd-sysv
-%else
-Requires: initscripts
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig, /sbin/service
-Requires(postun): /sbin/service
-%endif
Requires(pre): shadow-utils
-%if %{with_selinux}
+%if %{with selinux}
# Rich dependency syntax - require selinux policy subpackage
# when selinux-policy-targeted is installed
# This ensures that the selinux subpackage is not installed when not needed
@@ -97,7 +82,7 @@ Requires: (%{name}-selinux if selinux-policy-targeted)
%endif
-%if %{with_selinux}
+%if %{with selinux}
%package selinux
Summary: Selinux policy module
License: GPLv2
@@ -136,18 +121,21 @@ access to the memcached binary include files.
%build
%configure \
-%if %{with_extstore}
+%if %{with extstore}
--enable-extstore \
%else
--disable-extstore \
%endif
-%if %{with_sasl}
+%if %{with sasl}
--enable-sasl \
%endif
-%if %{with_seccomp}
+%if %{with sasl_pwdb}
+ --enable-sasl-pwdb \
+%endif
+%if %{with seccomp}
--enable-seccomp \
%endif
-%if %{with_tls}
+%if %{with tls}
--enable-tls \
%endif
@@ -155,7 +143,7 @@ access to the memcached binary include files.
sed -i 's/-Werror / /' Makefile
make %{?_smp_mflags}
-%if %{with_selinux}
+%if %{with selinux}
pushd ../%{selinuxmoduledir}
make
popd
@@ -180,8 +168,6 @@ install -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool
install -Dp -m0644 scripts/memcached-tool.1 \
%{buildroot}%{_mandir}/man1/memcached-tool.1
-%if %{with_systemd}
-
# Unit file
%if 0%{?fedora} < 25 && 0%{?rhel} < 8
install -Dp -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/memcached.service
@@ -197,15 +183,7 @@ sed -e 's/^##safer##/#/g' -i %{buildroot}%{_unitdir}/%{name}*service
sed -e 's/^##safer##//g' -i %{buildroot}%{_unitdir}/%{name}*service
%endif
-%else
-# Init script
-install -Dp -m0755 %{SOURCE4} %{buildroot}%{_initrddir}/memcached
-
-# pid directory
-mkdir -p %{buildroot}/%{_localstatedir}/run/memcached
-%endif
-
-%if %{with_selinux}
+%if %{with selinux}
# install SELinux policy module
pushd ../%{selinuxmoduledir}
install -d %{buildroot}%{_datadir}/selinux/packages
@@ -235,7 +213,7 @@ install -Dp -m0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
%endif
-%if %{with_selinux}
+%if %{with selinux}
%pre selinux
%selinux_relabel_pre -s %{selinuxtype}
@@ -255,11 +233,7 @@ fi
%pre
getent group %{groupname} >/dev/null || groupadd -r %{groupname}
getent passwd %{username} >/dev/null || \
-%if %{with_systemd}
useradd -r -g %{groupname} -d /run/memcached \
-%else
-useradd -r -g %{groupname} -d %{_localstatedir}/run/memcached \
-%endif
-s /sbin/nologin -c "Memcached daemon" %{username}
exit 0
@@ -298,20 +272,6 @@ fi
exit 0
%endif
-%triggerun -- memcached
-%if %{with_systemd}
-if [ -f /etc/rc.d/init.d/memcached ]; then
-# Save the current service runlevel info
-# User must manually run systemd-sysv-convert --apply memcached
-# to migrate them to systemd targets
-/usr/bin/systemd-sysv-convert --save memcached >/dev/null 2>&1 ||:
-
-# Run these because the SysV package being removed won't do them
-/sbin/chkconfig --del memcached >/dev/null 2>&1 || :
-/bin/systemctl try-restart memcached.service >/dev/null 2>&1 || :
-fi
-%endif
-
%files
%{!?_licensedir:%global license %%doc}
@@ -322,20 +282,15 @@ fi
%{_bindir}/memcached
%{_mandir}/man1/memcached-tool.1*
%{_mandir}/man1/memcached.1*
-%if %{with_systemd}
%{_unitdir}/memcached.service
%{_unitdir}/memcached@.service
-%else
-%{_initrddir}/memcached
-%dir %attr(755,%{username},%{groupname}) %{_localstatedir}/run/memcached
-%endif
%files devel
%{_includedir}/memcached/*
-%if %{with_selinux}
+%if %{with selinux}
%files selinux
%defattr(-,root,root,0755)
%attr(0644,root,root) %{_datadir}/selinux/packages/%{selinuxmodulename}.pp.bz2
@@ -345,6 +300,9 @@ fi
%changelog
+* Mon Dec 21 2020 Remi Collet <remi@remirepo.net> - 1.6.9-2
+- build with --enable-sasl-pwdb
+
* Mon Nov 23 2020 Remi Collet <remi@remirepo.net> - 1.6.9-1
- update to 1.6.9 (2020-11-20)