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