[znc/el5: 27/29] skip the python-subpkg on EPEL <= 7 replaced %%define with %%global removed %%defattr, since it is n

Björn Esser besser82 at fedoraproject.org
Sun Aug 3 19:03:24 UTC 2014


commit 9f106b2b1fc979fa1a0fdaec4be3ada5bb524afd
Author: Björn Esser <bjoern.esser at gmail.com>
Date:   Sun Aug 3 20:52:29 2014 +0200

    skip the python-subpkg on EPEL <= 7
    replaced %%define with %%global
    removed %%defattr, since it is not needed for recent releases
    conditionalized stuff for el <= 5
    small cleanups
    purged unused patches

 znc-crashbug.patch  |   37 ----------
 znc-modperl.patch   |   11 ---
 znc-modpython.patch |   11 ---
 znc-release.patch   |   11 ---
 znc.spec            |  193 ++++++++++++++++++++++++++++++---------------------
 5 files changed, 115 insertions(+), 148 deletions(-)
---
diff --git a/znc.spec b/znc.spec
index c5aaa46..c530084 100644
--- a/znc.spec
+++ b/znc.spec
@@ -1,69 +1,72 @@
-# Define variables to use in conditionals
-%define use_systemd 0
+# ZNC is a daemon application and that's why needs hardening
+%global _hardened_build 1
 
-%if 0%{?fedora} >= 15
-%define use_systemd 1
-%endif
+# Define variables to use in conditionals
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%global use_systemd 1
+%endif # 0%{?fedora} >= 15 || 0%{?rhel} >= 7
 
-%global _hardened_build 1
+%if 0%{?fedora} || 0%{?rhel} >= 6
+%global with_modperl 1
+%endif # 0%{?fedora} || 0%{?rhel} >= 6
 
-%global __python %{__python3}
+%if 0%{?fedora} >= 13 || 0%{?rhel} >= 8
+%global with_modpython 1
+%endif # 0%{?fedora} >= 13 || 0%{?rhel} >= 8
 
-Summary:        An advanced IRC bouncer
 Name:           znc
 Version:        1.4
-#Release:        0.1.20110801git%{?dist}
-#Release:        0.4.rc2%{?dist}
-Release:        4%{?dist}
-License:        ASL 2.0
+Release:        5%{?dist}
+Summary:        An advanced IRC bouncer
 Group:          System Environment/Daemons
+
+License:        ASL 2.0
 URL:            http://znc.in
-Source0:        http://znc.in/releases/znc-1.4.tar.gz
-#Patch0:         znc-crashbug.patch
+Source0:        %{url}/releases/%{name}-%{version}.tar.gz
 
-%if %{use_systemd}
+%if 0%{?use_systemd}
 Source1:        znc.service
-%endif
-
-%if !%{use_systemd}
+%else # 0%{?use_systemd}
 Source1:        znc.init
-%endif
+%endif # 0%{?use_systemd}
 
-# git clone https://github.com/znc/znc.git
-# cd znc
-# git archive --prefix=znc/ HEAD | xz > ../znc-0.097.tar.gz
+%if 0%{?rhel} && 0%{?rhel} <= 5
+BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+%endif # 0%{?rhel} && 0%{?rhel} <= 5
 
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires:  perl gcc-c++
+BuildRequires:  automake
+BuildRequires:  c-ares-devel
+BuildRequires:  cyrus-sasl-devel
+BuildRequires:  gettext-devel
 BuildRequires:  openssl-devel >= 0.9.8
-BuildRequires:  cyrus-sasl-devel gettext-devel
-BuildRequires:  c-ares-devel automake python3-devel
-BuildRequires:  perl(ExtUtils::Embed) swig tcl-devel
+BuildRequires:  perl(ExtUtils::Embed)
+
+%if (0%{?fedora} && 0%{?fedora} <= 24) || (0%{?rhel} && 0%{?rhel} <= 9)
 Obsoletes:      znc-extra <= %{version}-%{release}
