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