2 # - bncsetup still not working, needs newer dialog
3 Summary: Simple IRC bouncer
4 Summary(pl): Proste narzêdzie do tunelowania irc
9 Group: Networking/Utilities
10 # http://gotbnc.com/files/%{name}%{version}.tar.gz - doesn't work with distfiles, reason unknown
11 #Source0: ftp://distfiles.pld-linux.org/src/%{name}%{version}.tar.gz
12 Source0: http://www.gotbnc.com/files/%{name}%{version}.tar.gz
13 # Source0-md5: 5012f3eb112f0fda545b1aaf66a06150
14 Source1: %{name}.sysconfig
17 Patch0: %{name}-setup.patch
18 Patch1: %{name}-typo.patch
19 URL: http://www.gotbnc.com/
20 BuildRequires: autoconf
21 BuildRequires: automake
22 BuildRequires: openssl-devel
23 BuildRequires: rpmbuild(macros) >= 1.177
26 Requires: dialog >= 1:0.69
27 Requires: /sbin/start-stop-daemon
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define _sysconfdir /etc/%{name}
36 BNC is a great IRC (Internet Relay Chat) proxying server under the GPL
37 (General Public License). It allows users to connect to chat servers
38 by bouncing off the computer which is running BNC. Basically, it
39 forwards the information from the user to the server and vise versa.
42 BNC jest rewelacyjnym i prostym proxy do IRC (Internet Relay Chat) na
43 licencji GPL (General Public License). BNC pozwala u¿ytkownikom na
44 po³±czenie siê z serwerem IRC wykorzystuj±c do tego komputer na którym
45 BNC zosta³o uruchomione. Mówi±c w skrócie, BNC przekazuje informacje
46 od u¿ytkownika do serwera i vice versa.
49 %setup -q -n %{name}%{version}
54 cp -f /usr/share/automake/config.sub .
60 CFLAGS="%{rpmcflags}" \
61 OFLAGS="%{rpmcflags}" \
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_bindir},%{_sysconfdir},/var/{log,run/%{name}}}
67 install bnc $RPM_BUILD_ROOT%{_bindir}
68 install bncsetup $RPM_BUILD_ROOT%{_bindir}/bncsetup
69 install mkpasswd $RPM_BUILD_ROOT%{_bindir}/bncmkpasswd
70 install motd $RPM_BUILD_ROOT%{_sysconfdir}/motd
71 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
72 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
73 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
74 > $RPM_BUILD_ROOT/var/log/%{name}.log
77 rm -rf $RPM_BUILD_ROOT
80 if [ -n "`/usr/bin/getgid %{name}`" ]; then
81 if [ "`/usr/bin/getgid %{name}`" != %{groupid} ]; then
82 echo "Error: group %{name} doesn't have gid=%{groupid}. Correct this before installing %{name}." 1>&2
86 /usr/sbin/groupadd -g %{groupid} %{name}
88 if [ -n "`/bin/id -u %{name} 2>/dev/null`" ]; then
89 if [ "`/bin/id -u %{name}`" != %{userid} ]; then
90 echo "Error: user %{name} doesn't have uid=%{userid}. Correct this before installing %{name}." 1>&2
94 /usr/sbin/useradd -u %{userid} -d /var/run/%{name} -s /bin/false \
95 -c "%{name} User" -g %{name} %{name} 1>&2
99 if ! egrep -q '^(adminpass|password)' /etc/bnc/bnc.conf; then
100 %banner %{name} -e <<EOF
101 You need to setup passwords in /etc/bnc/bnc.conf!
102 The daemon will not start unless you've set them!
109 # add service just once
110 [ "$1" = "1" ] && /sbin/chkconfig --add %{name}
112 if [ -f /var/lock/subsys/%{name} ]; then
113 /etc/rc.d/init.d/%{name} restart 1>&2
115 echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
119 if [ "$1" = "0" ]; then
120 if [ -f /var/lock/subsys/%{name} ]; then
121 /etc/rc.d/init.d/%{name} stop 1>&2
123 /sbin/chkconfig --del %{name}
127 if [ "$1" = "0" ]; then
133 %defattr(644,root,root,755)
134 %doc README Changelog motd example.conf bncchk
135 %dir %attr(750,bnc,bnc) %{_sysconfdir}
136 %config(noreplace) %verify(not size mtime md5) %attr(640,bnc,bnc) %{_sysconfdir}/*
138 %attr(755,root,root) %{_bindir}/*
139 %attr(754,root,root) /etc/rc.d/init.d/%{name}
140 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/%{name}
142 %dir %attr(750,bnc,bnc) /var/run/%{name}
143 %attr(620,bnc,bnc) %ghost /var/log/%{name}.log