fcgiwrap-vl.spec 4.6 KB

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