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