]>
Commit | Line | Data |
---|---|---|
5f8b5e13 | 1 | %define _appname AutoIndex |
20f26bac | 2 | Summary: A Website Directory Indexer and File Manager (AutoIndex PHP Script) |
19529b91 | 3 | Summary(pl.UTF-8): Webowy indeks zawartości katagów i zarządca plików (AutoIndex PHP Script) |
5f8b5e13 | 4 | Name: php-AutoIndex |
edfa20f9 | 5 | Version: 2.2.0 |
91cef6d7 | 6 | Release: 0.2 |
20f26bac | 7 | License: GPL |
8 | Group: Applications/Networking | |
5f8b5e13 | 9 | Source0: http://dl.sourceforge.net/autoindex/%{_appname}-%{version}.tar.gz |
edfa20f9 | 10 | # Source0-md5: 1b3e545baa79218d261a3f64389b38f3 |
5f8b5e13 ER |
11 | Source1: %{name}.php |
12 | Patch0: %{name}-config.patch | |
2fbef3c5 | 13 | URL: http://autoindex.sourceforge.net/ |
20f26bac | 14 | BuildRequires: rpmbuild(macros) >= 1.221 |
8852fc77 | 15 | BuildRequires: migrate-to-webapps |
91cef6d7 | 16 | Requires: php-common >= 4:5.0.0 |
5c18c1ae | 17 | Requires: webserver = apache |
91cef6d7 | 18 | Requires: webserver(php) |
5f8b5e13 ER |
19 | Obsoletes: AutoIndex |
20 | Obsoletes: php4-AutoIndex | |
5c18c1ae | 21 | Conflicts: apache1 < 1.3.33-2 |
20f26bac | 22 | BuildArch: noarch |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
5f8b5e13 ER |
25 | %define _sysconfdir /etc/%{_appname} |
26 | %define _appdir %{_datadir}/%{_appname} | |
27 | ||
20f26bac | 28 | %description |
29 | A Website Directory Indexer and File Manager (AutoIndex PHP Script). | |
30 | ||
c85337f6 JR |
31 | %description -l pl.UTF-8 |
32 | Webowy indeks zawartości katalogów i zarządca plików (AutoIndex PHP | |
20f26bac | 33 | Script). |
34 | ||
20f26bac | 35 | %prep |
5f8b5e13 ER |
36 | %setup -q -n %{_appname} |
37 | %patch0 -p1 | |
38 | rm -f license.html # GPL | |
20f26bac | 39 | |
40 | %install | |
41 | rm -rf $RPM_BUILD_ROOT | |
42 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}} | |
43 | ||
5f8b5e13 ER |
44 | cp -a *.php classes index_icons languages templates $RPM_BUILD_ROOT%{_appdir} |
45 | cp -a hidden_files $RPM_BUILD_ROOT%{_sysconfdir} | |
46 | ||
47 | cat <<'EOF'> $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
48 | Alias /AutoIndex %{_appdir} | |
49 | ||
50 | <Directory %{_appdir}> | |
51 | <IfModule mod_access.c> | |
52 | order allow,deny | |
53 | allow from all | |
54 | </IfModule> | |
55 | </Directory> | |
56 | # vim: filetype=apache ts=4 sw=4 et | |
57 | EOF | |
20f26bac | 58 | |
5f8b5e13 | 59 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{_appname}.conf.php |
20f26bac | 60 | |
61 | %clean | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
5f8b5e13 ER |
64 | %post |
65 | if [ "$1" = 1 ]; then | |
66 | %banner -e %{name} <<EOF | |
67 | - To use AutoIndex in your website, call it from php script: | |
68 | require '%{_appdir}/index.php'; | |
69 | and copy (or symlink) %{_sysconfdir}/%{_appname}.conf.php to the | |
70 | script dir. | |
71 | ||
72 | - For opening config file generation screen, open URL: | |
73 | http://yoursite.example.org/AutoIndex/ | |
74 | ||
75 | EOF | |
76 | fi | |
77 | ||
663740f7 | 78 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
5f8b5e13 | 79 | %apache_config_install -v 1 -c %{_sysconfdir}/apache.conf |
20f26bac | 80 | |
663740f7 | 81 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
20f26bac | 82 | %apache_config_uninstall -v 1 |
83 | ||
84 | %triggerin -- apache >= 2.0.0 | |
5f8b5e13 | 85 | %apache_config_install -v 2 -c %{_sysconfdir}/apache.conf |
20f26bac | 86 | |
87 | %triggerun -- apache >= 2.0.0 | |
88 | %apache_config_uninstall -v 2 | |
89 | ||
90 | %files | |
91 | %defattr(644,root,root,755) | |
5f8b5e13 ER |
92 | %doc *.html |
93 | %attr(751,root,http) %dir %{_sysconfdir} | |
94 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
95 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php | |
96 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hidden_files | |
20f26bac | 97 | %{_appdir} |