3 %bcond_with smode # build with /smode command support
4 %bcond_with crypt # build with crypted passwords support
6 Summary: Internet Relay Chat Server
7 Summary(pl): Serwer IRC (Internet Relay Chat)
13 #Source0: http://www.onthanet.nl/~borg/download/%{name}%{version}.tgz
14 Source0: http://ircd.limanowa.net/bircd/%{name}%{version}.tgz
15 # Source0-md5: d02de85d98073b547bd8eae61951dca3
17 Source2: %{name}.sysconfig
18 Source3: %{name}.logrotate
19 Patch0: %{name}-makefile.patch
20 Patch1: %{name}-config.patch
21 Patch2: %{name}-smode.patch
22 Patch3: %{name}-crypt.patch
23 URL: http://www.onthanet.nl/~borg/
24 BuildRequires: rpmbuild(macros) >= 1.159
26 Requires(pre): /usr/bin/getgid
27 Requires(pre): /bin/id
28 Requires(pre): /usr/sbin/groupadd
29 Requires(pre): /usr/sbin/useradd
30 Requires(post): fileutils
31 Requires(post,preun): /sbin/chkconfig
32 Requires(postun): /usr/sbin/groupdel
33 Requires(postun): /usr/sbin/userdel
38 Obsoletes: ircd-hybrid
39 Obsoletes: ircd-ptlink
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 %define _sysconfdir /etc/ircd
43 %define _localstatedir /var/lib/ircd
46 bIRCd is a small, simple and very fast IRC server. It is easy to
47 configure and use. It also has support for IPv6.
50 bIRCd jest ma³ym, prostym i bardzo szybkim serwerem IRC. Jest bardzo
51 prosty w konfiguracji i u¿ytkowaniu. Posiada równie¿ wsparcie dla
58 %{?with_smode:%patch2 -p1}
59 %{?with_crypt:%patch3 -p1}
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT{%{_var}/log/{,archiv/}ircd,%{_sbindir}} \
69 $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,logrotate.d}} \
70 $RPM_BUILD_ROOT%{_localstatedir}
73 DESTDIR=$RPM_BUILD_ROOT
75 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ircd
76 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ircd
77 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/ircd
79 cat << EOF > $RPM_BUILD_ROOT%{_sysconfdir}/ircd.motd
81 Powered by
\ 2PLD
\ 2 \ 2L
\ 2inux
\ 2D
\ 2istribution
\ 2IRC Server
\ 2!
83 WWW
\ 2:
\ 2 \ 2http://www.pld-linux.org/
\ 2
84 FTP
\ 2:
\ 2 \ 2ftp://ftp.pld-linux.org/
\ 2
85 e-mail
\ 2:
\ 2 \ 2feedback@pld-linux.org
\ 2
89 touch $RPM_BUILD_ROOT%{_localstatedir}/ircd.pid
92 rm -rf $RPM_BUILD_ROOT
95 if [ -n "`getgid ircd`" ]; then
96 if [ "`getgid ircd`" != "75" ]; then
97 echo "Error: group ircd doesn't have gid=75. Correct this before installing ircd." 1>&2
101 /usr/sbin/groupadd -f -g 75 ircd 2> /dev/null
103 if [ -n "`id -u ircd 2>/dev/null`" ]; then
104 if [ "`id -u ircd`" != "75" ]; then
105 echo "Error: user ircd doesn't have uid=75. Correct this before installing ircd." 1>&2
109 /usr/sbin/useradd -g ircd -d /etc/ircd -u 75 -s /bin/true -c "IRC Service account" ircd 2> /dev/null
113 /sbin/chkconfig --add ircd
114 if [ -f /var/lock/subsys/ircd ]; then
115 /etc/rc.d/init.d/ircd restart 1>&2
117 echo "Run \"/etc/rc.d/init.d/ircd start\" to start IRC daemon."
119 touch /var/log/ircd/{opers.log,rejects.log,users.log}
120 chmod 640 /var/log/ircd/*
121 chown ircd:ircd /var/log/ircd/*
124 # If package is being erased for the last time.
125 if [ "$1" = "0" ]; then
126 if [ -f /var/lock/subsys/ircd ]; then
127 /etc/rc.d/init.d/ircd stop 1>&2
129 /sbin/chkconfig --del ircd
133 if [ "$1" = "0" ]; then
139 %defattr(644,root,root,755)
141 %doc doc/{Advertisement,Authors,Etiquette,Manual,Operators,README.patches}
142 %doc doc/{conf.doc,example.conf,tao.of.irc,whatsnew}
143 %attr(755,root,root) %{_sbindir}/*
144 %attr(770,root,ircd) %dir %{_var}/log/ircd
145 %attr(770,root,ircd) %dir %{_var}/log/archiv/ircd
146 %attr(770,root,ircd) %dir %{_localstatedir}
147 %attr(640,ircd,ircd) %ghost %{_localstatedir}/ircd.pid
148 %attr(750,root,ircd) %dir %{_sysconfdir}
149 %attr(660,root,ircd) %config(noreplace) %{_sysconfdir}/ircd.conf
150 %attr(664,root,ircd) %{_sysconfdir}/ircd.motd
151 %attr(754,root,root) /etc/rc.d/init.d/ircd
152 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/ircd
153 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/ircd