]> git.pld-linux.org Git - packages/perl-CGI-SpeedyCGI.git/blob - perl-CGI-SpeedyCGI.spec
perl 5.38.0 rebuild
[packages/perl-CGI-SpeedyCGI.git] / perl-CGI-SpeedyCGI.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  apache1 # don't build apache1 module
5 %bcond_without  apache2 # don't build apache2 module
6 #
7 %define apxs1   /usr/sbin/apxs1
8 %define apxs2   /usr/sbin/apxs
9 %define         pdir    CGI
10 %define         pnam    SpeedyCGI
11 Summary:        Speed up perl CGI scripts by running them persistently
12 Summary(pl.UTF-8):      Moduł przyspieszający perlowe skrypty CGI
13 Name:           perl-CGI-SpeedyCGI
14 Version:        2.22
15 Release:        36
16 License:        GPL v2+
17 Group:          Networking/Daemons
18 Source0:        http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
19 # Source0-md5:  2f80df78874e3efa80f180923c4967a1
20 Source1:        apache-mod_speedycgi.conf
21 Patch0:         %{name}-DESTDIR.patch
22 Patch1:         %{name}-APXS.patch
23 Patch2:         %{name}-debian.patch
24 Patch3:         bad-inline.patch
25 Patch4:         CGI-SpeedyCGI-2.22-Fix-building-on-Perl-without-dot-in-INC.patch
26 URL:            http://daemoninc.com/SpeedyCGI/
27 %{?with_apache2:BuildRequires:  apache-devel}
28 %{?with_apache1:BuildRequires:  apache1-devel}
29 BuildRequires:  perl-devel >= 1:5.8.0
30 BuildRequires:  rpm-perlprov >= 3.0.3-16
31 BuildRequires:  rpmbuild(macros) >= 1.268
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %if %{with apache1}
35 %define         apache1confdir  %(%{apxs1} -q SYSCONFDIR 2>/dev/null)/conf.d
36 %define         apache1libdir   %(%{apxs1} -q LIBEXECDIR 2>/dev/null)
37 %define         apache1docdir   /home/services/apache
38 %endif
39 %if %{with apache2}
40 %define         apache2confdir  %(%{apxs2} -q SYSCONFDIR 2>/dev/null)/conf.d
41 %define         apache2libdir   %(%{apxs2} -q LIBEXECDIR 2>/dev/null)
42 %define         apache2docdir   /home/services/httpd
43 %endif
44
45 %description
46 SpeedyCGI is a way to run CGI perl scripts persistently, which usually
47 makes them run much more quickly. After the script is initially run,
48 instead of exiting, SpeedyCGI keeps the perl interpreter running in
49 memory. During subsequent runs, this interpreter is used to handle new
50 requests, instead of starting a new perl interpreter for each
51 execution.
52
53 %description -l pl.UTF-8
54 SpeedyCGI to sposób na ciągłe działanie perlowych skryptów CGI, co
55 zazwyczaj powoduje, że uruchamiają się dużo szybciej. Po początkowym
56 uruchomieniu skryptu, SpeedyCGI trzyma interpreter Perla w pamięci.
57 Przy kolejnych uruchomieniach ten interpreter jest wykorzystywany do
58 obsługi kolejnych zleceń, zamiast uruchamiania nowego interpretera
59 Perla do każdego uruchomienia skryptu.
60
61 %package -n apache-mod_speedycgi
62 Summary:        SpeedyCGI apache module
63 Summary(pl.UTF-8):      Moduł apache SpeedyCGI
64 Group:          Networking/Daemons
65 Requires:       %{name} = %{version}-%{release}
66 Requires:       apache(modules-api) = %apache_modules_api
67
68 %description -n apache-mod_speedycgi
69 SpeedyCGI apache module.
70
71 %description -n apache-mod_speedycgi -l pl.UTF-8
72 Moduł apache SpeedyCGI.
73
74 %package -n apache1-mod_speedycgi
75 Summary:        SpeedyCGI apache module
76 Summary(pl.UTF-8):      Moduł apache SpeedyCGI
77 Group:          Networking/Daemons
78 Requires:       %{name} = %{version}-%{release}
79 Requires:       apache1 >= 1.3.33-2
80
81 %description -n apache1-mod_speedycgi
82 SpeedyCGI apache module.
83
84 %description -n apache1-mod_speedycgi -l pl.UTF-8
85 Moduł apache SpeedyCGI.
86
87 %prep
88 %setup -q -n %{pdir}-%{pnam}-%{version}
89 %patch0 -p1
90 %patch1 -p1
91 %patch2 -p1
92 %patch3 -p1
93 %patch4 -p1
94
95 %build
96 %{__perl} Makefile.PL </dev/null \
97         INSTALLDIRS=vendor
98 %{?with_apache1:cd mod_speedycgi && perl Makefile.PL && cd ..}
99 %{?with_apache2:cd mod_speedycgi2 && perl Makefile.PL && cd ..}
100
101 %{__make} -j1 \
102         CC="%{__cc}" \
103         OPTIMIZE="%{rpmcflags} -fcommon"
104
105 %if %{with apache1}
106 %{__make} -C mod_speedycgi APXS="%{apxs1}" \
107         CC="%{__cc}" \
108         OPTIMIZE="%{rpmcflags} -fcommon"
109 %endif
110 %if %{with apache2}
111 %{__make} -C mod_speedycgi2 APXS="%{apxs2}" \
112         CC="%{__cc}" \
113         OPTIMIZE="%{rpmcflags} -fcommon"
114 %endif
115
116 %{?with_test:%{__make} test}
117
118 %install
119 rm -rf $RPM_BUILD_ROOT
120 install -d $RPM_BUILD_ROOT%{perl_archlib}
121
122 %{__make} install \
123         DESTDIR=$RPM_BUILD_ROOT
124
125 %if %{with apache1}
126 install -d $RPM_BUILD_ROOT{%{apache1libdir},%{apache1docdir}/speedy,%{apache1confdir}}
127 install %{SOURCE1} $RPM_BUILD_ROOT%{apache1confdir}/mod_speedycgi.conf
128 install mod_speedycgi/mod_speedycgi.so $RPM_BUILD_ROOT%{apache1libdir}
129 %endif
130 %if %{with apache2}
131 install -d $RPM_BUILD_ROOT{%{apache2libdir},%{apache2docdir}/speedy,%{apache2confdir}}
132 install %{SOURCE1} $RPM_BUILD_ROOT%{apache2confdir}/90_mod_speedycgi.conf
133 install mod_speedycgi2/mod_speedycgi.so $RPM_BUILD_ROOT%{apache2libdir}
134 %endif
135
136 ln -s speedy $RPM_BUILD_ROOT%{_bindir}/speedycgi
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %post -n apache-mod_speedycgi
142 %service -q httpd restart
143
144 %post -n apache1-mod_speedycgi
145 %service -q apache restart
146
147 %preun -n apache-mod_speedycgi
148 if [ "$1" = "0" ]; then
149         %service -q httpd restart
150 fi
151
152 %preun -n apache1-mod_speedycgi
153 if [ "$1" = "0" ]; then
154         %service -q apache restart
155 fi
156
157 %files
158 %defattr(644,root,root,755)
159 %doc README docs contrib
160 %{perl_vendorlib}/CGI/*.pm
161 %attr(755,root,root) %{_bindir}/speedy*
162
163 %if %{with apache1}
164 %files -n apache1-mod_speedycgi
165 %defattr(644,root,root,755)
166 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apache1confdir}/*mod_speedycgi.conf
167 %attr(755,root,root) %{apache1libdir}/mod_speedycgi.so
168 %dir %{apache1docdir}/*
169 %endif
170
171 %if %{with apache2}
172 %files -n apache-mod_speedycgi
173 %defattr(644,root,root,755)
174 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apache2confdir}/*mod_speedycgi.conf
175 %attr(755,root,root) %{apache2libdir}/mod_speedycgi.so
176 %dir %{apache2docdir}/*
177 %endif
This page took 0.145949 seconds and 4 git commands to generate.