]> git.pld-linux.org Git - packages/bnc.git/blob - bnc.spec
- todo update
[packages/bnc.git] / bnc.spec
1 # TODO
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
6 Name:           bnc
7 Version:        2.9.3
8 Release:        0.9
9 License:        GPL
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
16 Source2:        %{name}.init
17 Source3:        %{name}.conf
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
25 Provides:       group(bnc)
26 Provides:       user(bnc)
27 Requires:       dialog >= 1:0.69
28 Requires:       /sbin/start-stop-daemon
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define _sysconfdir /etc/%{name}
32
33 %define userid  142
34 %define groupid 142
35
36 %description
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.
41
42 %description -l pl
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.
48
49 %prep
50 %setup -q -n %{name}%{version}
51 %patch0 -p1
52 %patch1 -p1
53
54 %build
55 cp -f /usr/share/automake/config.sub .
56 %{__autoconf}
57 %configure \
58         --with-ssl
59
60 %{__make} \
61         CFLAGS="%{rpmcflags}" \
62         OFLAGS="%{rpmcflags}" \
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_bindir},%{_sysconfdir},/var/{log,run/%{name}}}
67
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
76
77 %clean
78 rm -rf $RPM_BUILD_ROOT
79
80 %pre
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
84                 exit 1
85         fi
86 else
87         /usr/sbin/groupadd -g %{groupid} %{name}
88 fi
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
92                 exit 1
93         fi
94 else
95         /usr/sbin/useradd -u %{userid} -d /var/run/%{name} -s /bin/false \
96                 -c "%{name} User" -g %{name} %{name} 1>&2
97 fi
98
99 %post
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!
104
105 EOF
106 # ' vim
107
108 fi
109
110 # add service just once
111 [ "$1" = "1" ] && /sbin/chkconfig --add %{name}
112
113 if [ -f /var/lock/subsys/%{name} ]; then
114         /etc/rc.d/init.d/%{name} restart 1>&2
115 else
116         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
117 fi
118
119 %preun
120 if [ "$1" = "0" ]; then
121         if [ -f /var/lock/subsys/%{name} ]; then
122                 /etc/rc.d/init.d/%{name} stop 1>&2
123         fi
124         /sbin/chkconfig --del %{name}
125 fi
126
127 %postun
128 if [ "$1" = "0" ]; then
129         %userremove bnc
130         %groupremove bnc
131 fi
132
133 %files
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}/*
138
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}
142
143 %dir %attr(750,bnc,bnc) /var/run/%{name}
144 %attr(620,bnc,bnc) %ghost /var/log/%{name}.log
This page took 0.075465 seconds and 3 git commands to generate.