Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37412959
en ru br
ALT Linux repositórios
S:2.89-alt2
5.0: 2.45-alt2
4.1: 2.41-alt4.M41.1
4.0: 2.38-alt1
3.0: 2.22-alt2

Group :: Sistema/Servidores
RPM: dnsmasq

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

%def_with libidn2

Name: dnsmasq
Version: 2.89

Release: alt2
Summary: A lightweight caching nameserver
License: GPLv2+
Group: System/Servers
Url: https://thekelleys.org.uk/dnsmasq/
Vcs: git://thekelleys.org.uk/dnsmasq.git
Source0: %name-%version.tar
Source1: %name.init
Source2: %name.sysconfig
Source3: %name-helper
Source4: %name.service
Patch: %name-%version-%release.patch

# Patches from upstream git, must be droped

# wen new version will be released.
Patch1: Avoid-undefined-behaviour-with-the-ctype-3-functions.patch
Patch2: Fix-rev-server-option.-It-was-broken-in-1db9943c6879.patch
Patch3: Fix-possible-SEGV-when-no-servers-defined.patch

# Fixes CVE-2023-28450

Patch4: Set-the-default-maximum-DNS-UDP-packet-size-to-1232.patch

Patch5: Fix-DHCPv6-use-multicast-response-which-previously-f.patch

BuildPreReq: glibc-kernheaders

# IDN

%if_with libidn2
BuildRequires: libidn2-devel
%else
BuildRequires: libidn-devel
%endif

# DNSSEC

BuildRequires: libnettle-devel libgmp-devel

%define sysconfig_file %_sysconfdir/sysconfig/%name
%define _unpackaged_files_terminate_build 1

Summary(ru_RU.UTF-8): Компактный сервер DNS и DHCP для локальных сетей

%description
Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server. It
is designed to provide DNS and, optionally, DHCP, to a small network. It can
serve the names of local machines which are not in the global DNS. The DHCP
server integrates with the DNS server and allows machines with DHCP-allocated
addresses to appear in the DNS with names configured either in each host or
in a central configuration file. Dnsmasq supports static and dynamic DHCP
leases and BOOTP for network booting of diskless machines.

%description -l ru_RU.UTF-8
Dnsmasq - это компактный, простой в настройке сервер DNS и DHCP,
разработанный для использования в небольших сетях.
По умолчанию он использует общесистемные файлы /etc/hosts и /etc/resolv.conf,
поэтому может использоваться без настройки сразу после установки.

Очень удобными функциями являются прозрачное переопределение внешних имён
через /etc/hosts и трансляция имени в наиболее подходящий клиенту IP-адрес,
если для имени определено несколько адресов из разных подсетей.

%package        utils
Summary:        Utilities for manipulating DHCP server leases
Group:          Networking/Other

%description    utils
Utilities that use the standard DHCP protocol to
query/remove a DHCP server's leases.

%prep
%setup
%patch -p1

%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1

# Setup version

sed -r -i "s;-DVERSION=.+;-DVERSION='\\\\\"%version\\\\\"';" Makefile

#enable IDN support

%if_with libidn2
sed -i 's;/\* #define HAVE_LIBIDN2 \*/;#define HAVE_LIBIDN2;' src/config.h
%else
sed -i 's;/\* #define HAVE_IDN \*/;#define HAVE_IDN;' src/config.h
%endif

#enable DNSSEC support

sed -i 's;/\* #define HAVE_DNSSEC \*/;#define HAVE_DNSSEC;' src/config.h

%build
# E2K: EDG-based compiler has many false positives
%ifnarch %e2k
%add_optflags -Werror
%endif
%make_build
%make_build -C contrib/lease-tools

%install
%makeinstall_std PREFIX=%prefix

install -d -m770 %buildroot%_sysconfdir/dnsmasq.conf.d
install -pD -m744 %SOURCE1            %buildroot%_initdir/%name
install -pD -m600 %SOURCE2            %buildroot%sysconfig_file
install -pD -m600 %name.conf.example  %buildroot%_sysconfdir/%name.conf
install -pD -m755 %SOURCE3            %buildroot%_sbindir/%name-helper
install -pD -m644 %SOURCE4            %buildroot%_unitdir/%name.service

# For utils package

install -pD -m 755 contrib/lease-tools/dhcp_release %buildroot%_bindir/dhcp_release
install -pD -m 644 contrib/lease-tools/dhcp_release.1 %buildroot%_man1dir/dhcp_release.1
install -pD -m 755 contrib/lease-tools/dhcp_lease_time %buildroot%_bindir/dhcp_lease_time
install -pD -m 644 contrib/lease-tools/dhcp_lease_time.1 %buildroot%_man1dir/dhcp_lease_time.1

# For DNSSEC support

install -pD -m 644 trust-anchors.conf %buildroot%_datadir/%name/trust-anchors.conf

%pre
# Upgrade configuration from previous versions
if test -e %sysconfig_file; then
if grep -Eq '^[^#]*ALL *=' %sysconfig_file; then
   if ! grep -Eq '^[^#]*ALL_DEV *=' %sysconfig_file; then
echo 'NOTE: You should put ALL_DEV=<interface> to %sysconfig_file'
echo '      for keeping DHCP broadcasts mode.'
   fi
fi
fi
# Create dnsmasq user
groupadd -r -f _dnsmasq ||:
useradd -r -g _dnsmasq -d /dev/null -s /dev/null -N _dnsmasq >/dev/null 2>&1 ||:

%post
%post_service %name

%preun
%preun_service %name

%files
%doc CHANGELOG FAQ doc.html setup.html CHANGELOG.archive
%config(noreplace) %_sysconfdir/%name.conf
%dir %_datadir/%name/
%config(noreplace) %_datadir/%name/trust-anchors.conf
%config(noreplace) %_sysconfdir/sysconfig/%name
%dir %_sysconfdir/dnsmasq.conf.d
%_unitdir/%name.service
%_initdir/%name
%_sbindir/%{name}*
%_man8dir/%{name}*
%doc contrib/dnslist contrib/dynamic-dnsmasq

%files utils
%_bindir/dhcp_*
%_man1dir/dhcp_*

%changelog

Todas as alterações você pod ver aqui

 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009