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