File switchboard.spec of Package switchboard

#
# spec file for package switchboard (Version 2.0.17)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           switchboard
Version:        2.0.17
Release:        0
%define pkg_name %{name}
#
Group:          Productivity/Networking/Web/Servers
License:        Other uncritical OpenSource License
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  boost-devel gcc-c++ pam-devel pwdutils
Prereq:         pwdutils %insserv_prereq %fillup_prereq
#
Url:            https://confluence.toolserver.org/display/switchboard/Home
Source:         https://confluence.toolserver.org/download/attachments/5931011/switchboard-2.0.17.tar.gz
Source1:        switchboard.init
Source2:        switchboard.permissions
Source3:        switchboard-rpmlintrc
Patch:          switchboard-2.0.16_fix_make_install.patch
Patch1:         switchboard-2.0.17_cxx_fixes.patch
Patch2:         switchboard-2.0.17_configure_check.patch
#
Summary:        A FastCGI proxy
%description
switchboard is a FastCGI proxy that starts setuid FastCGI processes on demand,
in a similar manner to Apache suexec.  switchboard allows mass web hosting
environments to improve security by running FastCGI scripts as the owner
instead of the web server user, without the extra overhead that suexec adds.
Its PHP support allows PHP scripts to run as FastCGI processes transparently,
without the overhead of other solutions like mod_suphp.


Authors:
---------
    River Tarnell

%prep
%setup
%patch
%patch1
%patch2

%build
# no autotools configure
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
./configure \
  --prefix=%{_prefix} \
  --confdir=%{_sysconfdir}/%{pkg_name} \
  --log-exec=/var/log/%{pkg_name}.log \
  --php-bin=/usr/bin/php-cgi5 \
  --uid-min=1000 --gid-min=1000 \
  --user=%{pkg_name} \
  --group=%{pkg_name}
%{__make}

%install
%makeinstall
%{__cp} -a %{buildroot}%{_sysconfdir}/%{pkg_name}//switchboard.conf{.example,}
%{__install} -d -m 0755 %{buildroot}%{_sbindir}
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{pkg_name}
%{__ln_s} -v %{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}
%{__install} -D -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/permissions.d/%{pkg_name}

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

%pre
/usr/sbin/groupadd -r %{pkg_name} &>/dev/null || :
/usr/sbin/useradd -o -g %{pkg_name} -s /bin/false -r -c "Switchboard" -d %{_var}/run/%{pkg_name} %{pkg_name} &>/dev/null || :

%preun
%stop_on_removal %{pkg_name}

#post
#fillup_and_insserv -f %{pkg_name}

%postun
%insserv_cleanup
%restart_on_update %{pkg_name}

%files
%defattr(-,root,root,-)
%{_sysconfdir}/init.d/%{pkg_name}
%{_sbindir}/rc%{pkg_name}
%config(noreplace) %{_sysconfdir}/permissions.d/%{pkg_name}
%dir /etc/switchboard/
%config /etc/switchboard/switchboard.conf.example
%config(noreplace) /etc/switchboard/switchboard.conf
# sync perms with make install patch
%dir %{_prefix}/lib/switchboard/
%attr(0755,root,%{pkg_name})  %{_bindir}/switchboard
%attr(0755,root,%{pkg_name})  %{_bindir}/switchstats
%attr(0755,root,%{pkg_name})  %{_prefix}/lib/switchboard/switchboard-bin
%attr(04710,root,%{pkg_name}) %{_prefix}/lib/switchboard/swexec
%attr(04710,root,%{pkg_name}) %{_prefix}/lib/switchboard/swkill
#
%{_datadir}/switchboard/
%{_mandir}/man1/switchstats.1*
%{_mandir}/man4/switchboard.conf.4*
%{_mandir}/man8/switchboard.8*
%doc README

%changelog
openSUSE Build Service is sponsored by