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