]> git.pld-linux.org Git - packages/bircd.git/blob - bircd.spec
- added bcond for enabling server mode command in bircd
[packages/bircd.git] / bircd.spec
1 #
2 # Conditional build
3 %bcond_with     smode   # build with /smode command support
4 #
5 Summary:        Internet Relay Chat Server
6 Summary(pl):    Serwer IRC (Internet Relay Chat)
7 Name:           bircd
8 Version:        2.0.3rc6
9 Release:        3
10 License:        GPL
11 Group:          Daemons
12 Source0:        http://www.onthanet.nl/~borg/download/%{name}%{version}.tgz
13 # Source0-md5:  2b59be1677db237521ae0c628511866c
14 Source1:        %{name}.init
15 Source2:        %{name}.sysconfig
16 Source3:        %{name}.logrotate
17 Patch0:         %{name}-makefile.patch
18 Patch1:         %{name}-config.patch
19 Patch2:         %{name}-fix.patch
20 Patch3:         %{name}-smode.patch
21 URL:            http://www.onthanet.nl/~borg/
22 BuildRequires:  rpmbuild(macros) >= 1.159
23 PreReq:         rc-scripts
24 Requires(pre):  /usr/bin/getgid
25 Requires(pre):  /bin/id
26 Requires(pre):  /usr/sbin/groupadd
27 Requires(pre):  /usr/sbin/useradd
28 Requires(post): fileutils
29 Requires(post,preun):   /sbin/chkconfig
30 Requires(postun):       /usr/sbin/groupdel
31 Requires(postun):       /usr/sbin/userdel
32 Provides:       group(ircd)
33 Provides:       user(ircd)
34 Obsoletes:      ircd
35 Obsoletes:      ircd6
36 Obsoletes:      ircd-hybrid
37 Obsoletes:      ircd-ptlink
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %define         _sysconfdir     /etc/ircd
41 %define         _localstatedir  /var/lib/ircd
42
43 %description
44 bIRCd is a small, simple and very fast IRC server. It is easy to
45 configure and use. It also has support for IPv6.
46
47 %description -l pl
48 bIRCd jest ma³ym, prostym i bardzo szybkim serwerem IRC. Jest bardzo
49 prosty w konfiguracji i u¿ytkowaniu. Posiada równie¿ wsparcie dla
50 IPv6.
51
52 %prep
53 %setup -q -n bircd
54 %patch0 -p1
55 %patch1 -p1
56 %patch2 -p1
57 %{?with_smode:%patch3 -p1}
58
59 %build
60 ./Config
61 %{__make} \
62         LIBDIR=%{_libdir}
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{%{_var}/log/{,archiv/}ircd,%{_sbindir}} \
67         $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,logrotate.d}} \
68         $RPM_BUILD_ROOT%{_localstatedir}
69
70 %{__make} install \
71         DESTDIR=$RPM_BUILD_ROOT
72
73 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ircd
74 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ircd
75 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/ircd
76
77 cat << EOF > $RPM_BUILD_ROOT%{_sysconfdir}/ircd.motd
78
79 Powered by \ 2PLD\ 2 \ 2L\ 2inux \ 2D\ 2istribution \ 2IRC Server\ 2!
80
81 WWW\ 2:\ 2        \ 2http://www.pld-linux.org/\ 2
82 FTP\ 2:\ 2        \ 2ftp://ftp.pld-linux.org/\ 2
83 e-mail\ 2:\ 2      \ 2feedback@pld-linux.org\ 2
84
85 EOF
86
87 touch $RPM_BUILD_ROOT%{_localstatedir}/ircd.pid
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %pre
93 if [ -n "`getgid ircd`" ]; then
94         if [ "`getgid ircd`" != "75" ]; then
95                 echo "Error: group ircd doesn't have gid=75. Correct this before installing ircd." 1>&2
96                 exit 1
97         fi
98 else
99         /usr/sbin/groupadd -f -g 75 ircd 2> /dev/null
100 fi
101 if [ -n "`id -u ircd 2>/dev/null`" ]; then
102         if [ "`id -u ircd`" != "75" ]; then
103                 echo "Error: user ircd doesn't have uid=75. Correct this before installing ircd." 1>&2
104                 exit 1
105         fi
106 else
107         /usr/sbin/useradd -g ircd -d /etc/ircd -u 75 -s /bin/true -c "IRC Service account" ircd 2> /dev/null
108 fi
109
110 %post
111 /sbin/chkconfig --add ircd
112 if [ -f /var/lock/subsys/ircd ]; then
113         /etc/rc.d/init.d/ircd restart 1>&2
114 else
115         echo "Run \"/etc/rc.d/init.d/ircd start\" to start IRC daemon."
116 fi
117 touch /var/log/ircd/{opers.log,rejects.log,users.log}
118 chmod 640 /var/log/ircd/*
119 chown ircd:ircd /var/log/ircd/*
120
121 %preun
122 # If package is being erased for the last time.
123 if [ "$1" = "0" ]; then
124         if [ -f /var/lock/subsys/ircd ]; then
125                 /etc/rc.d/init.d/ircd stop 1>&2
126         fi
127         /sbin/chkconfig --del ircd
128 fi
129
130 %postun
131 if [ "$1" = "0" ]; then
132         %userremove ircd
133         %groupremove ircd
134 fi
135
136 %files
137 %defattr(644,root,root,755)
138 %doc README CHANGES
139 %doc doc/{Advertisement,Authors,Etiquette,Manual,Operators,README.patches}
140 %doc doc/{conf.doc,example.conf,tao.of.irc,whatsnew}
141 %attr(755,root,root) %{_sbindir}/*
142 %attr(770,root,ircd) %dir %{_var}/log/ircd
143 %attr(770,root,ircd) %dir %{_var}/log/archiv/ircd
144 %attr(770,root,ircd) %dir %{_localstatedir}
145 %attr(640,ircd,ircd) %ghost %{_localstatedir}/ircd.pid
146 %attr(750,root,ircd) %dir %{_sysconfdir}
147 %attr(660,root,ircd) %config(noreplace) %{_sysconfdir}/ircd.conf
148 %attr(664,root,ircd) %{_sysconfdir}/ircd.motd
149 %attr(754,root,root) /etc/rc.d/init.d/ircd
150 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/ircd
151 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/ircd
This page took 0.062055 seconds and 4 git commands to generate.