]> git.pld-linux.org Git - packages/js-fileuploader.git/blob - js-fileuploader.spec
- migrated to apache 2.4
[packages/js-fileuploader.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:        3
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 Conflicts:      apache-base < 2.4.0-1
19 BuildArch:      noarch
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %define         _webapps        /etc/webapps
23 %define         _webapp         %{name}
24 %define         _sysconfdir     %{_webapps}/%{_webapp}
25 %define         _appdir         %{_datadir}/%{_webapp}
26
27 %description
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.
31
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.
36
37 It does not use Flash, jQuery, or any external libraries.
38
39 %package demo
40 Summary:        Demo for %{plugin}
41 Summary(pl.UTF-8):      Pliki demonstracyjne dla pakietu %{plugin}
42 Group:          Development
43 Requires:       %{name} = %{version}-%{release}
44
45 %description demo
46 Demonstrations and samples for %{plugin}.
47
48 %prep
49 %setup -qc
50
51 # Apache1 config
52 cat > apache.conf <<'EOF'
53 Alias /js/%{plugin} %{_appdir}
54 <Directory %{_appdir}>
55         Allow from all
56         Options +FollowSymLinks
57 </Directory>
58 EOF
59
60 # Apache2 config
61 cat > httpd.conf <<'EOF'
62 Alias /js/%{plugin} %{_appdir}
63 <Directory %{_appdir}>
64         Require all granted
65         Options +FollowSymLinks
66 </Directory>
67 EOF
68
69 # lighttpd config
70 cat > lighttpd.conf <<'EOF'
71 alias.url += (
72         "/js/%{plugin}" => "%{_appdir}",
73 )
74 EOF
75
76 %build
77 install -d build
78
79 # pack .css
80 for css in *.css; do
81         out=build/${css#*/}
82 %if 0%{!?debug:1}
83         yuicompressor --charset UTF-8 $css -o $out
84 %else
85         cp -p $css $out
86 %endif
87 done
88
89 %install
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
95
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
99
100 cp -p loading.gif  $RPM_BUILD_ROOT%{_appdir}
101
102 cp -a *.htm $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
103
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
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %triggerin -- apache1 < 1.3.37-3, apache1-base
113 %webapp_register apache %{_webapp}
114
115 %triggerun -- apache1 < 1.3.37-3, apache1-base
116 %webapp_unregister apache %{_webapp}
117
118 %triggerin -- apache-base
119 %webapp_register httpd %{_webapp}
120
121 %triggerun -- apache-base
122 %webapp_unregister httpd %{_webapp}
123
124 %triggerin -- lighttpd
125 %webapp_register lighttpd %{_webapp}
126
127 %triggerun -- lighttpd
128 %webapp_unregister lighttpd %{_webapp}
129
130 %files
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
136 %{_appdir}
137
138 %files demo
139 %defattr(644,root,root,755)
140 %{_examplesdir}/%{name}-%{version}
This page took 0.149991 seconds and 3 git commands to generate.