]> git.pld-linux.org Git - SPECS.git/blob - js-fileuploader.spec
SPECS updated Sun 1 Aug 20:13:02 CEST 2021
[SPECS.git] / js-fileuploader.spec
1 %define         plugin  fileuploader
2 Summary:        Multiple file upload plugin with progress-bar, drag-and-drop
3 Name:           js-%{plugin}
4 Version:        2.0
5 Release:        4
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
12 BuildRequires:  js
13 BuildRequires:  unzip
14 BuildRequires:  yuicompressor
15 Requires:       webserver(access)
16 Requires:       webserver(alias)
17 #Obsoletes:     js-ajax-upload
18 BuildArch:      noarch
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %define         _webapps        /etc/webapps
22 %define         _webapp         %{name}
23 %define         _sysconfdir     %{_webapps}/%{_webapp}
24 %define         _appdir         %{_datadir}/%{_webapp}
25
26 %description
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.
30
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.
35
36 It does not use Flash, jQuery, or any external libraries.
37
38 %package demo
39 Summary:        Demo for %{plugin}
40 Summary(pl.UTF-8):      Pliki demonstracyjne dla pakietu %{plugin}
41 Group:          Development
42 Requires:       %{name} = %{version}-%{release}
43
44 %description demo
45 Demonstrations and samples for %{plugin}.
46
47 %prep
48 %setup -qc
49
50 # Apache1/Apache2 config
51 cat > apache.conf <<'EOF'
52 Alias /js/%{plugin} %{_appdir}
53 <Directory %{_appdir}>
54         Options +FollowSymLinks
55         # Apache 2.x
56         <IfModule !mod_authz_core.c>
57                 Order allow,deny
58                 Allow from all
59         </IfModule>
60         # Apache 2.4
61         <IfModule mod_authz_core.c>
62                 Require all granted
63         </IfModule>
64 </Directory>
65 EOF
66
67 # lighttpd config
68 cat > lighttpd.conf <<'EOF'
69 alias.url += (
70         "/js/%{plugin}" => "%{_appdir}",
71 )
72 EOF
73
74 %build
75 install -d build
76
77 # pack .css
78 for css in *.css; do
79         out=build/${css#*/}
80 %if 0%{!?debug:1}
81         yuicompressor --charset UTF-8 $css -o $out
82 %else
83         cp -p $css $out
84 %endif
85 done
86
87 %install
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
93
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
97
98 cp -p loading.gif  $RPM_BUILD_ROOT%{_appdir}
99
100 cp -a *.htm $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
101
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
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT
109
110 %triggerin -- apache1 < 1.3.37-3, apache1-base
111 %webapp_register apache %{_webapp}
112
113 %triggerun -- apache1 < 1.3.37-3, apache1-base
114 %webapp_unregister apache %{_webapp}
115
116 %triggerin -- apache < 2.2.0, apache-base
117 %webapp_register httpd %{_webapp}
118
119 %triggerun -- apache < 2.2.0, apache-base
120 %webapp_unregister httpd %{_webapp}
121
122 %triggerin -- lighttpd
123 %webapp_register lighttpd %{_webapp}
124
125 %triggerun -- lighttpd
126 %webapp_unregister lighttpd %{_webapp}
127
128 %files
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
134 %{_appdir}
135
136 %files demo
137 %defattr(644,root,root,755)
138 %{_examplesdir}/%{name}-%{version}
This page took 0.063833 seconds and 3 git commands to generate.