]> git.pld-linux.org Git - packages/perl-CGI-SpeedyCGI.git/blob - perl-CGI-SpeedyCGI.spec
- don't clear httpd.conf when uninstalling mod_speedycgi
[packages/perl-CGI-SpeedyCGI.git] / perl-CGI-SpeedyCGI.spec
1 %include        /usr/lib/rpm/macros.perl
2 %define         perlname CGI-SpeedyCGI
3
4 Summary:        Speed up perl CGI scripts by running them persistently
5 Summary(pl):    Modu³ przyspieszaj±cy perlowe skrypty CGI
6 Name:           perl-%{perlname}
7 Version:        2.11
8 Release:        7
9 License:        GPL
10 Group:          Networking/Daemons
11 URL:            http://daemoninc.com/SpeedyCGI/
12 Source0:        ftp://ftp.cpan.org/pub/CPAN/modules/by-module/CGI/%{perlname}-%{version}.tar.gz
13 Source1:        apache-mod_speedycgi.conf
14 Patch0:         %{name}-DESTDIR.patch
15 BuildRequires:  apache(EAPI)-devel
16 BuildRequires:  rpm-perlprov >= 3.0.3-16
17 BuildRequires:  perl >= 5.6
18 Prereq:         /usr/sbin/apxs 
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %define         apache_moddir   %(/usr/sbin/apxs -q LIBEXECDIR)
22
23 %description 
24 SpeedyCGI is a way to run CGI perl scripts persistently, which usually
25 makes them run much more quickly. After the script is initially run,
26 instead of exiting, SpeedyCGI keeps the perl interpreter running in
27 memory. During subsequent runs, this interpreter is used to handle new
28 requests, instead of starting a new perl interpreter for each
29 execution.
30
31 %description -l pl
32 SpeedyCGI to sposób na ci±g³e dzia³anie perlowych skryptów CGI, co
33 zazwyczaj pododuje, ¿e uruchamiaj± siê du¿o szybciej. Po pocz±tkowym
34 uruchomieniu skryptu, SpeedyCGI trzyma interpreter perla w pamiêci.
35 Przy kolejnych uruchomieniach ten interpreter jest wykorzystywany do
36 obs³ugi kolejnych zleceñ, zamiast uruchamiania nowego interpretera
37 perla do ka¿dego uruchomienia skryptu.
38
39 %package -n apache-mod_speedycgi
40 Summary:        SpeedyCGI apache module
41 Summary(pl):    Modu³ apache SpeedyCGI
42 Group:          Networking/Daemons
43 Requires:       %{name} = %{version}
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %description -n apache-mod_speedycgi
47 SpeedyCGI apache module.
48
49 %description -n apache-mod_speedycgi -l pl
50 Modu³ apache SpeedyCGI.
51
52 %prep
53 %setup -q -n %{perlname}-%{version}
54 %patch -p1
55
56 %build
57 perl Makefile.PL
58 ( cd mod_speedycgi && perl Makefile.PL )
59
60 %{__make} OPTIMIZE="%{rpmcflags}"
61 %{__make} -C mod_speedycgi \
62         OPTIMIZE="%{rpmcflags}" \
63 APXS="%{_sbindir}/apxs"
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT/%{perl_archlib} \
68         $RPM_BUILD_ROOT{%{apache_moddir},/home/httpd/speedy,%{_sysconfdir}/httpd}
69
70 %{__make} install \
71         DESTDIR=$RPM_BUILD_ROOT 
72
73 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/mod_speedycgi.conf
74 install mod_speedycgi/mod_speedycgi.so $RPM_BUILD_ROOT%{apache_moddir}
75
76 %clean
77 rm -rf $RPM_BUILD_ROOT
78
79 %post -n apache-mod_speedycgi
80 %{_sbindir}/apxs -e -a -n speedycgi %{_libexecdir}/mod_speedycgi.so 1>&2
81 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_speedycgi.conf" /etc/httpd/httpd.conf; then
82         echo "Include /etc/httpd/mod_speedycgi.conf" >> /etc/httpd/httpd.conf
83 fi
84 if [ -f /var/lock/subsys/httpd ]; then
85         /etc/rc.d/init.d/httpd restart 1>&2
86 else
87         echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
88 fi
89
90 %preun -n apache-mod_speedycgi
91 if [ "$1" = "0" ]; then
92         %{_sbindir}/apxs -e -A -n speedycgi %{_libexecdir}/mod_speedycgi.so 1>&2
93         grep -v "^Include.*mod_speedycgi.conf" /etc/httpd/httpd.conf > \
94                 /etc/httpd/httpd.conf.tmp
95         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
96         if [ -f /var/lock/subsys/httpd ]; then
97                 /etc/rc.d/init.d/httpd restart 1>&2
98         fi
99 fi
100
101 %files
102 %defattr(644,root,root,755)
103 %doc README docs contrib
104 %{perl_sitelib}/CGI/*.pm
105 %attr(755,root,root) %{_bindir}/speedy*
106
107 %files -n apache-mod_speedycgi
108 %defattr(644,root,root,755)
109 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/mod_speedycgi.conf
110 %{apache_moddir}/mod_speedycgi.so
111 %dir /home/httpd/speedy
This page took 0.061634 seconds and 3 git commands to generate.