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