Commit 8f4c79c1 authored by Markus Frosch's avatar Markus Frosch 📣

Rename package to icinga-redis

Disable doc and devel packages
parent 2a529e1e
[Unit] [Unit]
Description=Redis Sentinel Description=Redis Sentinel for Icinga
After=network.target After=network.target
After=network-online.target After=network-online.target
Wants=network-online.target Wants=network-online.target
[Service] [Service]
ExecStart=/usr/bin/redis-sentinel /etc/redis-sentinel.conf --supervised systemd ExecStart=/usr/bin/icinga-redis-sentinel /etc/icinga-redis/redis-sentinel.conf --supervised systemd
ExecStop=/usr/libexec/redis-shutdown redis-sentinel ExecStop=/usr/libexec/icinga-redis-shutdown redis-sentinel
Type=notify Type=notify
User=redis User=icinga-redis
Group=redis Group=icinga-redis
RuntimeDirectory=redis RuntimeDirectory=redis
RuntimeDirectoryMode=0755 RuntimeDirectoryMode=0755
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Wrapper to close properly redis and sentinel # Wrapper to close properly redis and sentinel
test x"$REDIS_DEBUG" != x && set -x test x"$REDIS_DEBUG" != x && set -x
REDIS_CLI=/usr/bin/redis-cli REDIS_CLI=/usr/bin/icinga-redis-cli
# Retrieve service name # Retrieve service name
SERVICE_NAME="$1" SERVICE_NAME="$1"
...@@ -12,7 +12,7 @@ if [ -z "$SERVICE_NAME" ]; then ...@@ -12,7 +12,7 @@ if [ -z "$SERVICE_NAME" ]; then
fi fi
# Get the proper config file based on service name # Get the proper config file based on service name
CONFIG_FILE="/etc/$SERVICE_NAME.conf" CONFIG_FILE="/etc/icinga-redis/$SERVICE_NAME.conf"
# Use awk to retrieve host, port from config file # Use awk to retrieve host, port from config file
HOST=`awk '/^[[:blank:]]*bind/ { print $2 }' $CONFIG_FILE | tail -n1` HOST=`awk '/^[[:blank:]]*bind/ { print $2 }' $CONFIG_FILE | tail -n1`
......
/var/log/redis/*.log { /var/log/icinga-redis/*.log {
weekly weekly
rotate 10 rotate 10
copytruncate copytruncate
......
[Unit] [Unit]
Description=Redis persistent key-value database Description=Redis persistent key-value database for Icinga
After=network.target After=network.target
After=network-online.target After=network-online.target
Wants=network-online.target Wants=network-online.target
[Service] [Service]
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd ExecStart=/usr/bin/icinga-redis-server /etc/icinga-redis/redis.conf --supervised systemd
ExecStop=/usr/libexec/redis-shutdown ExecStop=/usr/libexec/icinga-redis-shutdown
Type=notify Type=notify
User=redis User=icinga-redis
Group=redis Group=icinga-redis
RuntimeDirectory=redis RuntimeDirectory=icinga-redis
RuntimeDirectoryMode=0755 RuntimeDirectoryMode=0755
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
# %%{rpmmacrodir} not usable on EL-6 # %%{rpmmacrodir} not usable on EL-6
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Name: redis %global pkg_prefix icinga-
%global src_name redis
Name: %{?pkg_prefix}redis
Version: 5.0.6 Version: 5.0.6
Release: 1%{?dist} Release: 1%{?dist}
Summary: A persistent key-value database Summary: A persistent key-value database
...@@ -26,17 +29,17 @@ Summary: A persistent key-value database ...@@ -26,17 +29,17 @@ Summary: A persistent key-value database
# lua is MIT # lua is MIT
License: BSD and MIT License: BSD and MIT
URL: https://redis.io URL: https://redis.io
Source0: https://download.redis.io/releases/%{name}-%{version}.tar.gz Source0: http://download.redis.io/releases/%{src_name}-%{version}.tar.gz
Source1: %{name}.logrotate Source1: %{src_name}.logrotate
Source2: %{name}-sentinel.service Source2: %{src_name}-sentinel.service
Source3: %{name}.service Source3: %{src_name}.service
Source4: %{name}-sentinel.init Source4: %{src_name}-sentinel.init
Source5: %{name}.init Source5: %{src_name}.init
Source6: %{name}-shutdown Source6: %{src_name}-shutdown
Source7: %{name}-limit-systemd Source7: %{src_name}-limit-systemd
Source8: %{name}-limit-init Source8: %{src_name}-limit-init
Source9: macros.%{name} Source9: macros.%{src_name}
Source10: https://github.com/antirez/%{name}-doc/archive/%{doc_commit}/%{name}-doc-%{short_doc_commit}.tar.gz # Source10: https://github.com/antirez/%%{src_name}-doc/archive/%%{doc_commit}/%{src_name}-doc-%%{short_doc_commit}.tar.gz
# To refresh patches: # To refresh patches:
# tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%%{version} baseline" # tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%%{version} baseline"
...@@ -74,55 +77,55 @@ Provides: bundled(lzf) ...@@ -74,55 +77,55 @@ Provides: bundled(lzf)
Provides: redis(modules_abi)%{?_isa} = %{redis_modules_abi} Provides: redis(modules_abi)%{?_isa} = %{redis_modules_abi}
%description %description
Redis is an advanced key-value store. It is often referred to as a data Redis is an advanced key-value store. It is often referred to as a data
structure server since keys can contain strings, hashes, lists, sets and structure server since keys can contain strings, hashes, lists, sets and
sorted sets. sorted sets.
You can run atomic operations on these types, like appending to a string; You can run atomic operations on these types, like appending to a string;
incrementing the value in a hash; pushing to a list; computing set incrementing the value in a hash; pushing to a list; computing set
intersection, union and difference; or getting the member with highest intersection, union and difference; or getting the member with highest
ranking in a sorted set. ranking in a sorted set.
In order to achieve its outstanding performance, Redis works with an In order to achieve its outstanding performance, Redis works with an
in-memory dataset. Depending on your use case, you can persist it either in-memory dataset. Depending on your use case, you can persist it either
by dumping the dataset to disk every once in a while, or by appending by dumping the dataset to disk every once in a while, or by appending
each command to a log. each command to a log.
Redis also supports trivial-to-setup master-slave replication, with very Redis also supports trivial-to-setup master-slave replication, with very
fast non-blocking first synchronization, auto-reconnection on net split fast non-blocking first synchronization, auto-reconnection on net split
and so forth. and so forth.
Other features include Transactions, Pub/Sub, Lua scripting, Keys with a Other features include Transactions, Pub/Sub, Lua scripting, Keys with a
limited time-to-live, and configuration settings to make Redis behave like limited time-to-live, and configuration settings to make Redis behave like
a cache. a cache.
You can use Redis from most programming languages also. You can use Redis from most programming languages also.
%package devel # %%package devel
Summary: Development header for Redis module development # Summary: Development header for Redis module development
# Header-Only Library (https://fedoraproject.org/wiki/Packaging:Guidelines) # # Header-Only Library (https://fedoraproject.org/wiki/Packaging:Guidelines)
Provides: %{name}-static = %{version}-%{release} # Provides: %%{name}-static = %%{version}-%%{release}
%description devel
Header file required for building loadable Redis modules. Detailed
API documentation is available in the redis-doc package.
%package doc # %%description devel
Summary: Documentation for Redis including man pages # Header file required for building loadable Redis modules. Detailed
License: CC-BY-SA # API documentation is available in the redis-doc package.
BuildArch: noarch
# http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages" # %%package doc
Conflicts: redis < 4.0 # Summary: Documentation for Redis including man pages
# License: CC-BY-SA
# BuildArch: noarch
#
# # http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages"
# Conflicts: redis < 4.0
%description doc # %%description doc
Manual pages and detailed documentation for many aspects of Redis use, # Manual pages and detailed documentation for many aspects of Redis use,
administration and development. # administration and development.
%prep %prep
%setup -q -b 10 # %%setup -q -b 10
%setup -q %setup -q -n %{src_name}-%{version}
mv ../%{name}-doc-%{doc_commit} doc # mv ../%%{name}-doc-%%{doc_commit} doc
%patch0001 -p1 %patch0001 -p1
%patch0002 -p1 %patch0002 -p1
...@@ -130,9 +133,9 @@ mv deps/lua/COPYRIGHT COPYRIGHT-lua ...@@ -130,9 +133,9 @@ mv deps/lua/COPYRIGHT COPYRIGHT-lua
mv deps/hiredis/COPYING COPYING-hiredis mv deps/hiredis/COPYING COPYING-hiredis
# Configuration file changes # Configuration file changes
sed -i -e 's|^logfile .*$|logfile /var/log/redis/redis.log|g' redis.conf sed -i -e 's|^logfile .*$|logfile /var/log/%{name}/redis.log|g' redis.conf
sed -i -e 's|^logfile .*$|logfile /var/log/redis/sentinel.log|g' sentinel.conf sed -i -e 's|^logfile .*$|logfile /var/log/%{name}/sentinel.log|g' sentinel.conf
sed -i -e 's|^dir .*$|dir /var/lib/redis|g' redis.conf sed -i -e 's|^dir .*$|dir /var/lib/%{name}|g' redis.conf
# Module API version safety check # Module API version safety check
api=`sed -n -e 's/#define REDISMODULE_APIVER_[0-9][0-9]* //p' src/redismodule.h` api=`sed -n -e 's/#define REDISMODULE_APIVER_[0-9][0-9]* //p' src/redismodule.h`
...@@ -160,34 +163,40 @@ install -d %{buildroot}%{redis_modules_dir} ...@@ -160,34 +163,40 @@ install -d %{buildroot}%{redis_modules_dir}
install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# Install configuration files. # Install configuration files.
install -pDm640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf install -pd %{buildroot}%{_sysconfdir}/%{name}
install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}-sentinel.conf install -pDm640 %{src_name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{src_name}.conf
install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}/%{src_name}-sentinel.conf
# Install systemd unit files. # Install systemd unit files.
mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_unitdir}
install -pm644 %{S:3} %{buildroot}%{_unitdir} install -pm644 %{S:3} %{buildroot}%{_unitdir}/%{name}.service
install -pm644 %{S:2} %{buildroot}%{_unitdir} install -pm644 %{S:2} %{buildroot}%{_unitdir}/%{name}-sentinel.service
# Install systemd limit files (requires systemd >= 204) # Install systemd limit files (requires systemd >= 204)
install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
# Fix non-standard-executable-perm error. # Fix non-standard-executable-perm error.
chmod 755 %{buildroot}%{_bindir}/%{name}-* for bin in $(cd %{buildroot}%{_bindir}; ls redis*); do
[ -z %{?pkg_prefix} ] || mv %{buildroot}%{_bindir}/${bin} %{buildroot}%{_bindir}/%{?pkg_prefix}${bin}
chmod 755 %{buildroot}%{_bindir}/%{?pkg_prefix}${bin}
done
# Install redis-shutdown # Install redis-shutdown
install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown
# Install redis module header # Install redis module header
install -pDm644 src/%{name}module.h %{buildroot}%{_includedir}/%{name}module.h # install -pDm644 src/%%{name}module.h %%{buildroot}%%{_includedir}/%%{name}module.h
# Install man pages # Install man pages
man=$(dirname %{buildroot}%{_mandir}) man=$(dirname %{buildroot}%{_mandir})
for page in man/man?/*; do for page in man/man?/*; do
install -Dpm644 $page $man/$page dir=$(dirname $page)
file=$(basename $page)
install -Dpm644 $page $man/$dir/%{?pkg_prefix}$file
done done
ln -s redis-server.1 %{buildroot}%{_mandir}/man1/redis-sentinel.1 ln -s %{?pkg_prefix}redis-server.1 %{buildroot}%{_mandir}/man1/%{?pkg_prefix}redis-sentinel.1
ln -s redis.conf.5 %{buildroot}%{_mandir}/man5/redis-sentinel.conf.5 ln -s %{?pkg_prefix}redis.conf.5 %{buildroot}%{_mandir}/man5/%{?pkg_prefix}redis-sentinel.conf.5
# Install documentation and html pages # Install documentation and html pages
doc=$(echo %{buildroot}/%{_docdir}/%{name}) doc=$(echo %{buildroot}/%{_docdir}/%{name})
...@@ -200,8 +209,8 @@ for page in $(find doc -name \*.md | sed -e 's|.md$||g'); do ...@@ -200,8 +209,8 @@ for page in $(find doc -name \*.md | sed -e 's|.md$||g'); do
done done
# Install rpm macros for redis modules # Install rpm macros for redis modules
mkdir -p %{buildroot}%{macrosdir} # mkdir -p %%{buildroot}%%{macrosdir}
install -pDm644 %{S:9} %{buildroot}%{macrosdir}/macros.%{name} # install -pDm644 %%{S:9} %%{buildroot}%%{macrosdir}/macros.%%{name}
%check %check
%if 0%{?with_tests} %if 0%{?with_tests}
...@@ -238,15 +247,16 @@ exit 0 ...@@ -238,15 +247,16 @@ exit 0
%{!?_licensedir:%global license %%doc} %{!?_licensedir:%global license %%doc}
%license COPYING %license COPYING
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}.conf %attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}/%{src_name}.conf
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}-sentinel.conf %attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}/%{src_name}-sentinel.conf
%dir %attr(0750, redis, redis) %{_libdir}/%{name} %dir %attr(0750, redis, redis) %{_libdir}/%{name}
%dir %attr(0750, redis, redis) %{redis_modules_dir} %dir %attr(0750, redis, redis) %{redis_modules_dir}
%dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name} %dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name}
%dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name} %dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name}
%exclude %{macrosdir} # %%exclude %%{macrosdir}
%exclude %{_includedir} # %%exclude %%{_includedir}
%exclude %{_docdir}/%{name}/* # %%exclude %%{_docdir}/%%{name}/*
%{_docdir}/%{name}
%{_bindir}/%{name}-* %{_bindir}/%{name}-*
%{_libexecdir}/%{name}-* %{_libexecdir}/%{name}-*
%{_mandir}/man1/%{name}* %{_mandir}/man1/%{name}*
...@@ -259,19 +269,22 @@ exit 0 ...@@ -259,19 +269,22 @@ exit 0
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf %config(noreplace) %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
%dir %attr(0755, redis, redis) %ghost %{_localstatedir}/run/%{name} %dir %attr(0755, redis, redis) %ghost %{_localstatedir}/run/%{name}
%files devel # %%files devel
%license COPYING # %%license COPYING
%license COPYRIGHT-lua # %%license COPYRIGHT-lua
%license COPYING-hiredis # %%license COPYING-hiredis
%{_includedir}/%{name}module.h # %%{_includedir}/%%{name}module.h
%{macrosdir}/* # %%{macrosdir}/*
#
%files doc # %%files doc
%docdir %{_docdir}/%{name} # %%docdir %%{_docdir}/%%{name}
%{_docdir}/%{name} # %%{_docdir}/%%{name}
%changelog %changelog
* Wed Nov 20 2019 Markus Frsoch <markus.frosch@icinga.com> - 5.0.6-1
- Adopt package as icinga-redis
* Thu Sep 26 2019 Nathan Scott <nathans@redhat.com> - 5.0.6-1 * Thu Sep 26 2019 Nathan Scott <nathans@redhat.com> - 5.0.6-1
- Upstream 5.0.6 release and redis-doc updates. - Upstream 5.0.6 release and redis-doc updates.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment