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