Merge branch 'master' into el6

This commit is contained in:
Nick Bebout 2011-08-14 15:08:29 -05:00
commit 32dcb9e61e
6 changed files with 178 additions and 12 deletions

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ znc-0.094.tar.gz
/znc-0.099.tar.xz
/znc-0.2-alpha1.tar.gz
/znc-0.2-beta1.tar.gz
/znc-0.200-rc1.tar.gz

View File

@ -1 +1 @@
fc93f5a66ace23aa6d8b289a50213008 znc-0.2-beta1.tar.gz
40b99830fac3f5ee813d3ab04b4b9e74 znc-0.200-rc1.tar.gz

View File

@ -1,10 +1,10 @@
--- znc-0.2-alpha1-original/znc.cpp 2011-08-05 16:27:44.000000000 -0500
+++ znc-0.2-alpha1/znc.cpp 2011-08-05 17:14:15.293147148 -0500
--- znc-0.200-rc1-orig/znc.cpp 2011-08-13 01:36:13.000000000 -0500
+++ znc-0.200-rc1/znc.cpp 2011-08-13 16:56:21.118177776 -0500
@@ -84,7 +84,7 @@
}
char szBuf[128];
- snprintf(szBuf, sizeof(szBuf), "ZNC %1.1f"VERSION_EXTRA" - http://znc.in", VERSION);
- snprintf(szBuf, sizeof(szBuf), "ZNC %1.3f"VERSION_EXTRA" - http://znc.in", VERSION);
+ snprintf(szBuf, sizeof(szBuf), "ZNC %1.3f - http://znc.in", VERSION);
// If snprintf overflows (which I doubt), we want to be on the safe side
szBuf[sizeof(szBuf) - 1] = '\0';

90
znc.init Normal file
View File

@ -0,0 +1,90 @@
#!/bin/sh
#
# znc - Advanced IRC Bouncer INIT script for Fedora #
# chkconfig: 35 99 14
# description: An Advanced IRC bouncer INIT script for
# Fedora-CentOS Variants
# Source function library.
. /etc/rc.d/init.d/functions
exec=/usr/bin/znc
prog=znc
config=/home/znc/.znc
runas=znc
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
echo -n $"Starting $prog: "
# if not running, start it up here, usually something like "daemon $exec"
daemon --user $runas "$exec -d $config >/dev/null 2>&1"
# If you're reckless with your system, comment the line above and
# uncomment this one below... I just don't get it why
# daemon "$exec -r -d $config >/dev/null 2>&1"
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
# stop it here, often "killproc $prog"
killproc $prog -TERM
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
reload() {
echo -n $"Reloading $prog: "
# stop it here, often "killproc $prog"
killproc $prog -HUP
retval=$?
echo
}
restart() {
stop
start
}
rh_status() {
# run checks to determine if the service is running or use generic status
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart|try-restart}"
exit 2
esac
exit $?

11
znc.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Daemon to do something
After=network.target
[Service]
ExecStart=/usr/bin/znc
User=znc
Type=forking
[Install]
WantedBy=multi-user.target

View File

@ -1,14 +1,24 @@
# Define variables to use in conditionals
%define use_systemd 0
%if 0%{?fedora} >= 15
%define use_systemd 1
%endif
Summary: An advanced IRC bouncer
Name: znc
Version: 0.2
Version: 0.200
#Release: 0.1.20110801git%{?dist}
Release: 0.2.beta1%{?dist}
Release: 0.2.rc1%{?dist}
#Release: 1%{?dist}
License: GPLv2 with exceptions
Group: System Environment/Daemons
URL: http://znc.in
#Source0: znc-0.099.tar.xz
Source0: http://people.znc.in/~psychon/znc/releases/znc-0.2-beta1.tar.gz
Source0: http://people.znc.in/~psychon/znc/releases/znc-0.200-rc1.tar.gz
%if %{use_systemd}
Source1: znc.service
%endif
#Source0: http://people.znc.in/~psychon/znc/releases/znc-0.098.tar.gz
Patch0: znc-release.patch
#Patch1: znc-modperl.patch
@ -23,6 +33,16 @@ BuildRequires: openssl-devel >= 0.9.8
BuildRequires: cyrus-sasl-devel
BuildRequires: c-ares-devel automake
BuildRequires: perl(ExtUtils::Embed) swig tcl-devel
%if %{use_systemd}
BuildRequires: systemd-units
%endif
Requires(pre): shadow-utils
%if %{use_systemd}
Requires(post): systemd-units
Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
%description
ZNC is an IRC bouncer with many advanced features like detaching,
@ -67,12 +87,8 @@ TCL module for ZNC
#perl module for ZNC
%prep
#%setup -q -n %{name}-alpha1
%setup -q -n znc-0.2-beta1
#%setup -q -n %{name}-%{version}-rc1
%setup -q -n %{name}-%{version}-rc1
%patch0 -p1
#%patch1 -p1
#%patch2 -p1
%__perl -pi.add_release -e 's|(?<="ZNC \%1\.3f)|-%{release}|' znc.cpp
chmod -x modules/q.cpp
@ -83,13 +99,52 @@ chmod -x modules/q.cpp
--enable-ipv6 --enable-extra --enable-sasl --disable-perl --enable-tcl
%__make %{?_smp_mflags}
%pre
getent group znc >/dev/null || groupadd -r znc
getent passwd znc >/dev/null || \
useradd -r -g znc -d /home/znc -s /sbin/nologin \
-c "Account for ZNC to run as" znc
mkdir -p /home/znc
chown znc:znc /home/znc
exit 0
%install
%__rm -Rf "%{buildroot}"
%__make install DESTDIR="%{buildroot}"
%if %{use_systemd}
mkdir -p %buildroot%{_unitdir}
install -m 0644 %{SOURCE1} %buildroot%{_unitdir}/znc.service
%endif
%clean
%__rm -Rf "%{buildroot}"
%post
%if %{use_systemd}
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%endif
%postun
%if %{use_systemd}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart znc.service >/dev/null 2>&1 || :
fi
%endif
%preun
%if %{use_systemd}
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable znc.service > /dev/null 2>&1 || :
/bin/systemctl stop znc.service > /dev/null 2>&1 || :
fi
%endif
%files
%defattr(-,root,root)
%doc AUTHORS LICENSE LICENSE.OpenSSL README.md
@ -134,6 +189,9 @@ chmod -x modules/q.cpp
%{_libdir}/znc/watch.so
%{_libdir}/znc/webadmin.so
%{_datadir}/znc/
%if %{use_systemd}
%{_unitdir}/znc.service
%endif
%files devel
%defattr(-,root,root)
@ -175,6 +233,12 @@ chmod -x modules/q.cpp
#%{_libdir}/znc/perleval.pm
%changelog
* Sun Aug 14 2011 Nick Bebout <nb@fedoraproject.org> - 0.200-0.2.rc1
- Create /home/znc upon install
* Sat Aug 13 2011 Nick Bebout <nb@fedoraproject.org> - 0.200-0.1.rc1
- Update to 0.200-rc1
* Sat Aug 6 2011 Nick Bebout <nb@fedoraproject.org> - 0.2-0.2.beta1
- Update to 0.2-beta1, disable perl for now