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