2b6f8c2
%global commit 99c942c90063c73734e56bacaa65f947772d9186
2b6f8c2
%global shortcommit %(c=%{commit}; echo ${c:0:7})
2b6f8c2
%global date 20181108
2b6f8c2
2b6f8c2
Name:           fcgiwrap
2b6f8c2
Version:        1.1.0
c4f68da
Release:        18.%{date}git%{shortcommit}%{?dist}
2b6f8c2
Summary:        Simple FastCGI wrapper for CGI scripts
2b6f8c2
License:        MIT
2b6f8c2
URL:            https://github.com/gnosek/fcgiwrap
2b6f8c2
Source0:        https://github.com/gnosek/fcgiwrap/archive/%{commit}/%{name}-%{commit}.tar.gz
2b6f8c2
Source1:        %{name}@.service
2b6f8c2
Source2:        %{name}@.socket
2b6f8c2
Source3:        %{name}
2b6f8c2
Source4:        SETUP
3d1f974
Source5:        README.SELinux
2b6f8c2
2b6f8c2
# https://github.com/gnosek/fcgiwrap/pull/39
2b6f8c2
Patch0:         %{name}-1.1.0-use_pkg-config_libsystemd.patch
2b6f8c2
# https://github.com/gnosek/fcgiwrap/pull/43
2b6f8c2
Patch1:         %{name}-1.1.0-declare_cgi_error_noreturn.patch
2b6f8c2
# https://github.com/gnosek/fcgiwrap/pull/44
2b6f8c2
Patch2:         %{name}-1.1.0-fix_kill_param_sequence.patch
2b6f8c2
2b6f8c2
BuildRequires:  coreutils
2b6f8c2
BuildRequires:  gcc
2b6f8c2
BuildRequires:  autoconf
2b6f8c2
BuildRequires:  automake
2b6f8c2
BuildRequires:  fcgi-devel
2b6f8c2
BuildRequires:  systemd-devel
025f82f
BuildRequires: make
2b6f8c2
%{?systemd_requires}
2b6f8c2
2b6f8c2
%description
2b6f8c2
This package provides a simple FastCGI wrapper for CGI scripts with/
2b6f8c2
following features:
2b6f8c2
 - very lightweight (84KB of private memory per instance)
2b6f8c2
 - fixes broken CR/LF in headers
2b6f8c2
 - handles environment in a sane way (CGI scripts get HTTP-related environment
2b6f8c2
   vars from FastCGI parameters and inherit all the others from
2b6f8c2
   environment of fcgiwrap )
2b6f8c2
 - no configuration, so you can run several sites off the same
2b6f8c2
   fcgiwrap pool
2b6f8c2
 - passes CGI std error output to std error stream of cgiwrap or FastCGI
2b6f8c2
 - support systemd socket activation, launcher program like spawn-fcgi
2b6f8c2
   is no longer required on systemd-enabled distributions
2b6f8c2
2b6f8c2
%prep
2b6f8c2
%autosetup -n %{name}-%{commit}
2b6f8c2
install -pm 0644 %{SOURCE4} .
3d1f974
install -pm 0644 %{SOURCE5} .
2b6f8c2
2b6f8c2
%build
2b6f8c2
autoreconf -i
2b6f8c2
%configure --prefix="" --with-systemd
2b6f8c2
%make_build
2b6f8c2
2b6f8c2
%install
2b6f8c2
%make_install
2b6f8c2
2b6f8c2
# Remove the default systemd files 
2b6f8c2
rm -f %{buildroot}%{_unitdir}/fcgiwrap.service
2b6f8c2
rm -f %{buildroot}%{_unitdir}/fcgiwrap.socket
2b6f8c2
2b6f8c2
# Install our own systemd config files
2b6f8c2
install -Dm 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}@.service
2b6f8c2
install -Dm 644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}@.socket
2b6f8c2
install -Dm 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
2b6f8c2
2b6f8c2
%post
c6a219d
%systemd_post %{name}@.service %{name}@.socket
2b6f8c2
2b6f8c2
%preun
c6a219d
%systemd_preun %{name}@.service %{name}@.socket
2b6f8c2
2b6f8c2
%postun
c6a219d
%systemd_postun_with_restart %{name}@.service %{name}@.socket
2b6f8c2
2b6f8c2
%files
3d1f974
%doc README.rst README.SELinux SETUP
2b6f8c2
%license COPYING
2b6f8c2
%{_sbindir}/%{name}
2b6f8c2
%{_mandir}/man8/%{name}.8*
2b6f8c2
%{_unitdir}/%{name}@.service
2b6f8c2
%{_unitdir}/%{name}@.socket
2b6f8c2
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
2b6f8c2
2b6f8c2
%changelog
c4f68da
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-18.20181108git99c942c
c4f68da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
c4f68da
a9d36ec
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-17.20181108git99c942c
a9d36ec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
a9d36ec
1b98c6c
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.0-16.20181108git99c942c
1b98c6c
- Rebuilt for updated systemd-rpm-macros
1b98c6c
  See https://pagure.io/fesco/issue/2583.
