File distcc.spec of Package distcc

Name:       distcc
Version:    3.1
Release:    0
Summary:    Distributed C/C++ compilation
Group:      Development/Tools/Building
License:    GPLv2+
URL:        http://distcc.samba.org/
Source0:    http://distcc.samba.org/ftp/distcc/distcc-%{version}.tar.bz2
Source1:    hosts.sample
Source2:    distccd.init
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: popt-devel
BuildRequires: libgnomeui-devel
BuildRequires: pango-devel
BuildRequires: python-devel
BuildRequires: desktop-file-utils


%description
distcc is a program to distribute compilation of C or C++ code across
several machines on a network. distcc should always generate the same
results as a local compile, is simple to install and use, and is often
two or more times faster than a local compile.


%package     server
Summary:    Server for distributed C/C++ compilation
Group:      Development/Tools/Building
License:    GPLv2+

Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig


%description server
This package contains the compilation server needed to use %{name}.


%prep
%setup -q


%build
configure \
    --prefix=%{_prefix} \
    --bindir=%{_bindir} \
    --libdir=%{_libdir} \
    --mandir=%{_mandir} \
    --datadir=%{_datadir} \
    --sysconfdir=%{_sysconfdir} \
    --with-gnome \
    --with-docdir=%{_datadir}/doc/%{name}-%{version} \
    --enable-rfc2553 --with-included-popt

make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" PYTHON_INSTALL_RECORD=python_install_record


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT PYTHON_INSTALL_RECORD=python_install_record

# ensure that the module directory is added to %files
export PYTHON_SITEDIR=$(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
echo $PYTHON_SITEDIR/include_server >> python_install_record

# Install sample hosts file
install -Dm 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/hosts

# Install sample distccd config file
#install -Dm 0644 contrib/redhat/sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/distccd

# Install distccd init file
install -Dm 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/distccd


%post
update-desktop-database &> /dev/null ||:


%post server
[ $1 -lt 2 ] && /sbin/chkconfig --add distccd ||:


%preun server
[ $1 -eq 0 ] && /sbin/chkconfig --del distccd ||:


%postun
update-desktop-database &> /dev/null ||:


%clean
rm -rf $RPM_BUILD_ROOT


%files -f python_install_record
%defattr(-,root,root,-)
%doc %{_datadir}/doc/%{name}-%{version}
%{_bindir}/distcc
%{_bindir}/lsdistcc
%{_bindir}/pump
%{_bindir}/distccmon*
%{_mandir}/man1/distcc.*
%{_mandir}/man1/distccmon*
%{_mandir}/man1/include_server*
%{_mandir}/man1/pump*
%{_datadir}/%{name}
#%{_datadir}/applications/*.desktop
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/hosts
%config(noreplace) %{_sysconfdir}/default/distcc

%files server
%defattr(-,root,root,-)
%doc COPYING README
%{_bindir}/distccd
%{_sysconfdir}/init.d/*
%{_mandir}/man1/distccd*
#%config(noreplace) %{_sysconfdir}/sysconfig/distccd
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/clients.allow
%config(noreplace) %{_sysconfdir}/%{name}/commands.allow.sh

%changelog

openSUSE Build Service is sponsored by