mirror of
https://github.com/notherealmarco/coredns-deployment.git
synced 2025-03-14 06:06:16 +01:00
Signed-off-by: SayfEddine <sayf-eddine.hammemi@scality.com> Signed-off-by: SayfEddine <sayf-eddine.hammemi@scality.com>
This commit is contained in:
parent
5740a1f4b1
commit
1846238a3d
5 changed files with 104 additions and 0 deletions
14
Makefile
14
Makefile
|
@ -2,6 +2,9 @@
|
|||
|
||||
# ARCH can be and default to amd64 is not set.
|
||||
ARCH := amd64 armhf arm64
|
||||
redhat-packages-dist := $(patsubst %.centos,%,$(shell rpm --eval "%{dist}"))
|
||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
mkfile_dir := $(dir $(mkfile_path))
|
||||
|
||||
ifeq ($(ARCH),)
|
||||
ARCH:=amd64
|
||||
|
@ -15,3 +18,14 @@ debian:
|
|||
|
||||
debian-clean:
|
||||
rm *.tgz
|
||||
|
||||
.PHONY: redhat
|
||||
redhat:
|
||||
rpmbuild --undefine=_disable_source_fetch -ba \
|
||||
--verbose $(mkfile_dir)/redhat/SPECS/coredns.spec \
|
||||
--define "_topdir $(mkfile_dir)/redhat" --define "dist $(redhat-packages-dist)"
|
||||
|
||||
redhat-clean:
|
||||
rm -r $(mkfile_dir)/redhat/RPMS/*
|
||||
rm -r $(mkfile_dir)/redhat/SRPMS/*
|
||||
rm -r $(mkfile_dir)/redhat/BUILD/*
|
||||
|
|
0
redhat/SOURCES/Corefile
Normal file
0
redhat/SOURCES/Corefile
Normal file
1
redhat/SOURCES/coredns.default
Normal file
1
redhat/SOURCES/coredns.default
Normal file
|
@ -0,0 +1 @@
|
|||
EXTRA_ARGS=
|
17
redhat/SOURCES/coredns.service
Normal file
17
redhat/SOURCES/coredns.service
Normal file
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
After=network.target
|
||||
Description=coredns server
|
||||
Documentation=http://coredns.io
|
||||
|
||||
[Service]
|
||||
User=coredns
|
||||
Type=simple
|
||||
EnvironmentFile=/etc/sysconfig/coredns
|
||||
ExecStart=/usr/bin/coredns --conf=/etc/coredns/Corefile $EXTRA_ARGS
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
SuccessExitStatus=0
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
72
redhat/SPECS/coredns.spec
Normal file
72
redhat/SPECS/coredns.spec
Normal file
|
@ -0,0 +1,72 @@
|
|||
# Specfile for CoreDNS package
|
||||
#
|
||||
|
||||
%define debug_package %{nil}
|
||||
|
||||
Name: coredns
|
||||
Summary: CoreDNS is a DNS server that chains plugins
|
||||
Version: 1.8.4
|
||||
Release: 1%{?dist}
|
||||
License: ASL 2.0
|
||||
Packager: <sayf-eddine.hammemi@scality.com>
|
||||
Group: System Environment/Base
|
||||
URL: https://coredns.io
|
||||
Source0: https://github.com/coredns/%{name}/releases/download/v%{version}/%{name}_%{version}_linux_amd64.tgz
|
||||
Source1: coredns.service
|
||||
Source2: coredns.default
|
||||
Source3: Corefile
|
||||
BuildArch: x86_64
|
||||
BuildRoot: %{_tmppath}/%{name}-root
|
||||
|
||||
Requires(pre): shadow-utils
|
||||
%{?systemd_requires}
|
||||
|
||||
%description
|
||||
|
||||
CoreDNS is a fast and flexible DNS server. The key word here is flexible: with CoreDNS you are able to do what you want with your DNS data by utilizing plugins. If some functionality is not provided out of the box you can add it by writing a plugin.
|
||||
|
||||
%prep
|
||||
%setup -c
|
||||
cp %{SOURCE1} .
|
||||
cp %{SOURCE2} .
|
||||
cp %{SOURCE3} .
|
||||
%build
|
||||
# Nothing to build
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
install -D -m 755 coredns %{buildroot}%{_bindir}/coredns
|
||||
install -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/coredns/Corefile
|
||||
|
||||
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/coredns.service
|
||||
install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/coredns
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%pre
|
||||
getent group coredns >/dev/null || groupadd -r coredns
|
||||
getent passwd coredns >/dev/null || \
|
||||
useradd -r -g coredns -s /sbin/nologin \
|
||||
-c "CoreDNS services" coredns
|
||||
exit 0
|
||||
|
||||
%post
|
||||
%systemd_post coredns.service
|
||||
|
||||
%preun
|
||||
%systemd_preun coredns.service
|
||||
|
||||
%postun
|
||||
%systemd_postun coredns.service
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_unitdir}/coredns.service
|
||||
%{_bindir}/coredns
|
||||
%config(noreplace) %{_sysconfdir}/coredns/Corefile
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/coredns
|
||||
|
||||
%changelog
|
||||
* Sun Jul 4 2021 SayfEddine HAMMEMI <sayf-eddine.hammemi@scality.com> 1.8.4
|
||||
- Package coredns 1.8.4
|
Loading…
Reference in a new issue