Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
packaging
redhat-redis
Commits
8f4c79c1
Commit
8f4c79c1
authored
Nov 20, 2019
by
Markus Frosch
📣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename package to icinga-redis
Disable doc and devel packages
parent
2a529e1e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
88 deletions
+99
-88
redis-sentinel.service
redis-sentinel.service
+5
-6
redis-shutdown
redis-shutdown
+2
-2
redis.logrotate
redis.logrotate
+1
-1
redis.service
redis.service
+6
-7
redis.spec
redis.spec
+85
-72
No files found.
redis-sentinel.service
View file @
8f4c79c1
[Unit]
Description
=
Redis Sentinel
Description
=
Redis Sentinel
for Icinga
After
=
network.target
After
=
network-online.target
Wants
=
network-online.target
[Service]
ExecStart
=
/usr/bin/redis-sentinel /etc/redis-sentinel.conf --supervised systemd
ExecStop
=
/usr/libexec/redis-shutdown redis-sentinel
ExecStart
=
/usr/bin/
icinga-
redis-sentinel /etc/
icinga-redis/
redis-sentinel.conf --supervised systemd
ExecStop
=
/usr/libexec/
icinga-
redis-shutdown redis-sentinel
Type
=
notify
User
=
redis
Group
=
redis
User
=
icinga-
redis
Group
=
icinga-
redis
RuntimeDirectory
=
redis
RuntimeDirectoryMode
=
0755
[Install]
WantedBy
=
multi-user.target
redis-shutdown
View file @
8f4c79c1
...
...
@@ -3,7 +3,7 @@
# Wrapper to close properly redis and sentinel
test
x
"
$REDIS_DEBUG
"
!=
x
&&
set
-x
REDIS_CLI
=
/usr/bin/redis-cli
REDIS_CLI
=
/usr/bin/
icinga-
redis-cli
# Retrieve service name
SERVICE_NAME
=
"
$1
"
...
...
@@ -12,7 +12,7 @@ if [ -z "$SERVICE_NAME" ]; then
fi
# 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
HOST
=
`
awk
'/^[[:blank:]]*bind/ { print $2 }'
$CONFIG_FILE
|
tail
-n1
`
...
...
redis.logrotate
View file @
8f4c79c1
/var/log/redis/*.log {
/var/log/
icinga-
redis/*.log {
weekly
rotate 10
copytruncate
...
...
redis.service
View file @
8f4c79c1
[Unit]
Description
=
Redis persistent key-value database
Description
=
Redis persistent key-value database
for Icinga
After
=
network.target
After
=
network-online.target
Wants
=
network-online.target
[Service]
ExecStart
=
/usr/bin/redis-server /etc/redis.conf --supervised systemd
ExecStop
=
/usr/libexec/redis-shutdown
ExecStart
=
/usr/bin/
icinga-
redis-server /etc/
icinga-redis/
redis.conf --supervised systemd
ExecStop
=
/usr/libexec/
icinga-
redis-shutdown
Type
=
notify
User
=
redis
Group
=
redis
RuntimeDirectory
=
redis
User
=
icinga-
redis
Group
=
icinga-
redis
RuntimeDirectory
=
icinga-
redis
RuntimeDirectoryMode
=
0755
[Install]
WantedBy
=
multi-user.target
redis.spec
View file @
8f4c79c1
...
...
@@ -18,7 +18,10 @@
# %%{rpmmacrodir} not usable on EL-6
%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
Release: 1%{?dist}
Summary: A persistent key-value database
...
...
@@ -26,17 +29,17 @@ Summary: A persistent key-value database
# lua is MIT
License: BSD and MIT
URL: https://redis.io
Source0: http
s
://download.redis.io/releases/%{name}-%{version}.tar.gz
Source1: %{name}.logrotate
Source2: %{name}-sentinel.service
Source3: %{name}.service
Source4: %{name}-sentinel.init
Source5: %{name}.init
Source6: %{name}-shutdown
Source7: %{name}-limit-systemd
Source8: %{name}-limit-init
Source9: macros.%{name}
Source10: https://github.com/antirez/%
{
name}-doc/archive/%{doc_commit}/%{name}-doc-%{short_doc_commit}.tar.gz
Source0: http://download.redis.io/releases/%{
src_
name}-%{version}.tar.gz
Source1: %{
src_
name}.logrotate
Source2: %{
src_
name}-sentinel.service
Source3: %{
src_
name}.service
Source4: %{
src_
name}-sentinel.init
Source5: %{
src_
name}.init
Source6: %{
src_
name}-shutdown
Source7: %{
src_
name}-limit-systemd
Source8: %{
src_
name}-limit-init
Source9: macros.%{
src_
name}
#
Source10: https://github.com/antirez/%
%{src_
name}-doc/archive/%
%
{doc_commit}/%{
src_
name}-doc-%
%
{short_doc_commit}.tar.gz
# To refresh patches:
# tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%%{version} baseline"
...
...
@@ -98,31 +101,31 @@ a cache.
You can use Redis from most programming languages also.
%package devel
Summary: Development header for Redis module development
# Header-Only Library (https://fedoraproject.org/wiki/Packaging:Guidelines)
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 devel
# Summary: Development header for Redis module development
# # Header-Only Library (https://fedoraproject.org/wiki/Packaging:Guidelines)
# Provides: %%{name}-static = %%{version}-%%{release}
%package doc
Summary: Documentation for Redis including man pages
License: CC-BY-SA
BuildArch: noarch
# %%description devel
# Header file required for building loadable Redis modules. Detailed
# API documentation is available in the redis-doc package.
# http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages"
Conflicts: redis < 4.0
# %%package doc
# 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
Manual pages and detailed documentation for many aspects of Redis use,
administration and development.
# %
%description doc
#
Manual pages and detailed documentation for many aspects of Redis use,
#
administration and development.
%prep
%setup -q -b 10
%setup -q
mv ../%{name}-doc-%{doc_commit} doc
# %
%setup -q -b 10
%setup -q
-n %{src_name}-%{version}
#
mv ../%
%
{name}-doc-%
%
{doc_commit} doc
%patch0001 -p1
%patch0002 -p1
...
...
@@ -130,9 +133,9 @@ mv deps/lua/COPYRIGHT COPYRIGHT-lua
mv deps/hiredis/COPYING COPYING-hiredis
# 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/
redis
/sentinel.log|g' sentinel.conf
sed -i -e 's|^dir .*$|dir /var/lib/
redis
|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/
%{name}
/sentinel.log|g' sentinel.conf
sed -i -e 's|^dir .*$|dir /var/lib/
%{name}
|g' redis.conf
# Module API version safety check
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}
install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# Install configuration files.
install -pDm640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf
install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}-sentinel.conf
install -pd %{buildroot}%{_sysconfdir}/%{name}
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.
mkdir -p %{buildroot}%{_unitdir}
install -pm644 %{S:3} %{buildroot}%{_unitdir}
install -pm644 %{S:2} %{buildroot}%{_unitdir}
install -pm644 %{S:3} %{buildroot}%{_unitdir}
/%{name}.service
install -pm644 %{S:2} %{buildroot}%{_unitdir}
/%{name}-sentinel.service
# 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}-sentinel.service.d/limit.conf
# 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 -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown
# 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
man=$(dirname %{buildroot}%{_mandir})
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
ln -s redis-server.1 %{buildroot}%{_mandir}/man1/redis-sentinel.1
ln -s redis.conf.5 %{buildroot}%{_mandir}/man5/redis-sentinel.conf.5
ln -s
%{?pkg_prefix}
redis-server.1 %{buildroot}%{_mandir}/man1/
%{?pkg_prefix}
redis-sentinel.1
ln -s
%{?pkg_prefix}
redis.conf.5 %{buildroot}%{_mandir}/man5/
%{?pkg_prefix}
redis-sentinel.conf.5
# Install documentation and html pages
doc=$(echo %{buildroot}/%{_docdir}/%{name})
...
...
@@ -200,8 +209,8 @@ for page in $(find doc -name \*.md | sed -e 's|.md$||g'); do
done
# Install rpm macros for redis modules
mkdir -p %{buildroot}%{macrosdir}
install -pDm644 %{S:9} %{buildroot}%{macrosdir}/macros.%{name}
#
mkdir -p
%
%{buildroot}%
%
{macrosdir}
#
install -pDm644
%
%{S:9}
%
%{buildroot}%
%
{macrosdir}/macros.%
%
{name}
%check
%if 0%{?with_tests}
...
...
@@ -238,15 +247,16 @@ exit 0
%{!?_licensedir:%global license %%doc}
%license COPYING
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}.conf
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}-sentinel.conf
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}
/%{src_name}
.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) %{redis_modules_dir}
%dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name}
%dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name}
%exclude %{macrosdir}
%exclude %{_includedir}
%exclude %{_docdir}/%{name}/*
# %%exclude %%{macrosdir}
# %%exclude %%{_includedir}
# %%exclude %%{_docdir}/%%{name}/*
%{_docdir}/%{name}
%{_bindir}/%{name}-*
%{_libexecdir}/%{name}-*
%{_mandir}/man1/%{name}*
...
...
@@ -259,19 +269,22 @@ exit 0
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
%dir %attr(0755, redis, redis) %ghost %{_localstatedir}/run/%{name}
%files devel
%license COPYING
%license COPYRIGHT-lua
%license COPYING-hiredis
%{_includedir}/%{name}module.h
%{macrosdir}/*
%files doc
%docdir %{_docdir}/%{name}
%{_docdir}/%{name}
# %
%files devel
# %
%license COPYING
# %
%license COPYRIGHT-lua
# %
%license COPYING-hiredis
# %
%{_includedir}/%
%
{name}module.h
# %
%{macrosdir}/*
#
# %
%files doc
# %
%docdir
%
%{_docdir}/%
%
{name}
# %
%{_docdir}/%
%
{name}
%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
- Upstream 5.0.6 release and redis-doc updates.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment