1 | %bcond_with systemd |
---|
2 | |
---|
3 | %global orig_version 1.1.0 |
---|
4 | %global git_date 20200404 |
---|
5 | |
---|
6 | Summary: A simple FastCGI server for CGI applications. |
---|
7 | Summary(ja): CGIアプリケーションを動作させるためのシンプルなFastCGIサーバ |
---|
8 | Name: fcgiwrap |
---|
9 | Version: %{orig_version}.git%{git_date} |
---|
10 | Release: 2%{?_dist_release}%{?with_systemd:.systemd} |
---|
11 | Group: System Environment/Daemons |
---|
12 | Vendor: Project Vine |
---|
13 | Distribution: Vine Linux |
---|
14 | License: GPL+ |
---|
15 | URL: https://github.com/gnosek/fcgiwrap |
---|
16 | Source0: %{name}-%{orig_version}.tar.gz |
---|
17 | Source1: fcgiwrap_params |
---|
18 | Source2: fcgiwrap.init |
---|
19 | Source3: fcgiwrap.sysconfig |
---|
20 | Source4: %{name}@.service |
---|
21 | Source5: %{name}@.socket |
---|
22 | Source6: fcgiwrap.sysconfig.systemd |
---|
23 | Patch0: fcgiwrap-HEAD.patch |
---|
24 | # https://github.com/gnosek/fcgiwrap/pull/39 |
---|
25 | Patch1: %{name}-1.1.0-use_pkg-config_libsystemd.patch |
---|
26 | # https://github.com/gnosek/fcgiwrap/pull/43 |
---|
27 | Patch2: %{name}-1.1.0-declare_cgi_error_noreturn.patch |
---|
28 | # https://github.com/gnosek/fcgiwrap/pull/44 |
---|
29 | Patch3: %{name}-1.1.0-fix_kill_param_sequence.patch |
---|
30 | |
---|
31 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
32 | BuildRequires: fcgi-devel |
---|
33 | %if %{with systemd} |
---|
34 | BuildRequires: systemd-devel |
---|
35 | %{?systemd_requires} |
---|
36 | %else |
---|
37 | Requires: spawn-fcgi |
---|
38 | Requires(post): /sbin/chkconfig |
---|
39 | Requires(preun): /sbin/chkconfig |
---|
40 | Requires(preun): /sbin/service |
---|
41 | %endif |
---|
42 | |
---|
43 | %description |
---|
44 | fcgiwrap is a simple server for running CGI applications over FastCGI. |
---|
45 | It hopes to provide clean CGI support to Nginx (and other web servers |
---|
46 | that may need it). |
---|
47 | |
---|
48 | %description -l ja |
---|
49 | fcgiwrapは、Nginx等のCGIをサポートしていないWebサーバ上でCGIアプリケー |
---|
50 | ションを動作させるための、シンプルなFastCGIサーバです。 |
---|
51 | |
---|
52 | %package nginx |
---|
53 | Summary: A Nginx configuration file to use fcgiwrap |
---|
54 | Group: System Environment/Daemons |
---|
55 | Requires: %{name} = %{version}-%{release} |
---|
56 | Requires: nginx |
---|
57 | |
---|
58 | %description nginx |
---|
59 | This package contains a Nginx configuration file to use fcgiwrap. |
---|
60 | |
---|
61 | |
---|
62 | %prep |
---|
63 | %setup -q -n fcgiwrap-%{orig_version} |
---|
64 | %patch0 -p1 |
---|
65 | %if %{with systemd} |
---|
66 | %patch1 -p1 |
---|
67 | %endif |
---|
68 | %patch2 -p1 |
---|
69 | %patch3 -p1 |
---|
70 | |
---|
71 | autoreconf -i |
---|
72 | |
---|
73 | %build |
---|
74 | %if %{with systemd} |
---|
75 | %configure --prefix="" --with-systemd |
---|
76 | %else |
---|
77 | %configure |
---|
78 | %endif |
---|
79 | |
---|
80 | make |
---|
81 | |
---|
82 | %install |
---|
83 | rm -rf %{buildroot} |
---|
84 | make DESTDIR=%{buildroot} install |
---|
85 | |
---|
86 | if [ -d %{buildroot}%{_prefix}%{_prefix} ]; then |
---|
87 | mv %{buildroot}%{_prefix}%{_prefix}/* %{buildroot}%{_prefix}/ |
---|
88 | fi |
---|
89 | mkdir -p %{buildroot}%{_sysconfdir}/{nginx,sysconfig} |
---|
90 | mkdir -p %{buildroot}%{_initdir}/ |
---|
91 | install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/nginx/ |
---|
92 | |
---|
93 | %if %{with systemd} |
---|
94 | # Remove the default systemd files |
---|
95 | rm -f %{buildroot}%{_unitdir}/fcgiwrap.service |
---|
96 | rm -f %{buildroot}%{_unitdir}/fcgiwrap.socket |
---|
97 | |
---|
98 | # Install our own systemd config files |
---|
99 | install -Dm 644 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}@.service |
---|
100 | install -Dm 644 %{SOURCE5} %{buildroot}%{_unitdir}/%{name}@.socket |
---|
101 | install -m644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/fcgiwrap |
---|
102 | %else |
---|
103 | install -m755 %{SOURCE2} %{buildroot}%{_initdir}/fcgiwrap |
---|
104 | install -m644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/fcgiwrap |
---|
105 | %endif |
---|
106 | |
---|
107 | %clean |
---|
108 | rm -rf %{buildroot} |
---|
109 | |
---|
110 | %post |
---|
111 | %if %{with systemd} |
---|
112 | %systemd_post %{name}@.service |
---|
113 | %systemd_post %{name}@.socket |
---|
114 | %else |
---|
115 | /sbin/chkconfig --add fcgiwrap |
---|
116 | %endif |
---|
117 | |
---|
118 | %preun |
---|
119 | %if %{with systemd} |
---|
120 | %systemd_preun %{name}@.service |
---|
121 | %systemd_preun %{name}@.socket |
---|
122 | %else |
---|
123 | if [ $1 -eq 0 ]; then |
---|
124 | /sbin/service fcgiwrap stop > /dev/null 2>&1 |
---|
125 | /sbin/chkconfig --del fcgiwrap |
---|
126 | fi |
---|
127 | %endif |
---|
128 | |
---|
129 | %postun |
---|
130 | %if %{with systemd} |
---|
131 | %systemd_postun_with_restart %{name}@.service |
---|
132 | %systemd_postun_with_restart %{name}@.socket |
---|
133 | %else |
---|
134 | if [ $1 -ge 1 ]; then |
---|
135 | /sbin/service fcgiwrap condrestart 2>&1 >/dev/null |
---|
136 | fi |
---|
137 | %endif |
---|
138 | |
---|
139 | %files |
---|
140 | %defattr(-,root,root) |
---|
141 | %license COPYING |
---|
142 | %doc README.rst |
---|
143 | %{_sbindir}/fcgiwrap |
---|
144 | %{_mandir}/man8/fcgiwrap.8* |
---|
145 | %config(noreplace) %{_sysconfdir}/sysconfig/fcgiwrap |
---|
146 | %if %{with systemd} |
---|
147 | %{_unitdir}/%{name}@.service |
---|
148 | %{_unitdir}/%{name}@.socket |
---|
149 | %else |
---|
150 | %attr(0755,root,root) %{_initdir}/fcgiwrap |
---|
151 | %endif |
---|
152 | |
---|
153 | %files nginx |
---|
154 | %defattr(-,root,root) |
---|
155 | %config(noreplace) %{_sysconfdir}/nginx/fcgiwrap_params |
---|
156 | |
---|
157 | %changelog |
---|
158 | * Sun Apr 05 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.1.0.git20200404-2 |
---|
159 | - fixed %%changelog. |
---|
160 | |
---|
161 | * Sat Apr 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.1.0.git20200404-1 |
---|
162 | - updated to git HEAD. |
---|
163 | - added systemd stuff (disabled as default). |
---|
164 | |
---|
165 | * Sun Jan 12 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.1.0-1 |
---|
166 | - new upstream release. |
---|
167 | |
---|
168 | * Fri Apr 27 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.3-2 |
---|
169 | - fixed configurations. |
---|
170 | |
---|
171 | * Thu May 19 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.3-1 |
---|
172 | - initial built. |
---|
173 | |
---|