]>
Commit | Line | Data |
---|---|---|
2d7e8b2d | 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 | Name: perl-%{perlname} | |
abbd5357 | 6 | Version: 2.0.1 |
c17bc7b6 | 7 | Release: 2 |
8 | License: GPL | |
2d7e8b2d | 9 | Group: Networking/Daemons |
c17bc7b6 | 10 | Group(de): Netzwerkwesen/Server |
2d7e8b2d | 11 | Group(pl): Sieciowe/Serwery |
12 | Source0: http://daemoninc.com/speedycgi/%{perlname}-%{version}.tar.gz | |
13 | Source1: apache-mod_speedycgi.conf | |
14 | BuildRequires: rpm-perlprov >= 3.0.3-16 | |
c17bc7b6 | 15 | BuildRequires: perl >= 5.6 |
2d7e8b2d | 16 | %requires_eq perl |
17 | Requires: %{perl_sitearch} | |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
19 | ||
c17bc7b6 | 20 | %define apache_moddir %(/usr/sbin/apxs -q LIBEXECDIR) |
2d7e8b2d | 21 | |
22 | %description | |
23 | SpeedyCGI is a way to run CGI perl scripts persistently, which usually | |
24 | makes them run much more quickly. After the script is initially run, | |
25 | instead of exiting, SpeedyCGI keeps the perl interpreter running in | |
26 | memory. During subsequent runs, this interpreter is used to handle new | |
27 | requests, instead of starting a new perl interpreter for each | |
28 | execution. | |
29 | ||
30 | %package -n apache-mod_speedycgi | |
31 | Summary: SpeedyCGI apache module | |
32 | Group: Networking/Daemons | |
c17bc7b6 | 33 | Group(de): Netzwerkwesen/Server |
2d7e8b2d | 34 | Group(pl): Sieciowe/Serwery |
35 | Requires: %{name} = %{version} | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description -n apache-mod_speedycgi | |
c17bc7b6 | 39 | SpeedyCGI apache module. |
2d7e8b2d | 40 | |
41 | %prep | |
42 | %setup -q -n %{perlname}-%{version} | |
43 | ||
44 | %build | |
45 | perl Makefile.PL | |
46 | ( cd mod_speedycgi && perl Makefile.PL ) | |
47 | ||
c17bc7b6 | 48 | %{__make} OPTIMIZE="%{?debug:-O -g}%{!?debug:$RPM_OPT_FLAGS}" |
49 | %{__make} -C mod_speedycgi \ | |
50 | OPTIMIZE="%{?debug:-O -g}%{!?debug:$RPM_OPT_FLAGS}" \ | |
51 | APXS="/usr/sbin/apxs" | |
2d7e8b2d | 52 | |
53 | %install | |
54 | rm -rf $RPM_BUILD_ROOT | |
c17bc7b6 | 55 | install -d $RPM_BUILD_ROOT/%{perl_archlib} \ |
56 | $RPM_BUILD_ROOT{%{apache_moddir},/home/httpd/speedy,%{_sysconfdir}/httpd} | |
2d7e8b2d | 57 | |
58 | %{__make} install \ | |
59 | DESTDIR=$RPM_BUILD_ROOT | |
2d7e8b2d | 60 | |
2d7e8b2d | 61 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/mod_speedycgi.conf |
62 | install mod_speedycgi/mod_speedycgi.so $RPM_BUILD_ROOT%{apache_moddir} | |
c17bc7b6 | 63 | |
2d7e8b2d | 64 | gzip -9nf README docs/*.txt contrib/Mason-SpeedyCGI-HOWTO |
2d7e8b2d | 65 | |
66 | %clean | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | ||
69 | %post -n apache-mod_speedycgi | |
70 | HTTPDCONF=%{_sysconfdir}/httpd/httpd.conf | |
71 | if [ -f $HTTPDCONF ] && \ | |
72 | ! grep -q "^Include.*/mod_speedycgi.conf" $HTTPDCONF; then | |
73 | echo "Include /etc/httpd/mod_speedycgi.conf" >> $HTTPDCONF | |
74 | fi | |
75 | if [ -f /var/lock/subsys/httpd ]; then | |
76 | /etc/rc.d/init.d/httpd restart 1>&2 | |
77 | else | |
78 | echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon." | |
79 | fi | |
80 | ||
81 | %postun -n apache-mod_speedycgi | |
82 | HTTPDCONF=%{_sysconfdir}/httpd/httpd.conf | |
83 | grep -E -v "^Include.*mod_speedycgi.conf" $HTTPDCONF > $HTTPDCONF.tmp$$ | |
c17bc7b6 | 84 | mv -f $HTTPDCONF.tmp$$ $HTTPDCONF |
2d7e8b2d | 85 | if [ -f /var/lock/subsys/httpd ]; then |
86 | /etc/rc.d/init.d/httpd restart 1>&2 | |
87 | fi | |
88 | ||
89 | %files | |
90 | %defattr(644,root,root,755) | |
c17bc7b6 | 91 | %doc *.gz docs contrib |
2d7e8b2d | 92 | %{perl_sitelib}/CGI/*.pm |
2d7e8b2d | 93 | %attr(755,root,root) %{_bindir}/speedy* |
2d7e8b2d | 94 | |
95 | %files -n apache-mod_speedycgi | |
96 | %defattr(644,root,root,755) | |
97 | %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/mod_speedycgi.conf | |
98 | %{apache_moddir}/mod_speedycgi.so | |
99 | %dir /home/httpd/speedy |