]> git.pld-linux.org Git - packages/bnc.git/blob - bnc.spec
4a0931a17dbc6dc063b55486512562402b9eb689
[packages/bnc.git] / bnc.spec
1 # TODO
2 #  - bncsetup working partially, needs newer dialog
3 Summary:        Simple IRC bouncer
4 Summary(pl):    Proste narzêdzie do tunelowania IRC
5 Name:           bnc
6 Version:        2.9.3
7 Release:        0.11
8 License:        GPL
9 Group:          Networking/Utilities
10 Source0:        http://www.gotbnc.com/files/%{name}%{version}.tar.gz
11 # Source0-md5:  5012f3eb112f0fda545b1aaf66a06150
12 Source1:        %{name}.sysconfig
13 Source2:        %{name}.init
14 Source3:        %{name}.conf
15 Patch0:         %{name}-setup.patch
16 Patch1:         %{name}-typo.patch
17 URL:            http://www.gotbnc.com/
18 BuildRequires:  autoconf
19 BuildRequires:  automake
20 BuildRequires:  openssl-devel
21 BuildRequires:  rpmbuild(macros) >= 1.177
22 Provides:       group(bnc)
23 Provides:       user(bnc)
24 Requires:       dialog >= 1:0.69
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         _sysconfdir     /etc/%{name}
28
29 %define         userid          142
30 %define         groupid         142
31
32 %description
33 BNC is a great IRC (Internet Relay Chat) proxying server under the GPL
34 (General Public License). It allows users to connect to chat servers
35 by bouncing off the computer which is running BNC. Basically, it
36 forwards the information from the user to the server and vise versa.
37
38 %description -l pl
39 BNC jest rewelacyjnym i prostym proxy do IRC (Internet Relay Chat) na
40 licencji GPL (General Public License). BNC pozwala u¿ytkownikom na
41 po³±czenie siê z serwerem IRC wykorzystuj±c do tego komputer na którym
42 BNC zosta³o uruchomione. Mówi±c w skrócie, BNC przekazuje informacje
43 od u¿ytkownika do serwera i vice versa.
44
45 %package init
46 Summary:        Simple IRC bouncer daemon
47 Summary(pl):    Prosty demon do tunelowania IRC
48 Group:          Networking/Utilities
49 Requires:       %{name} = %{epoch}:%{version}-%{release}
50 Requires:       /sbin/start-stop-daemon
51 Requires(post): grep
52 Requires(pre):  /bin/id
53 Requires(pre):  /usr/bin/getgid
54 Requires(pre):  /usr/sbin/groupadd
55 Requires(pre):  /usr/sbin/useradd
56 Requires(postun):       /usr/sbin/groupdel
57 Requires(postun):       /usr/sbin/userdel
58 Requires(post,preun):   /sbin/chkconfig
59
60 %description init
61 This package contains the initscript to start bnc as system service.
62
63 %description init -l pl
64 Ten pakiet zawiera skrypt init do uruchamiania bnc jako us³ugi
65 systemowej.
66
67 %prep
68 %setup -q -n %{name}%{version}
69 %patch0 -p1
70 %patch1 -p1
71
72 %build
73 cp -f /usr/share/automake/config.sub .
74 %{__autoconf}
75 %configure \
76         --with-ssl
77
78 %{__make} \
79         CFLAGS="%{rpmcflags}" \
80         OFLAGS="%{rpmcflags}"
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_bindir},%{_sysconfdir},/var/{log,run/%{name}}}
85
86 install bnc $RPM_BUILD_ROOT%{_bindir}
87 install bncsetup $RPM_BUILD_ROOT%{_bindir}/bncsetup
88 install mkpasswd $RPM_BUILD_ROOT%{_bindir}/bncmkpasswd
89 install motd $RPM_BUILD_ROOT%{_sysconfdir}/motd
90 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
91 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
92 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
93 > $RPM_BUILD_ROOT/var/log/%{name}.log
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %pre init
99 if [ -n "`/usr/bin/getgid %{name}`" ]; then
100         if [ "`/usr/bin/getgid %{name}`" != %{groupid} ]; then
101                 echo "Error: group %{name} doesn't have gid=%{groupid}. Correct this before installing %{name}." 1>&2
102                 exit 1
103         fi
104 else
105         /usr/sbin/groupadd -g %{groupid} %{name}
106 fi
107 if [ -n "`/bin/id -u %{name} 2>/dev/null`" ]; then
108         if [ "`/bin/id -u %{name}`" != %{userid} ]; then
109                 echo "Error: user %{name} doesn't have uid=%{userid}. Correct this before installing %{name}." 1>&2
110                 exit 1
111         fi
112 else
113         /usr/sbin/useradd -u %{userid} -d /var/run/%{name} -s /bin/false \
114                 -c "%{name} User" -g %{name} %{name} 1>&2
115 fi
116
117 %post init
118 if ! egrep -q '^(adminpass|password)' /etc/bnc/bnc.conf; then
119 %banner %{name} -e <<EOF
120 You need to setup passwords in /etc/bnc/bnc.conf!
121 The daemon will not start unless you've set them!
122
123 EOF
124 # ' vim
125
126 fi
127
128 /sbin/chkconfig --add %{name}
129
130 if [ -f /var/lock/subsys/%{name} ]; then
131         /etc/rc.d/init.d/%{name} restart 1>&2
132 else
133         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
134 fi
135
136 %preun init
137 if [ "$1" = "0" ]; then
138         if [ -f /var/lock/subsys/%{name} ]; then
139                 /etc/rc.d/init.d/%{name} stop 1>&2
140         fi
141         /sbin/chkconfig --del %{name}
142 fi
143
144 %postun init
145 if [ "$1" = "0" ]; then
146         %userremove bnc
147         %groupremove bnc
148 fi
149
150 %files
151 %defattr(644,root,root,755)
152 %doc README Changelog motd example.conf bncchk
153 %attr(755,root,root) %{_bindir}/*
154
155 %files init
156 %defattr(644,root,root,755)
157 %dir %attr(750,root,bnc) %{_sysconfdir}
158 %config(noreplace) %verify(not size mtime md5) %attr(640,root,bnc) %{_sysconfdir}/*
159 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/%{name}
160 %attr(754,root,root) /etc/rc.d/init.d/%{name}
161 %dir %attr(770,root,bnc) /var/run/%{name}
162 %attr(620,bnc,bnc) %ghost /var/log/%{name}.log
This page took 0.082298 seconds and 3 git commands to generate.