File ircd-ircu.spec of Package ircd-ircu

# norootforbuild
#
%define conf_dir  %{_sysconfdir}/%{name}
%define conf_path %{conf_dir}/ircd.conf
%define home_dir  %{_var}/lib/%{name}
%define log_dir   %{_var}/log/%{name}
%define pid_dir   %{_var}/run/%{name}
%define log_path  %{log_dir}/ircd.log
#
Name:      ircd-ircu
Version:   2.10.12.10
Release:   0
#
License:   GPL
Group:     Productivity/Networking/IRC
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: flex bison
PreReq:    %insserv_prereq %fillup_prereq
#
URL:       http://www.coder-com.undernet.org/
Source:    http://prdownloads.sourceforge.net/undernet-ircu/ircu%{version}.tar.gz
Source1:   %{name}.init
Patch:     ircd-ircu2.10.12.06_destdir.patch
Patch1:    ircd-ircu2.10.12.08_binary_name.patch
Patch2:    ircd-ircu2.10.12.06_default_paths.patch
#
Summary:   Undernet IRC Server
%description
Version u2.10.12 of the Undernet ircd incorporates many new features over its
predecessor, and we feel that using it will make you very happy indeed.

Authors:
--------
    Undernet Coder Committee <coder-com@undernet.org>

%debug_package
%prep
%setup -n ircu%{version}
%patch
%patch1
%patch2

%build
autoreconf -fi
export CFLAGS="%{optflags} -fno-strict-aliasing"
%if %{suse_version} > 1000
export CFLAGS="$CFLAGS -fstack-protector"
%endif
%configure --bindir=%{_sbindir} \
    --enable-pedantic --enable-warnings \
    --with-maxcon=4096 --with-symlink=no \
    --with-dpath=%{conf_dir} \
    --with-cpath=%{conf_path} \
    --with-lpath=%{log_path} \
    --with-domain="localhost"
%{__make}

%install
%makeinstall prefix=%{buildroot}%{_prefix}
#
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{name}
%{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
#
%{__install} -dD -m 0750 %{buildroot}{%{pid_dir},%{log_dir},%{home_dir}}
%{__mv} %{buildroot}%{conf_dir}/{example,ircd}.conf

%clean
%{__rm} -rf %{buildroot}

%pre
/usr/sbin/groupadd -r %{name} &>/dev/null ||:
/usr/sbin/useradd -o -g %{name} -s /bin/false -r -c "user for %{name}" -d %{home_dir} %{name} &>/dev/null ||:

%post
%fillup_and_insserv %{name}

%preun
%stop_on_removal %{name}

%postun
%restart_on_update %{name}
%{insserv_cleanup}

%files
%defattr(-,root,root)
%{_sbindir}/%{name}
%{_sbindir}/ircu-convert-conf
%{_sbindir}/umkpasswd
%{_mandir}/man8/%{name}.8*
#
%{_sysconfdir}/init.d/%{name}
%{_sbindir}/rc%{name}
#
%dir %attr(0750,%{name},%{name}) %{log_dir}
%dir %attr(0750,%{name},%{name}) %{pid_dir}
%dir %attr(0750,%{name},%{name}) %{home_dir}
# config
%dir %attr(0750,root,%{name}) %{conf_dir}
%attr(0640,root,%{name}) %{conf_path}
# doc
%doc ChangeLog* README RELEASE.NOTES
%doc doc/api/ doc/history/ tools/
%doc doc/readme* doc/Authors doc/example.conf
%doc doc/fda.txt doc/features.txt
%doc doc/*.html doc/rfc* doc/strings.txt

%changelog
openSUSE Build Service is sponsored by