+%endif # (0%{?fedora} && 0%{?fedora} <= 24) || (0%{?rhel} && 0%{?rhel} <= 9)
 
-%if %{use_systemd}
+%if 0%{?use_systemd}
 BuildRequires: systemd-units
 %endif
 Requires(pre):  shadow-utils
-%if %{use_systemd}
+%if 0%{?use_systemd}
 Requires(post): systemd-units
 Requires(post): systemd-sysv
 Requires(preun): systemd-units
 Requires(postun): systemd-units
-%endif
-
-%if !%{use_systemd}
+%else # 0%{?use_systemd}
 Requires(post): chkconfig
 Requires(preun): chkconfig
 # This is for /sbin/service
 Requires(preun): initscripts
-%endif
+%endif # 0%{?use_systemd}
 
 %description
 ZNC is an IRC bouncer with many advanced features like detaching,
 multiple users, per channel playback buffer, SSL, IPv6, transparent
 DCC bouncing, Perl and C++ module support to name a few.
 
+
 %package devel
 Summary:        Development files needed to compile ZNC modules
 Group:          Development/Libraries
@@ -75,112 +78,138 @@ BuildRequires: pkgconfig
 All includes and program files you need to compile your own znc
 modules.
 
+
 %package modtcl
 Summary:       TCL module for ZNC
 Group:         Development/Libraries
+
+BuildRequires: tcl-devel
+
 Requires:      %{name} = %{version}-%{release}
 Requires:      tcl
 
 %description modtcl
 TCL module for ZNC
 
+
+%if 0%{?with_modperl}
 %package modperl
 Summary:       perl module for ZNC
 Group:         Development/Libraries
+
+BuildRequires: perl-devel
+BuildRequires: swig
+
 Requires:      %{name} = %{version}-%{release}
 Requires:      perl
+
 Provides:      perl(ZNC::Module) = %{version}-%{release}
 
 %description modperl
 perl module for ZNC
+%endif # 0%{?with_modperl}
 
+
+%if 0%{?with_modpython}
 %package modpython
 Summary:       python3 module for ZNC
 Group:         Development/Libraries
+
+BuildRequires: python3-devel
+BuildRequires: swig
+
 Requires:      %{name} = %{version}-%{release}
 Requires:      python3
 
 %description modpython
 python3 module for ZNC
+%endif # 0%{?with_modpython}
+
 
 %prep
-%setup -q -n %{name}-%{version}
-#%setup -q -n znc-1.2-rc2
-#%patch0 -p1
+%setup -q
 %__perl -pi.add_release -e 's|(?<="ZNC \%1\.3f)|-%{release}|' znc.cpp
 chmod -x modules/q.cpp
 
+
 %build
 ./autogen.sh
 %configure \
      --with-module-prefix=%{_libdir}/znc \
-     --enable-ipv6 --enable-sasl --enable-python --enable-perl --enable-tcl
+%if 0%{?with_modperl}
+     --enable-perl
+%else
+     --disable-perl
+%endif # 0%{?with_modperl}
+%if 0%{?with_modpython}
+     --enable-python \
+%else # 0%{?with_modpython}
+     --disable-python \
+%endif # 0%{?with_modpython}
+     --enable-ipv6 --enable-sasl --enable-tcl
 %__make %{?_smp_mflags}
 
-%pre
-#%if %{use_systemd}
-getent group znc >/dev/null || groupadd -r znc
-getent passwd znc >/dev/null || \
-    useradd -r -g znc -d /var/lib/znc -s /sbin/nologin \
-    -c "Account for ZNC to run as" znc
-mkdir -p /var/lib/znc
-chown znc:znc /var/lib/znc
-#exit 0
-#%endif
 
 %install
+%if 0%{?rhel} && 0%{?rhel} <= 5
 %__rm -Rf "%{buildroot}"
+%endif # 0%{?rhel} && 0%{?rhel} <= 5
 %__make install DESTDIR="%{buildroot}"
