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
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define _webapps /etc/webapps
22 %define _webapp %{name}
23 %define _sysconfdir %{_webapps}/%{_webapp}
24 %define _appdir %{_datadir}/%{_webapp}
27 This project attempts to achieve a user-friendly file-uploading
28 experience over the web. It's built as a Javascript plugin for
29 developers looking to incorporate file-uploading into their website.
31 This plugin uses an XMLHttpRequest (AJAX) for uploading multiple files
32 with a progress-bar in FF3.6+, Safari4+, Chrome and falls back to
33 hidden-iframe-based upload in other browsers (namely IE), providing
34 good user experience everywhere.
36 It does not use Flash, jQuery, or any external libraries.
39 Summary: Demo for %{plugin}
40 Summary(pl.UTF-8): Pliki demonstracyjne dla pakietu %{plugin}
42 Requires: %{name} = %{version}-%{release}
45 Demonstrations and samples for %{plugin}.
50 # Apache1/Apache2 config
51 cat > apache.conf <<'EOF'
52 Alias /js/%{plugin} %{_appdir}
53 <Directory %{_appdir}>
54 Options +FollowSymLinks
56 <IfModule !mod_authz_core.c>
61 <IfModule mod_authz_core.c>
68 cat > lighttpd.conf <<'EOF'
70 "/js/%{plugin}" => "%{_appdir}",
81 yuicompressor --charset UTF-8 $css -o $out
88 rm -rf $RPM_BUILD_ROOT
89 install -d $RPM_BUILD_ROOT{%{_appdir},%{_examplesdir}/%{name}-%{version}}
90 cp -p %{plugin}.min.js $RPM_BUILD_ROOT%{_appdir}/%{plugin}-%{version}.min.js
91 cp -p %{plugin}.js $RPM_BUILD_ROOT%{_appdir}/%{plugin}-%{version}.js
92 ln -s %{plugin}-%{version}.min.js $RPM_BUILD_ROOT%{_appdir}/%{plugin}.js
94 cp -p %{plugin}.css $RPM_BUILD_ROOT%{_appdir}/%{plugin}-%{version}.css
95 cp -p build/%{plugin}.css $RPM_BUILD_ROOT%{_appdir}/%{plugin}-%{version}.min.css
96 ln -s %{plugin}-%{version}.min.css $RPM_BUILD_ROOT%{_appdir}/%{plugin}.css
98 cp -p loading.gif $RPM_BUILD_ROOT%{_appdir}
100 cp -a *.htm $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
102 install -d $RPM_BUILD_ROOT%{_sysconfdir}
103 cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
104 cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
105 cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
108 rm -rf $RPM_BUILD_ROOT
110 %triggerin -- apache1 < 1.3.37-3, apache1-base
111 %webapp_register apache %{_webapp}
113 %triggerun -- apache1 < 1.3.37-3, apache1-base
114 %webapp_unregister apache %{_webapp}
116 %triggerin -- apache < 2.2.0, apache-base
117 %webapp_register httpd %{_webapp}
119 %triggerun -- apache < 2.2.0, apache-base
120 %webapp_unregister httpd %{_webapp}
122 %triggerin -- lighttpd
123 %webapp_register lighttpd %{_webapp}
125 %triggerun -- lighttpd
126 %webapp_unregister lighttpd %{_webapp}
129 %defattr(644,root,root,755)
130 %dir %attr(750,root,http) %{_sysconfdir}
131 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
132 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
133 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
137 %defattr(644,root,root,755)
138 %{_examplesdir}/%{name}-%{version}