1 %define plugin fileuploader
2 Summary: Multiple file upload plugin with progress-bar, drag-and-drop
6 License: MIT, GPL v2 or LGPL v2
7 Group: Applications/WWW
8 Source0: https://github.com/downloads/valums/file-uploader/%{version}.zip
9 # Source0-md5: 0b45522b5337b38e1720dc9600337b5d
10 URL: https://github.com/valums/file-uploader
11 BuildRequires: closure-compiler
14 BuildRequires: yuicompressor
15 Requires: webserver(access)
16 Requires: webserver(alias)
17 #Obsoletes: js-ajax-upload
18 Conflicts: apache-base < 2.4.0-1
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 %define _webapps /etc/webapps
23 %define _webapp %{name}
24 %define _sysconfdir %{_webapps}/%{_webapp}
25 %define _appdir %{_datadir}/%{_webapp}
28 This project attempts to achieve a user-friendly file-uploading
29 experience over the web. It's built as a Javascript plugin for
30 developers looking to incorporate file-uploading into their website.
32 This plugin uses an XMLHttpRequest (AJAX) for uploading multiple files
33 with a progress-bar in FF3.6+, Safari4+, Chrome and falls back to
34 hidden-iframe-based upload in other browsers (namely IE), providing
35 good user experience everywhere.
37 It does not use Flash, jQuery, or any external libraries.
40 Summary: Demo for %{plugin}
41 Summary(pl.UTF-8): Pliki demonstracyjne dla pakietu %{plugin}
43 Requires: %{name} = %{version}-%{release}
46 Demonstrations and samples for %{plugin}.
52 cat > apache.conf <<'EOF'
53 Alias /js/%{plugin} %{_appdir}
54 <Directory %{_appdir}>
56 Options +FollowSymLinks
61 cat > httpd.conf <<'EOF'
62 Alias /js/%{plugin} %{_appdir}
63 <Directory %{_appdir}>
65 Options +FollowSymLinks
70 cat > lighttpd.conf <<'EOF'
72 "/js/%{plugin}" => "%{_appdir}",
83 yuicompressor --charset UTF-8 $css -o $out
90 rm -rf $RPM_BUILD_ROOT
91 install -d $RPM_BUILD_ROOT{%{_appdir},%{_examplesdir}/%{name}-%{version}}
92 cp -p %{plugin}.min.js $RPM_BUILD_ROOT%{_appdir}/%{plugin}-%{version}.min.js
93 cp -p %{plugin}.js $RPM_BUILD_ROOT%{_appdir}/%{plugin}-%{version}.js
94 ln -s %{plugin}-%{version}.min.js $RPM_BUILD_ROOT%{_appdir}/%{plugin}.js
96 cp -p %{plugin}.css $RPM_BUILD_ROOT%{_appdir}/%{plugin}-%{version}.css
97 cp -p build/%{plugin}.css $RPM_BUILD_ROOT%{_appdir}/%{plugin}-%{version}.min.css
98 ln -s %{plugin}-%{version}.min.css $RPM_BUILD_ROOT%{_appdir}/%{plugin}.css
100 cp -p loading.gif $RPM_BUILD_ROOT%{_appdir}
102 cp -a *.htm $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
104 install -d $RPM_BUILD_ROOT%{_sysconfdir}
105 cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
106 cp -p httpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
107 cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
110 rm -rf $RPM_BUILD_ROOT
112 %triggerin -- apache1 < 1.3.37-3, apache1-base
113 %webapp_register apache %{_webapp}
115 %triggerun -- apache1 < 1.3.37-3, apache1-base
116 %webapp_unregister apache %{_webapp}
118 %triggerin -- apache-base
119 %webapp_register httpd %{_webapp}
121 %triggerun -- apache-base
122 %webapp_unregister httpd %{_webapp}
124 %triggerin -- lighttpd
125 %webapp_register lighttpd %{_webapp}
127 %triggerun -- lighttpd
128 %webapp_unregister lighttpd %{_webapp}
131 %defattr(644,root,root,755)
132 %dir %attr(750,root,http) %{_sysconfdir}
133 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
134 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
135 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
139 %defattr(644,root,root,755)
140 %{_examplesdir}/%{name}-%{version}