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