1b98c6c
1bfc7e9
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-15.20181108git99c942c
1bfc7e9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
1bfc7e9
59cfd73
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-14.20181108git99c942c
59cfd73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
59cfd73
a1b1912
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-13.20181108git99c942c
a1b1912
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a1b1912
fd880bb
* Sun Oct 06 2019 Andrew Bauer <zonexpertconsulting@outlook.com> - 1.1.0-12.20181108git99c942c
fd880bb
- Update SETUP instructions. Fixes RHBZ 1740030. 
fd880bb
5936f7c
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-11.20181108git99c942c
5936f7c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
5936f7c
52bd9a7
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-10.20181108git99c942c
52bd9a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
52bd9a7
85e13a2
* Fri Dec 14 2018 Andrew Bauer <zonexpertconsulting@outlook.com> - 1.1.0-9.20181108git99c942c
85e13a2
- fix typo in fcgiwrap socket file 
85e13a2
3d1f974
* Tue Dec 04 2018 Andrew Bauer <zonexpertconsulting@outlook.com> - 1.1.0-8.20181108git99c942c
3d1f974
- Modify socket file based on feedback in BZ 1655281
3d1f974
- Add README.SELinux
3d1f974
2b6f8c2
* Thu Nov 08 2018 Andrew Bauer <zonexpertconsulting@outlook.com> - 1.1.0-7.20181108git99c942c
2b6f8c2
- Feedback from fedora package review
2b6f8c2
- Remove Group from unit file
2b6f8c2
- Set date to snapshot date, not commit date
2b6f8c2
2b6f8c2
* Sat Nov 03 2018 Andrew Bauer <zonexpertconsulting@outlook.com> - 1.1.0-6.20150530git99c942c
2b6f8c2
- Supply our own systemd service, socket, and environment files
2b6f8c2
- Add Patch2 to fix kill parameter sequence
2b6f8c2
2b6f8c2
* Wed Aug 30 2017 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.1.0-5.20150530git99c942c
2b6f8c2
- Add license
2b6f8c2
- Use systemd_requires macro
2b6f8c2
- Update URL
2b6f8c2
- Add Patch1 to fix compilation with gcc 7
2b6f8c2
2b6f8c2
* Wed Nov 09 2016 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.1.0-4.20150530git99c942c
2b6f8c2
- Patch0 to rename pkg-config libsystemd-daemon to libsystemd
2b6f8c2
2b6f8c2
* Thu Feb 04 2016 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.1.0-3.20150530git99c942c
2b6f8c2
- Use %%make_build macro
2b6f8c2
2b6f8c2
* Sat May 30 2015 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.1.0-2.20150530git99c942c
2b6f8c2
- Update to commit 99c942c
2b6f8c2
2b6f8c2
* Fri Feb 08 2013 Hiroaki Nakamura <hnakamur@gmail.com> - 1.1.0-1
2b6f8c2
- new upstream release.
2b6f8c2
2b6f8c2
* Fri Jan 11 2013 Hiroaki Nakamura <hnakamur@gmail.com> - 1.0.3.20120908-1
2b6f8c2
- Change version to increase monotonously.
2b6f8c2
2b6f8c2
* Wed Jan  9 2013 Hiroaki Nakamura <hnakamur@gmail.com> - 1.0.3-3.gitb9f03e6377
2b6f8c2
- Make the rpm relocatable.
2b6f8c2
2b6f8c2
* Tue Dec 25 2012 Hiroaki Nakamura <hnakamur@gmail.com> - 1.0.3-2.gitb9f03e6377
2b6f8c2
2b6f8c2
* Tue Jan 31 2012 Craig Barnes <cr@igbarn.es> - 1.0.3-1.git1328862
2b6f8c2
- Initial package