add another install mode: bundled vendors
[packages/bower.git] / bower.spec
CommitLineData
83be53a5
ER
1# TODO
2# - use system node deps
3b2807ba
ER
3#
4# Conditional build:
5%bcond_with npm # build with npm installing vendors on package install
6%bcond_without bundled # build npm vendors bundled
7
83be53a5
ER
8Summary: A package manager for the web
9Name: bower
10Version: 1.3.9
3b2807ba 11Release: 0.7
83be53a5
ER
12License: MIT
13Group: Development/Libraries
14Source0: http://registry.npmjs.org/bower/-/%{name}-%{version}.tgz
15# Source0-md5: b5e2e8f895144d22ec26a76fd6065ab5
16URL: http://bower.io/
17BuildRequires: rpmbuild(macros) >= 1.634
18BuildRequires: sed >= 4.0
3b2807ba
ER
19%if %{with bundled}
20BuildRequires: npm
21%endif
22%if %{with npm}
23Requires: npm
24%endif
83be53a5 25Requires: nodejs >= 0.10.0
3b2807ba 26%if %{without npm} && %{without bundled}
83be53a5
ER
27Requires: nodejs-abbrev >= 1.0.4
28Requires: nodejs-archy >= 0.0.2
29Requires: nodejs-bower-config >= 0.5.2
30Requires: nodejs-bower-endpoint-parser >= 0.2.2
31Requires: nodejs-bower-json >= 0.4.0
32Requires: nodejs-bower-logger >= 0.2.2
33Requires: nodejs-bower-registry-client >= 0.2.0
34Requires: nodejs-cardinal >= 0.4.0
35Requires: nodejs-chalk >= 0.5.0
36Requires: nodejs-chmodr >= 0.1.0
37Requires: nodejs-decompress-zip >= 0.0.6
38Requires: nodejs-fstream >= 0.1.22
39Requires: nodejs-fstream-ignore >= 0.0.6
40Requires: nodejs-glob >= 4.0.2
41Requires: nodejs-graceful-fs >= 3.0.1
42Requires: nodejs-handlebars >= 1.3.0
43Requires: nodejs-inquirer >= 0.5.1
44Requires: nodejs-insight >= 0.4.1
45Requires: nodejs-is-root >= 0.1.0
46Requires: nodejs-junk >= 0.3.0
47Requires: nodejs-lockfile >= 0.4.2
48Requires: nodejs-lru-cache >= 2.5.0
49Requires: nodejs-mkdirp >= 0.5.0
50Requires: nodejs-mout >= 0.9.1
51Requires: nodejs-nopt >= 3.0.0
52Requires: nodejs-opn >= 0.1.1
53Requires: nodejs-osenv >= 0.1.0
54Requires: nodejs-p-throttler >= 0.0.1
55Requires: nodejs-promptly >= 0.2.0
56Requires: nodejs-q >= 1.0.1
57Requires: nodejs-request >= 2.36.0
58Requires: nodejs-request-progress >= 0.3.0
59Requires: nodejs-retry >= 0.6.0
60Requires: nodejs-rimraf >= 2.2.0
61Requires: nodejs-semver >= 2.3.0
62Requires: nodejs-shell-quote >= 1.4.1
63Requires: nodejs-stringify-object >= 0.2.0
64Requires: nodejs-tar >= 0.1.17
65Requires: nodejs-tmp >= 0.0.23
66Requires: nodejs-update-notifier >= 0.2.0
67Requires: nodejs-which >= 1.0.5
68%endif
69BuildArch: noarch
70BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72%description
73Bower works by fetching and installing packages from all over, taking
74care of hunting, finding, downloading, and saving the stuff you're
75looking for. Bower keeps track of these packages in a manifest file,
76bower.json. How you use packages is up to you. Bower provides hooks to
77facilitate using packages in your tools and workflows.
78
79Bower is optimized for the front-end. Bower uses a flat dependency
80tree, requiring only one version for each package, reducing page load
81to a minimum.
82
83%prep
84%setup -qc
85mv package/* .
86
87%{__sed} -i -e '1s,^#!.*node,#!/usr/bin/node,' bin/*
88chmod a+rx bin/*
89
3b2807ba
ER
90%if %{with bundled}
91%build
92npm install .
93chmod -R a+rX node_modules
94%endif
95
83be53a5
ER
96%install
97rm -rf $RPM_BUILD_ROOT
98install -d $RPM_BUILD_ROOT{%{_bindir},%{nodejs_libdir}/%{name}}
99cp -pr lib bin templates package.json $RPM_BUILD_ROOT%{nodejs_libdir}/%{name}
100ln -s %{nodejs_libdir}/%{name}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
101
3b2807ba
ER
102%if %{with bundled}
103cp -a node_modules $RPM_BUILD_ROOT%{nodejs_libdir}/%{name}
104%endif
105
83be53a5
ER
106%clean
107rm -rf $RPM_BUILD_ROOT
108
3b2807ba 109%if %{with npm}
83be53a5
ER
110# hack to setup node modules until system deps are available
111%post
83be53a5
ER
112test -d %{nodejs_libdir}/%{name}/node_modules && exit 0
113cd %{nodejs_libdir}/%{name}
114npm install
3b2807ba
ER
115
116%postun
117if [ "$1" = 0 ]; then
118 rm -r %{nodejs_libdir}/%{name}/node_modules
119fi
83be53a5
ER
120%endif
121
122%files
123%defattr(644,root,root,755)
124%doc README.md CHANGELOG.md CONTRIBUTING.md HOOKS.md LICENSE
125%attr(755,root,root) %{_bindir}/bower
126%dir %{nodejs_libdir}/%{name}
127%{nodejs_libdir}/%{name}/package.json
128%{nodejs_libdir}/%{name}/templates
129%{nodejs_libdir}/%{name}/lib
130%dir %{nodejs_libdir}/%{name}/bin
131%attr(755,root,root) %{nodejs_libdir}/%{name}/bin/*
3b2807ba
ER
132
133%if %{with bundled}
134%defattr(-,root,root,-)
135%{nodejs_libdir}/%{name}/node_modules
136%endif
This page took 0.116785 seconds and 4 git commands to generate.