Merge branch 'master' into el5

This commit is contained in:
Nick Bebout 2012-01-23 15:13:43 -06:00
commit 5b3d8c4982
2 changed files with 49 additions and 5 deletions

View File

@ -9,7 +9,7 @@
exec=/usr/bin/znc
prog=znc
config=/home/znc/.znc
config=/var/lib/znc
runas=znc
lockfile=/var/lock/subsys/$prog

View File

@ -11,14 +11,20 @@ Summary: An advanced IRC bouncer
Name: znc
Version: 0.204
#Release: 0.1.20110801git%{?dist}
Release: 1%{?dist}
Release: 3%{?dist}
License: GPLv2 with exceptions
Group: System Environment/Daemons
URL: http://znc.in
Source0: http://znc.in/releases/znc-0.204.tar.gz
%if %{use_systemd}
Source1: znc.service
%endif
%if !%{use_systemd}
Source1: znc.init
%endif
# git clone https://github.com/znc/znc.git
# cd znc
# git archive --prefix=znc/ HEAD | xz > ../znc-0.097.tar.xz
@ -40,6 +46,13 @@ Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
%if !%{use_systemd}
Requires(post): chkconfig
Requires(preun): chkconfig
# This is for /sbin/service
Requires(preun): initscripts
%endif
%description
ZNC is an IRC bouncer with many advanced features like detaching,
multiple users, per channel playback buffer, SSL, IPv6, transparent
@ -86,15 +99,15 @@ chmod -x modules/q.cpp
%__make %{?_smp_mflags}
%pre
%if %{use_systemd}
#%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
#exit 0
#%endif
%install
%__rm -Rf "%{buildroot}"
@ -103,11 +116,16 @@ exit 0
mkdir -p %buildroot%{_unitdir}
install -m 0644 %{SOURCE1} %buildroot%{_unitdir}/znc.service
%endif
%if !%{use_systemd}
mkdir -p %buildroot%{_initrddir}
install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/znc
%endif
%clean
%__rm -Rf "%{buildroot}"
%post
%if %{use_systemd}
if [ $1 -eq 1 ] ; then
# Initial installation
@ -115,7 +133,13 @@ if [ $1 -eq 1 ] ; then
fi
%endif
%if !%{use_systemd}
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add znc
%endif
%postun
%if %{use_systemd}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
@ -124,7 +148,14 @@ if [ $1 -ge 1 ] ; then
fi
%endif
%if !%{use_systemd}
if [ "$1" -ge "1" ] ; then
/sbin/service znc condrestart >/dev/null 2>&1 || :
fi
%endif
%preun
%if %{use_systemd}
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
@ -133,6 +164,13 @@ if [ $1 -eq 0 ] ; then
fi
%endif
%if !%{use_systemd}
if [ $1 -eq 0 ] ; then
/sbin/service znc stop >/dev/null 2>&1
/sbin/chkconfig --del znc
fi
%endif
%files
%defattr(-,root,root)
%doc AUTHORS LICENSE LICENSE.OpenSSL README.md
@ -180,6 +218,9 @@ fi
%if %{use_systemd}
%{_unitdir}/znc.service
%endif
%if !%{use_systemd}
%{_initrddir}/znc
%endif
%files devel
%defattr(-,root,root)
@ -215,6 +256,9 @@ fi
%{_libdir}/znc/modtcl.so
%changelog
* Mon Jan 23 2012 Nick Bebout <nb@fedoraproject.org> - 0.204-2
- Add init script for EPEL
* Mon Jan 23 2012 Nick Bebout <nb@fedoraproject.org> - 0.204-1
- Update to 0.204 to fix security issue CVE-2012-0033