-
Notifications
You must be signed in to change notification settings - Fork 2
/
macros.nodejs
47 lines (37 loc) · 1.36 KB
/
macros.nodejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# nodejs binary
%__nodejs %{_bindir}/node
# nodejs library directory
%nodejs_sitelib %{_prefix}/lib/node_modules
#arch specific library directory
#for future-proofing only; we don't do multilib
%nodejs_sitearch %{nodejs_sitelib}
# currently installed nodejs version
%nodejs_version %(%{__nodejs} -v | sed s/v//)
# macro to filter unwanted provides from Node.js binary native modules
%nodejs_default_filter %{expand: \
%global __provides_exclude_from ^%{nodejs_sitearch}/.*\\.node$
}
# no-op macro to allow spec compatibility with EPEL
%nodejs_find_provides_and_requires \
%if 0%{?suse_version} <= 1110 \
%global _use_internal_dependency_generator 0 \
%global __find_provides %{_prefix}/lib/rpm/nodejs.prov \
%global __find_requires %{_prefix}/lib/rpm/nodejs.req \
%nodejs_default_filter \
%else \
%nil \
%endif
%nodejs_prep node2rpm-server --prep
%nodejs_mkdir node2rpm-server --mkdir
%nodejs_copy node2rpm-server --copy
%nodejs_build node2rpm-server --build
%nodejs_clean node2rpm-server --clean
%nodejs_filelist node2rpm-server --filelist
%nodejs_symlink_deps %{_prefix}/lib/rpm/nodejs-symlink-deps.rb
%nodejs_fixdep %{_prefix}/lib/rpm/nodejs-fixdep.rb
%nodejs_check %{_prefix}/lib/rpm/nodejs-check.rb
#compat opensuse
%nodejs_modulesdir %{nodejs_sitelib}
%nodejs_install \
mkdir -p %{buildroot}%{nodejs_sitelib} \
npm_config_prefix=%{buildroot}%{_prefix} npm install -g %{S:0}