]>
Commit | Line | Data |
---|---|---|
99e77ebd AM |
1 | %global commit 99c942c90063c73734e56bacaa65f947772d9186 |
2 | ||
3 | Summary: Simple FastCGI wrapper for CGI scripts | |
4 | Name: fcgiwrap | |
5 | Version: 1.1.0 | |
0dd4359f | 6 | Release: 1 |
99e77ebd AM |
7 | License: MIT |
8 | URL: https://github.com/gnosek/fcgiwrap | |
9 | Source0: https://github.com/gnosek/fcgiwrap/archive/%{commit}/%{name}-%{commit}.tar.gz | |
10 | # Source0-md5: b092e95b676e23407732b4a2fbf800ae | |
11 | Source1: %{name}@.service | |
12 | Source2: %{name}@.socket | |
13 | Source3: %{name}.sysconfig | |
14 | # https://github.com/gnosek/fcgiwrap/pull/39 | |
15 | Patch0: %{name}-1.1.0-use_pkg-config_libsystemd.patch | |
16 | # https://github.com/gnosek/fcgiwrap/pull/43 | |
17 | Patch1: %{name}-1.1.0-declare_cgi_error_noreturn.patch | |
18 | # https://github.com/gnosek/fcgiwrap/pull/44 | |
19 | Patch2: %{name}-1.1.0-fix_kill_param_sequence.patch | |
20 | BuildRequires: autoconf | |
21 | BuildRequires: automake | |
22 | BuildRequires: coreutils | |
23 | BuildRequires: fcgi-devel | |
24 | BuildRequires: gcc | |
25 | BuildRequires: systemd-devel | |
0dd4359f | 26 | Provides: webserver(cgi) |
99e77ebd AM |
27 | |
28 | %description | |
29 | This package provides a simple FastCGI wrapper for CGI scripts with/ | |
30 | following features: | |
31 | - very lightweight (84KB of private memory per instance) | |
32 | - fixes broken CR/LF in headers | |
33 | - handles environment in a sane way (CGI scripts get HTTP-related | |
34 | environment vars from FastCGI parameters and inherit all the others | |
35 | from environment of fcgiwrap ) | |
36 | - no configuration, so you can run several sites off the same fcgiwrap | |
37 | pool | |
38 | - passes CGI std error output to std error stream of cgiwrap or | |
39 | FastCGI | |
40 | - support systemd socket activation, launcher program like spawn-fcgi | |
41 | is no longer required on systemd-enabled distributions | |
42 | ||
43 | %prep | |
44 | %setup -q -n %{name}-%{commit} | |
45 | %patch0 -p1 | |
46 | %patch1 -p1 | |
47 | %patch2 -p1 | |
48 | ||
49 | %build | |
50 | autoreconf -i | |
51 | %configure \ | |
52 | CFLAGS="-I%{_includedir}/fastcgi %{rpmcflags}" \ | |
53 | --prefix="" \ | |
54 | --with-systemd | |
55 | ||
56 | %{__make} | |
57 | ||
58 | %install | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
61 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig | |
62 | ||
63 | %{__make} install \ | |
64 | DESTDIR=$RPM_BUILD_ROOT | |
65 | ||
66 | # Remove the default systemd files | |
67 | rm -f $RPM_BUILD_ROOT%{systemdunitdir}/fcgiwrap.service | |
68 | rm -f $RPM_BUILD_ROOT%{systemdunitdir}/fcgiwrap.socket | |
69 | ||
70 | # Install our own systemd config files | |
71 | install -Dm 644 %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}@.service | |
72 | install -Dm 644 %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}@.socket | |
73 | install -Dm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} | |
74 | ||
75 | %post | |
76 | %systemd_post %{name}@.service %{name}@.socket | |
77 | ||
78 | %preun | |
79 | %systemd_preun %{name}@.service %{name}@.socket | |
80 | ||
81 | %postun | |
82 | %systemd_postun_with_restart %{name}@.service %{name}@.socket | |
83 | ||
84 | %clean | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %files | |
88 | %defattr(644,root,root,755) | |
89 | %doc README.rst COPYING | |
90 | %attr(755,root,root) %{_sbindir}/%{name} | |
91 | %{_mandir}/man8/%{name}.8* | |
92 | %{systemdunitdir}/%{name}@.service | |
93 | %{systemdunitdir}/%{name}@.socket | |
0dd4359f | 94 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |