1 |
%define name ircd-hybrid |
2 |
%define version 7.2.3 |
3 |
%define release %mkrel 9 |
4 |
%define _messagesdir %{_libdir}/ircd-hybrid/messages |
5 |
|
6 |
# default: Don't build with IPv6 for production server |
7 |
%define with_IPv6 0 |
8 |
%{?_without_ipv6: %{expand: %%global with_IPv6 0}} |
9 |
%{?_with_ipv6: %{expand: %%global with_IPv6 1}} |
10 |
# default: Don't build with EFnet support |
11 |
%define with_EFnet 0 |
12 |
%{?_without_efnet: %{expand: %%global with_EFnet 0}} |
13 |
%{?_with_efnet: %{expand: %%global with_EFnet 1}} |
14 |
|
15 |
Name: %{name} |
16 |
Version: %{version} |
17 |
Release: %{release} |
18 |
Summary: Internet Relay Chat Server |
19 |
License: GPL |
20 |
Group: Networking/IRC |
21 |
URL: http://www.ircd-hybrid.org/ |
22 |
Source0: http://prdownloads.sf.net/ircd-hybrid/%{name}-%{version}.tar.bz2 |
23 |
Source1: %{name}.init |
24 |
Source2: %{name}.sysconfig |
25 |
Source3: %{name}.logrotate |
26 |
Patch0: %{name}-config.patch |
27 |
Patch3: %{name}-7.2.3-fix-x86_64-build.patch |
28 |
Patch4: %{name}-7.2.3-fix-module-path.patch |
29 |
Patch5: ircd-hybrid-7.2.3-fix-str-fmt.patch |
30 |
Requires(post,postun): rpm-helper update-alternatives |
31 |
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot |
32 |
BuildRequires: autoconf |
33 |
BuildRequires: automake |
34 |
BuildRequires: openssl-devel >= 0.9.7 |
35 |
BuildRequires: zlib-devel |
36 |
BuildRequires: elfutils-devel |
37 |
# Both have a |
38 |
Conflicts: ircd |
39 |
|
40 |
%package devel |
41 |
Summary: Development headers for %{name} |
42 |
Group: Networking/IRC |
43 |
Requires: %{name} = %{version} |
44 |
|
45 |
%description |
46 |
Ircd-hybrid is an advanced IRC server which is most commonly used on |
47 |
the EFNet IRC network. It is fast, reliable, and powerful. |
48 |
Build time options: |
49 |
IPv6 support: --with ipv6 %{with_IPv6} |
50 |
EFnet support: --with efnet %{with_EFnet} |
51 |
|
52 |
%description devel |
53 |
Development headers and libraries for %{name} |
54 |
|
55 |
%prep |
56 |
%setup -q |
57 |
%patch0 -p1 |
58 |
%patch3 -p0 |
59 |
%patch4 -p0 |
60 |
%patch5 -p0 |
61 |
|
62 |
# Clear all before start |
63 |
#rm -rf `find -type d -name autom4te.cache` |
64 |
#mv -f autoconf/{configure.in,acconfig.h} . |
65 |
|
66 |
%build |
67 |
# change dir for other automake |
68 |
#cp -f %{_datadir}/automake-1.7/config.* autoconf |
69 |
#%{__aclocal} |
70 |
#%{__autoconf} |
71 |
|
72 |
%serverbuild |
73 |
%configure2_5x \ |
74 |
--enable-zlib \ |
75 |
--enable-small-net \ |
76 |
--enable-openssl \ |
77 |
--disable-assert \ |
78 |
--with-nicklen=12 \ |
79 |
--with-maxclients=512 \ |
80 |
%{?_with_ipv6:--enable-ipv6} \ |
81 |
%{?_with_efnet:--enable-efnet} |
82 |
%make |
83 |
|
84 |
%install |
85 |
rm -rf %{buildroot} |
86 |
install -d %{buildroot}{%{_libdir}/ircd-hybrid,%{_var}/{log/ircd-hybrid,run/ircd-hybrid},%{_sysconfdir}/{ircd-hybrid,rc.d/init.d,sysconfig,logrotate.d}} \ |
87 |
%{buildroot}{%{_libdir}/ircd-hybrid/{modules{,/autoload},tools,help},%{_sbindir},%{_mandir}/man8,%{_localstatedir}/lib/ircd-hybrid} \ |
88 |
%{buildroot}{%{_includedir}/%{name},%{_messagesdir},%{_messagesdir}/{ayb{,/LC_MESSAGES},custom{,/LC_MESSAGES}}} |
89 |
|
90 |
install src/ircd %{buildroot}%{_sbindir}/ircd-hybrid |
91 |
install servlink/servlink %{buildroot}%{_sbindir}/servlink |
92 |
install etc/*.conf %{buildroot}%{_sysconfdir}/ircd-hybrid |
93 |
# which conf file we need? |
94 |
%if %{with_EFnet} |
95 |
mv %{buildroot}%{_sysconfdir}/ircd-hybrid/example.efnet.conf %{buildroot}%{_sysconfdir}/ircd-hybrid/ircd.conf |
96 |
rm %{buildroot}%{_sysconfdir}/ircd-hybrid/{simple.conf,example.conf} |
97 |
%else |
98 |
mv %{buildroot}%{_sysconfdir}/ircd-hybrid/simple.conf %{buildroot}%{_sysconfdir}/ircd-hybrid/ircd.conf |
99 |
rm %{buildroot}%{_sysconfdir}/ircd-hybrid/example.efnet.conf |
100 |
%endif |
101 |
#mv %{buildroot}%{_sysconfdir}/ircd-hybrid/convertconf-example.conf %{buildroot}%{_sysconfdir}/ircd-hybrid/.convertconf-example.conf |
102 |
#install doc/ircd.motd %{buildroot}%{_sysconfdir}/ircd-hybrid |
103 |
install doc/ircd.8 %{buildroot}%{_mandir}/man8/ircd-hybrid.8 |
104 |
install include/*.h %{buildroot}%{_includedir}/%{name} |
105 |
install %{SOURCE1} %{buildroot}/etc/rc.d/init.d/ircd-hybrid |
106 |
install %{SOURCE2} %{buildroot}/etc/sysconfig/ircd-hybrid |
107 |
install %{SOURCE3} %{buildroot}/etc/logrotate.d/ircd-hybrid |
108 |
|
109 |
cd modules |
110 |
install *.so %{buildroot}%{_libdir}/ircd-hybrid/modules/autoload |
111 |
cd core |
112 |
install *.so %{buildroot}%{_libdir}/ircd-hybrid/modules |
113 |
cd .. |
114 |
cd .. |
115 |
|
116 |
# make this to have ircservices support |
117 |
cd contrib |
118 |
make ; install *.so %{buildroot}%{_libdir}/ircd-hybrid/modules |
119 |
cd .. |
120 |
|
121 |
cd tools |
122 |
for i in encspeed mkkeypair mkpasswd untabify; do |
123 |
install $i %{buildroot}%{_libdir}/ircd-hybrid/tools/$i |
124 |
done |
125 |
cd .. |
126 |
|
127 |
cd help |
128 |
|
129 |
cp -rf opers users %{buildroot}%{_libdir}/ircd-hybrid/help |
130 |
|
131 |
for link in topic accept cjoin cmode admin names links away whowas \ |
132 |
version kick who invite quit join list nick oper part \ |
133 |
time credits motd userhost users whois ison lusers \ |
134 |
user help pass error challenge knock ping pong; do \ |
135 |
rm -f %{buildroot}%{_libdir}/ircd-hybrid/help/users/$link; \ |
136 |
ln -s %{_libdir}/ircd-hybrid/help/opers/$link %{buildroot}%{_libdir}/ircd-hybrid/help/users; \ |
137 |
done |
138 |
cd .. |
139 |
|
140 |
cd messages |
141 |
install *.lang %{buildroot}%{_messagesdir} |
142 |
cd .. |
143 |
|
144 |
%multiarch_binaries %{buildroot}%_includedir/%{name}/*.h |
145 |
|
146 |
%pre |
147 |
%_pre_useradd ircd-hybrid %{_localstatedir}/lib/ircd-hybrid /bin/false |
148 |
|
149 |
%post |
150 |
%_post_service ircd-hybrid |
151 |
%create_ghostfile /var/log/ircd-hybrid/user.log ircd-hybrid ircd-hybrid 0644 |
152 |
%create_ghostfile /var/log/ircd-hybrid/oper.log ircd-hybrid ircd-hybrid 0644 |
153 |
%create_ghostfile /var/log/ircd-hybrid/foper.log ircd-hybrid ircd-hybrid 0644 |
154 |
update-alternatives --install %{_sbindir}/ircd ircd %{_sbindir}/ircd-hybrid 10 |
155 |
|
156 |
%preun |
157 |
%_preun_service ircd-hybrid |
158 |
|
159 |
# remove hardlinks |
160 |
rm -f %{_libdir}/ircd-hybrid/tools/viklines %{_libdir}/ircd-hybrid/tools/vimotd |
161 |
|
162 |
%postun |
163 |
%_postun_userdel ircd-hybrid |
164 |
|
165 |
update-alternatives --remove ircd %{_sbindir}/ircd-hybrid |
166 |
|
167 |
%clean |
168 |
rm -rf %{buildroot} |
169 |
|
170 |
%files |
171 |
%defattr(644,root,root,755) |
172 |
%doc doc/{*.txt,server-version-info,technical} Hybrid-team LICENSE BUGS RELNOTES TODO |
173 |
%attr(755,root,root) %{_sbindir}/* |
174 |
%attr(755,ircd-hybrid,ircd-hybrid) %dir %{_sysconfdir}/ircd-hybrid |
175 |
#%attr(644,ircd-hybrid,ircd-hybrid) %config(noreplace) %{_sysconfdir}/ircd-hybrid/.convertconf-example.conf |
176 |
%attr(644,ircd-hybrid,ircd-hybrid) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ircd-hybrid/* |
177 |
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/ircd-hybrid |
178 |
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/ircd-hybrid |
179 |
%attr(755,root,root) /etc/rc.d/init.d/ircd-hybrid |
180 |
%dir %{_libdir}/ircd-hybrid |
181 |
%dir %{_libdir}/ircd-hybrid/modules |
182 |
%dir %{_libdir}/ircd-hybrid/tools |
183 |
%dir %{_libdir}/ircd-hybrid/help |
184 |
%dir %{_messagesdir} |
185 |
%{_messagesdir}/* |
186 |
%attr(755,ircd-hybrid,ircd-hybrid) %dir %{_localstatedir}/lib/ircd-hybrid |
187 |
%attr(755,root,root) %{_libdir}/ircd-hybrid/modules/* |
188 |
%attr(755,root,root) %{_libdir}/ircd-hybrid/tools/* |
189 |
%attr(755,root,root) %{_libdir}/ircd-hybrid/help/* |
190 |
%attr(755,ircd-hybrid,ircd-hybrid) %dir %{_var}/log/ircd-hybrid |
191 |
%attr(755,ircd-hybrid,ircd-hybrid) %dir %{_var}/run/ircd-hybrid |
192 |
%{_mandir}/man*/* |
193 |
|
194 |
# devel |
195 |
%files devel |
196 |
%defattr(644,root,root,755) |
197 |
%{_includedir}/%{name} |
198 |
%doc ChangeLog |
199 |
|
200 |
|
201 |
|