/[packages]/cauldron/nodejs-hooker/current/SPECS/nodejs-hooker.spec
ViewVC logotype

Contents of /cauldron/nodejs-hooker/current/SPECS/nodejs-hooker.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 903197 - (show annotations) (download)
Sun Nov 15 02:56:46 2015 UTC (9 years, 8 months ago) by tv
File size: 2117 byte(s)
disable tests due to missing deps
1 %{?nodejs_find_provides_and_requires}
2
3 # (tv) disabled b/c of missing deps on 'npm(nodeunit)'
4 %global enable_tests 0
5
6 # This package requires the grunt stack, but grunt also requires this package.
7 # Before grunt is available, this will need to be built manually.
8 %global enable_grunt 0
9
10 Name: nodejs-hooker
11 Version: 0.2.3
12 Release: %mkrel 4
13 Summary: Monkey-patch (hook) functions for debugging
14 License: MIT
15 Group: Development/Other
16 URL: https://github.com/cowboy/javascript-hooker
17 Source0: http://registry.npmjs.org/hooker/-/hooker-%{version}.tgz
18
19 # This is taken from the upstream version control repository.
20 Patch0: %{name}-0.2.3-Updating-gruntfile-to-grunt-0.3.0-format.patch
21 # These two patches update grunt.js for use with grunt 0.4.0.
22 # Pull request sent: https://github.com/cowboy/javascript-hooker/pull/3
23 Patch1: %{name}-0.2.3-Rename-grunt.js-to-Gruntfile.js.patch
24 Patch2: %{name}-0.2.3-Update-Gruntfile.js-for-use-with-grunt-0.4.0.patch
25
26 BuildArch: noarch
27
28 BuildRequires: nodejs-packaging
29 BuildRequires: uglify-js
30
31 %if 0%{?enable_tests}
32 BuildRequires: npm(nodeunit)
33 %endif
34
35 %if 0%{?enable_grunt}
36 BuildRequires: npm(grunt-cli)
37 BuildRequires: npm(grunt-contrib-nodeunit)
38 BuildRequires: npm(grunt-contrib-uglify)
39 %endif
40
41 %description
42 %{summary}.
43
44
45 %prep
46 %setup -q -n package
47 %patch0 -p1
48 %patch1 -p1
49 %patch2 -p1
50 %nodejs_symlink_deps --check
51
52
53 %build
54 %if 0%{?enable_grunt}
55 grunt uglify
56 %else
57 # Add copyright header to the minified script.
58 head -n 8 lib/hooker.js > dist/ba-hooker.min.js.new
59 # Minify and preserve timestamp.
60 /usr/bin/uglifyjs dist/ba-hooker.js -m -c >> dist/ba-hooker.min.js.new
61 touch -r dist/ba-hooker.min.js dist/ba-hooker.min.js.new
62 mv dist/ba-hooker.min.js{.new,}
63 %endif
64
65
66 %install
67 mkdir -p %{buildroot}%{nodejs_sitelib}/hooker
68 cp -pr package.json child.js dist/ lib/ parent.js \
69 %{buildroot}%{nodejs_sitelib}/hooker
70
71 %nodejs_symlink_deps
72
73
74 %if 0%{?enable_tests}
75 %check
76 %if 0%{?enable_grunt}
77 grunt nodeunit
78 %else
79 %{nodejs_sitelib}/nodeunit/bin/nodeunit test/*.js
80 %endif
81 %endif
82
83
84 %files
85 %doc LICENSE-MIT README.md
86 %{nodejs_sitelib}/hooker

  ViewVC Help
Powered by ViewVC 1.1.30