]>
Commit | Line | Data |
---|---|---|
1c231ca7 ER |
1 | %define pkg coffee-script |
2 | Summary: The CoffeeScript Compiler | |
3 | Name: coffee-script | |
a58228a2 | 4 | Version: 1.6.3 |
1c231ca7 ER |
5 | Release: 1 |
6 | License: MIT | |
7 | Group: Development/Libraries | |
a58228a2 AM |
8 | URL: http://coffeescript.org/ |
9 | Source0: https://github.com/jashkenas/coffee-script/archive/%{version}.tar.gz | |
10 | # Source0-md5: 837fb08b97deb00c471101b9c3a5a107 | |
11 | Patch0: coffee-script-Cakefile.patch | |
12 | Patch1: coffee-script-fix-importing-test.patch | |
1c231ca7 ER |
13 | BuildRequires: rpmbuild(macros) >= 1.634 |
14 | BuildRequires: sed >= 4.0 | |
15 | Requires: nodejs >= 0.6 | |
16 | BuildArch: noarch | |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
18 | ||
19 | %description | |
20 | CoffeeScript is a little language that compiles into JavaScript. | |
21 | Underneath all of those embarrassing braces and semicolons, JavaScript | |
22 | has always had a gorgeous object model at its heart. CoffeeScript is | |
23 | an attempt to expose the good parts of JavaScript in a simple way. | |
24 | ||
25 | %prep | |
a58228a2 AM |
26 | %setup -q |
27 | %patch0 -p0 | |
28 | %patch1 -p1 | |
1c231ca7 | 29 | |
a58228a2 | 30 | %build |
1c231ca7 ER |
31 | %{__sed} -i -e '1s,^#!.*node,#!/usr/bin/node,' bin/* |
32 | chmod a+rx bin/* | |
33 | ||
a58228a2 AM |
34 | ./bin/cake build |
35 | ||
36 | #also build the unminifed version | |
37 | MINIFY=false ./bin/cake build:browser | |
38 | ||
1c231ca7 ER |
39 | %install |
40 | rm -rf $RPM_BUILD_ROOT | |
41 | install -d $RPM_BUILD_ROOT%{nodejs_libdir}/%{pkg} | |
a58228a2 | 42 | cp -a bin lib package.json $RPM_BUILD_ROOT%{nodejs_libdir}/%{pkg} |
1c231ca7 ER |
43 | |
44 | install -d $RPM_BUILD_ROOT%{_bindir} | |
45 | ln -s %{nodejs_libdir}/%{pkg}/bin/cake $RPM_BUILD_ROOT%{_bindir}/cake.coffeescript | |
46 | ln -s %{nodejs_libdir}/%{pkg}/bin/coffee $RPM_BUILD_ROOT%{_bindir} | |
47 | ||
48 | %clean | |
49 | rm -rf $RPM_BUILD_ROOT | |
50 | ||
51 | %files | |
52 | %defattr(644,root,root,755) | |
53 | %doc README LICENSE CONTRIBUTING.md | |
54 | %attr(755,root,root) %{_bindir}/cake.coffeescript | |
55 | %attr(755,root,root) %{_bindir}/coffee | |
56 | %dir %{nodejs_libdir}/%{pkg} | |
57 | %{nodejs_libdir}/%{pkg}/lib | |
a58228a2 | 58 | %{nodejs_libdir}/%{pkg}/package.json |
1c231ca7 ER |
59 | %dir %{nodejs_libdir}/%{pkg}/bin |
60 | %attr(755,root,root) %{nodejs_libdir}/%{pkg}/bin/* |