-%if %{use_systemd}
+%if 0%{?use_systemd}
 mkdir -p %buildroot%{_unitdir}
 install -m 0644 %{SOURCE1} %buildroot%{_unitdir}/znc.service
-%endif
-%if !%{use_systemd}
+%else # 0%{?use_systemd}
 mkdir -p %buildroot%{_initrddir}
 install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/znc
-%endif
+%endif # 0%{?use_systemd}
+
 
+%if 0%{?rhel} && 0%{?rhel} <= 5
 %clean
 %__rm -Rf "%{buildroot}"
+%endif # 0%{?rhel} && 0%{?rhel} <= 5
 
-%post
 
-%if %{use_systemd}
-%systemd_post znc.service
-%endif
+%pre
+getent group znc >/dev/null || groupadd -r znc
+getent passwd znc >/dev/null || \
+    useradd -r -g znc -d /var/lib/znc -s /sbin/nologin \
+    -c "Account for ZNC to run as" znc
+mkdir -p /var/lib/znc
+chown znc:znc /var/lib/znc
 
-%if !%{use_systemd}
+
+%post
+%if 0%{?use_systemd}
+%systemd_post znc.service
+%else # 0%{?use_systemd}
 # This adds the proper /etc/rc*.d links for the script
 /sbin/chkconfig --add znc
-%endif
+%endif # 0%{?use_systemd}
 
-%postun
 
-%if %{use_systemd}
+%postun
+%if 0%{?use_systemd}
 %systemd_postun_with_restart znc.service
-%endif
-
-%if !%{use_systemd}
+%else # 0%{?use_systemd}
 if [ "$1" -ge "1" ] ; then
     /sbin/service znc condrestart >/dev/null 2>&1 || :
 fi
-%endif
+%endif # 0%{?use_systemd}
 
-%preun
 
-%if %{use_systemd}
+%preun
+%if 0%{?use_systemd}
 %systemd_preun znc.service
-%endif
-
-%if !%{use_systemd}
+%else # 0%{?use_systemd}
 if [ $1 -eq 0 ] ; then
     /sbin/service znc stop >/dev/null 2>&1 || :
     /sbin/chkconfig --del znc || :
 fi
-%endif
+%endif # 0%{?use_systemd}
+
 
 %files
-%defattr(-,root,root)
 %doc AUTHORS LICENSE README.md
 %{_bindir}/znc
 %{_mandir}/man1/*
@@ -238,36 +267,44 @@ fi
 %{_libdir}/znc/watch.so
 %{_libdir}/znc/webadmin.so
 %{_datadir}/znc/
-%if %{use_systemd}
+%if 0%{?use_systemd}
 %{_unitdir}/znc.service
-%endif
-%if !%{use_systemd}
+%else # 0%{?use_systemd}
 %{_initrddir}/znc
-%endif
+%endif # 0%{?use_systemd}
 
 %files devel
-%defattr(-,root,root)
 %{_bindir}/znc-buildmod
 #%{_bindir}/znc-config
 %{_libdir}/pkgconfig/%{name}.pc
 %{_includedir}/znc/
 
 %files modtcl
-%defattr(-,root,root)
 %{_libdir}/znc/modtcl.so
 
+%if 0%{?with_modperl}
 %files modperl
-%defattr(-,root,root)
 %{_libdir}/znc/modperl/
 %{_libdir}/znc/modperl.so
 %{_libdir}/znc/perleval.pm
+%endif # 0%{?with_modperl}
 
+%if 0%{?with_modpython}
 %files modpython
-%defattr(-,root,root)
 %{_libdir}/znc/modpython/
 %{_libdir}/znc/modpython.so
+%endif # 0%{?with_modpython}
+
 
 %changelog
+* Sun Aug 03 2014 Björn Esser <bjoern.esser at gmail.com> - 1.4-5
+- skip the python-subpkg on EPEL <= 7
+- replaced %%define with %%global
+- removed %%defattr, since it is not needed for recent releases
+- conditionalized stuff for el <= 5
+- small cleanups
+- purged unused patches
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list