diff --git a/.gitignore b/.gitignore index 6d27b44..45f0c4b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,3 @@ ngircd-16.tar.gz /ngircd-24.tar.gz /ngircd-25.tar.gz /ngircd-26.tar.gz -/ngircd-26.1.tar.gz -/ngircd-27.tar.gz diff --git a/ngircd-configure-c99.patch b/ngircd-configure-c99.patch deleted file mode 100644 index 0a62d83..0000000 --- a/ngircd-configure-c99.patch +++ /dev/null @@ -1,42 +0,0 @@ -Include for memset in WORKING_GETADDRINFO probe. -Otherwise, the probe always fails with compilers which do not support -implicit function declarations. - -Submitted upstream: - -diff --git a/configure b/configure -index 4435369c657b6fd6..242230bc334f7d4e 100755 ---- a/configure -+++ b/configure -@@ -6286,6 +6286,7 @@ else - #include - #include - #include -+#include - int - main(int argc, char **argv) - { -diff --git a/configure.ac b/configure.ac -index 609be364e0d03fef..1d98fd965a844808 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -101,6 +101,7 @@ AC_DEFUN([WORKING_GETADDRINFO],[ - #include - #include - #include -+#include - int - main(int argc, char **argv) - { -diff --git a/configure.ng b/configure.ng -index 59d9d9fe8fd5e469..1195b9e53af2364c 100644 ---- a/configure.ng -+++ b/configure.ng -@@ -101,6 +101,7 @@ AC_DEFUN([WORKING_GETADDRINFO],[ - #include - #include - #include -+#include - int - main(int argc, char **argv) - { diff --git a/ngircd-fedora.patch b/ngircd-fedora.patch index 5e997b2..85fdf5c 100644 --- a/ngircd-fedora.patch +++ b/ngircd-fedora.patch @@ -1,26 +1,28 @@ -diff --color -Nur ngircd-27.orig/doc/sample-ngircd.conf.tmpl ngircd-27/doc/sample-ngircd.conf.tmpl ---- ngircd-27.orig/doc/sample-ngircd.conf.tmpl 2024-05-11 16:18:32.156364779 -0700 -+++ ngircd-27/doc/sample-ngircd.conf.tmpl 2024-05-11 16:19:47.972042211 -0700 -@@ -49,6 +49,7 @@ +diff -up ngircd-23/doc/sample-ngircd.conf.tmpl.fedora ngircd-23/doc/sample-ngircd.conf.tmpl +--- ngircd-23/doc/sample-ngircd.conf.tmpl.fedora 2015-08-20 08:29:56.000000000 -0600 ++++ ngircd-23/doc/sample-ngircd.conf.tmpl 2015-11-17 12:26:54.905029870 -0700 +@@ -45,7 +45,7 @@ + # listen. Default values are: # "0.0.0.0" or (if compiled with IPv6 support) "::,0.0.0.0" # so the server listens on all IP addresses of the system by default. - ;Listen = 127.0.0.1,192.168.0.1 +- ;Listen = 127.0.0.1,192.168.0.1 + Listen = 127.0.0.1 # Text file with the "message of the day" (MOTD). This message will - # be shown to all users connecting to the server: Default: a built-in -@@ -82,6 +83,7 @@ + # be shown to all users connecting to the server: +@@ -77,14 +77,14 @@ + # Group ID under which the ngIRCd should run; you can use the name # of the group or the numerical ID. ATTENTION: For this to work the # server must have been started with root privileges! - ;ServerGID = 65534 +- ;ServerGID = 65534 + ServerGID = ngircd # User ID under which the server should run; you can use the name # of the user or the numerical ID. ATTENTION: For this to work the -@@ -89,6 +91,7 @@ + # server must have been started with root privileges! In addition, # the configuration and MOTD files must be readable by this user, # otherwise RESTART and REHASH won't work! - ;ServerUID = 65534 +- ;ServerUID = 65534 + ServerUID = ngircd [Limits] diff --git a/ngircd-service.patch b/ngircd-service.patch index c49250f..26b7938 100644 --- a/ngircd-service.patch +++ b/ngircd-service.patch @@ -1,37 +1,34 @@ -diff --color -Nur ngircd-27.orig/contrib/ngircd.service ngircd-27/contrib/ngircd.service ---- ngircd-27.orig/contrib/ngircd.service 2024-04-13 02:33:33.000000000 -0700 -+++ ngircd-27/contrib/ngircd.service 2024-05-12 09:07:55.595471549 -0700 -@@ -12,10 +12,10 @@ +diff -Nur ngircd-24.orig/contrib/ngircd.service ngircd-24/contrib/ngircd.service +--- ngircd-24.orig/contrib/ngircd.service 2017-01-07 13:24:46.000000000 -0700 ++++ ngircd-24/contrib/ngircd.service 2017-01-28 15:36:45.127789109 -0700 +@@ -11,11 +11,8 @@ + Before=bopm.service [Service] - Type=notify +-Type=forking -User=irc -Group=irc -+User=ngircd -+Group=ngircd # Settings & limits: -CapabilityBoundingSet=CAP_SYS_CHROOT CAP_NET_BIND_SERVICE -+CapabilityBoundingSet=CAP_SYS_CHROOT CAP_NET_BIND_SERVICE CAP_KILL ++CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_SYS_CHROOT CAP_NET_BIND_SERVICE CAP_KILL MemoryDenyWriteExecute=yes NoNewPrivileges=yes PrivateDevices=yes -@@ -27,17 +27,12 @@ +@@ -27,15 +24,8 @@ ProtectSystem=full RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX RestrictRealtime=yes -RuntimeDirectory=ircd -+RuntimeDirectory=ngircd - RuntimeDirectoryMode=750 - StandardError=journal - StandardOutput=journal +-RuntimeDirectoryMode=750 -# Try to load "default files" from any Debian package variant to keep this -# unit generic. -EnvironmentFile=-/etc/default/ngircd -EnvironmentFile=-/etc/default/ngircd-full -EnvironmentFile=-/etc/default/ngircd-full-dbg # Start ngIRCd. Note: systemd doesn't allow to use $DAEMON here! --ExecStart=/usr/sbin/ngircd --nodaemon --syslog $PARAMS -+ExecStart=/usr/sbin/ngircd --nodaemon --syslog +-ExecStart=/usr/sbin/ngircd $PARAMS ++ExecStart=/usr/sbin/ngircd -n ExecReload=/bin/kill -HUP $MAINPID - # Error handling: - # ngIRCd tries to "ping" the service manager every 3 seconds. + Restart=on-failure + +Binary files ngircd-24.orig/contrib/.ngircd.service.swp and ngircd-24/contrib/.ngircd.service.swp differ diff --git a/ngircd.spec b/ngircd.spec index acb4468..d0f05c5 100644 --- a/ngircd.spec +++ b/ngircd.spec @@ -1,9 +1,8 @@ Name: ngircd -Version: 27 -Release: 6%{?dist} +Version: 26 +Release: 3%{?dist} Summary: Next Generation IRC Daemon -# Automatically converted from old format: GPLv2+ - review is highly recommended. -License: GPL-2.0-or-later +License: GPLv2+ URL: http://ngircd.barton.de/ Source0: http://ngircd.barton.de/pub/ngircd/ngircd-%{version}.tar.gz Source1: ngircd.init @@ -16,18 +15,25 @@ Patch1: ngircd-cipher.patch # add CAP_KILL to allow reload Patch2: ngircd-service.patch -BuildRequires: make BuildRequires: gcc BuildRequires: zlib-devel, avahi-compat-howl-devel BuildRequires: gnutls-devel BuildRequires: pam-devel # Needed for tests BuildRequires: expect procps-ng telnet openssl +%if 0%{?rhel} > 6 || 0%{?fedora} BuildRequires: systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd +%else +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(postun): /sbin/service +%endif +Requires(pre): shadow-utils %description ngIRCd is a free open source daemon for Internet Relay Chat (IRC), @@ -35,18 +41,20 @@ developed under the GNU General Public License (GPL). It's written from scratch and is not based upon the original IRCd like many others. %prep -%autosetup -p1 - -# Create a sysusers.d config file -cat >ngircd.sysusers.conf < 7 +%if 0%{?fedora} || 0%{?rhel} > 7 +%patch1 -p1 -b .cipher +%endif +%patch2 -p1 -b .service %build %configure \ --with-syslog \ --with-zlib \ --with-epoll \ + --with-zeroconf \ --with-gnutls \ --with-pam \ --enable-ipv6 @@ -58,7 +66,17 @@ make %{?_smp_mflags} rm -rf %{buildroot} make install DESTDIR=%{buildroot} +%if 0%{?rhel} > 6 || 0%{?fedora} +# Upstream service file uses options only in newer systemd +%if 0%{?fedora} install -D -m 644 contrib/ngircd.service %{buildroot}%{_unitdir}/ngircd.service +%else +install -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/ngircd.service +%endif +%else +install -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/ngircd +%endif + install -D -m 660 doc/sample-ngircd.conf %{buildroot}%{_sysconfdir}/ngircd.conf mkdir -p %{buildroot}%{_sysconfdir}/pam.d @@ -66,23 +84,54 @@ install -D -m 660 ./contrib/Debian/ngircd.pam %{buildroot}%{_sysconfdir}/pam.d/n touch %{buildroot}%{_sysconfdir}/ngircd.motd rm %{buildroot}%{_docdir}/ngircd/INSTALL.md +%if 0%{?rhel} > 6 || 0%{?fedora} mkdir -p %{buildroot}%{_tmpfilesdir} echo d /run/ngircd 0750 ngircd ngircd - > %{buildroot}%{_tmpfilesdir}/ngircd.conf - -install -m0644 -D ngircd.sysusers.conf %{buildroot}%{_sysusersdir}/ngircd.conf +%else +mkdir -p %{buildroot}%{_localstatedir}/run/ngircd +%endif %check +# +# Disable i686 tests pending https://github.com/ngircd/ngircd/issues/280 +# +%ifnarch %{ix86} make check +%endif +%pre +getent group ngircd >/dev/null || groupadd -r ngircd +getent passwd ngircd >/dev/null || \ + useradd -r -g ngircd -d /tmp/ -s /sbin/nologin \ + -c "Next Generation IRC Daemon" ngircd +exit 0 %post +%if 0%{?rhel} > 6 || 0%{?fedora} %systemd_post ngircd.service +%else +# This adds the proper /etc/rc*.d links for the script +/sbin/chkconfig --add ngircd +%endif %preun +%if 0%{?rhel} > 6 || 0%{?fedora} %systemd_preun ngircd.service +%else +if [ $1 = 0 ]; then + /sbin/service ngircd stop >/dev/null 2>&1 || : + /sbin/chkconfig --del ngircd +fi +%endif %postun +%if 0%{?rhel} > 6 || 0%{?fedora} %systemd_postun_with_restart ngircd.service +%else +if [ "$1" -ge "1" ]; then + /sbin/service ngircd condrestart >/dev/null 2>&1 || : +fi +%endif %files %{!?_licensedir:%global license %%doc} @@ -90,71 +139,22 @@ make check %config(noreplace) %attr(660, root, ngircd) %{_sysconfdir}/ngircd.conf %config(noreplace) %attr(660, root, ngircd) %{_sysconfdir}/pam.d/ngircd %ghost %config(noreplace) %attr(660, root, ngircd) %{_sysconfdir}/ngircd.motd +%if 0%{?rhel} > 6 || 0%{?fedora} %{_unitdir}/ngircd.service +%else +%{_initrddir}/ngircd +%endif %{_sbindir}/ngircd %{_docdir}/ngircd/ %{_mandir}/man5/ngircd.conf* %{_mandir}/man8/ngircd.8* +%if 0%{?rhel} > 6 || 0%{?fedora} %{_tmpfilesdir}/ngircd.conf -%{_sysusersdir}/ngircd.conf +%else +%dir %attr(750, ngircd, ngircd) %{_localstatedir}/run/ngircd/ +%endif %changelog -* Thu Jul 24 2025 Fedora Release Engineering - 27-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek - 27-5 -- Add sysusers.d config file to allow rpm to create users/groups automatically - -* Fri Jan 17 2025 Fedora Release Engineering - 27-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Fri Jul 26 2024 Miroslav Suchý - 27-3 -- convert license to SPDX - -* Thu Jul 18 2024 Fedora Release Engineering - 27-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sat May 11 2024 Kevin Fenzi - 27-1 -- Update to 27. Fixes rhbz#2274888 -- Clean up and drop old conditionals. - -* Thu Jan 25 2024 Fedora Release Engineering - 26.1-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sun Jan 21 2024 Fedora Release Engineering - 26.1-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Thu Jul 20 2023 Fedora Release Engineering - 26.1-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Thu Feb 02 2023 Florian Weimer - 26.1-8 -- Port configure script to C99 - -* Thu Jan 19 2023 Fedora Release Engineering - 26.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Fri Jul 22 2022 Fedora Release Engineering - 26.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Thu Jan 20 2022 Fedora Release Engineering - 26.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Thu Jul 22 2021 Fedora Release Engineering - 26.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 26.1-3 -- Rebuilt for updated systemd-rpm-macros - See https://pagure.io/fesco/issue/2583. - -* Tue Jan 26 2021 Fedora Release Engineering - 26.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Sun Jan 03 2021 Kevin Fenzi - 26.1-1 -- Update to 26.1. rhbz#1912027 - -* Tue Jul 28 2020 Fedora Release Engineering - 26-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - * Sun Jun 28 2020 Kevin Fenzi - 26-3 - Fix arch conditional for tests. :( diff --git a/sources b/sources index 0e9026e..bf5e38e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ngircd-27.tar.gz) = 54ad38b3f5a9a899106c1163f53f45c5b021f6bad3ea3b7cb9b06e619434d76416d494b046508f588b334daba5b39a451bbf28e6196ef8fffa0408e395ea3839 +SHA512 (ngircd-26.tar.gz) = 2502baf83e3bfca3e6b83c22fe660fee24732ee875b32a7071a489a8babcc08124738142215b55d4f9bd4e94bec3f2a41889ab18324f772b1674b02883cbfb91