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