[nodejs-lodash-node] Build packages for modularized lodash
Tom Hughes
tomh at fedoraproject.org
Fri Aug 15 09:06:51 UTC 2014
commit 33e5e7e268edae2162ecf3f4cc94375eb9910a41
Author: Tom Hughes <tom at compton.nu>
Date: Fri Aug 15 09:31:22 2014 +0100
Build packages for modularized lodash
nodejs-lodash-node-functions.txt | 162 ++++++++++++++++++++++++++++++++++++++
nodejs-lodash-node.spec | 36 ++++++++-
2 files changed, 197 insertions(+), 1 deletions(-)
---
diff --git a/nodejs-lodash-node-functions.txt b/nodejs-lodash-node-functions.txt
new file mode 100644
index 0000000..e142bca
--- /dev/null
+++ b/nodejs-lodash-node-functions.txt
@@ -0,0 +1,162 @@
+after
+_arraypool
+assign
+at
+_basebind
+_baseclone
+_basecreate
+_basecreatecallback
+_basecreatewrapper
+_basedifference
+_baseflatten
+_baseindexof
+_baseisequal
+_basemerge
+_baserandom
+_baseuniq
+bind
+bindall
+bindkey
+_cacheindexof
+_cachepush
+_charatcallback
+clone
+clonedeep
+compact
+_compareascending
+compose
+constant
+contains
+countby
+create
+_createaggregator
+_createcache
+createcallback
+_createwrapper
+curry
+debounce
+defaults
+defer
+delay
+difference
+escape
+_escapehtmlchar
+_escapestringchar
+every
+filter
+find
+findindex
+findkey
+findlast
+findlastindex
+findlastkey
+first
+flatten
+foreach
+foreachright
+forin
+forinright
+forown
+forownright
+functions
+_getarray
+_getobject
+groupby
+has
+_htmlescapes
+_htmlunescapes
+identity
+indexby
+indexof
+initial
+intersection
+invert
+invoke
+isarguments
+isarray
+isboolean
+isdate
+iselement
+isempty
+isequal
+isfinite
+isfunction
+isnan
+_isnative
+isnull
+isnumber
+isobject
+isplainobject
+isregexp
+isstring
+isundefined
+_keyprefix
+keys
+_largearraysize
+last
+lastindexof
+_lodashwrapper
+map
+mapvalues
+max
+_maxpoolsize
+memoize
+merge
+min
+mixin
+noop
+now
+_objectpool
+_objecttypes
+omit
+once
+pairs
+parseint
+partial
+partialright
+pick
+pluck
+property
+pull
+random
+range
+reduce
+reduceright
+_reescapedhtml
+_reinterpolate
+reject
+_releasearray
+_releaseobject
+remove
+rest
+result
+_reunescapedhtml
+sample
+_setbinddata
+_shimisplainobject
+_shimkeys
+shuffle
+size
+_slice
+some
+sortby
+sortedindex
+support
+template
+templatesettings
+throttle
+times
+toarray
+transform
+unescape
+_unescapehtmlchar
+union
+uniq
+uniqueid
+values
+where
+without
+wrap
+xor
+zip
+zipobject
diff --git a/nodejs-lodash-node.spec b/nodejs-lodash-node.spec
index e2323b2..8474860 100644
--- a/nodejs-lodash-node.spec
+++ b/nodejs-lodash-node.spec
@@ -1,11 +1,12 @@
Name: nodejs-lodash-node
Version: 2.4.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A collection of Lo-Dash methods as Node.js modules
License: MIT
URL: https://github.com/lodash/lodash-node
Source0: http://registry.npmjs.org/lodash-node/-/lodash-node-%{version}.tgz
+Source1: nodejs-lodash-node-functions.txt
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
@@ -16,6 +17,27 @@ BuildRequires: npm(lodash-cli)
A collection of Lo-Dash methods as Node.js modules generated by lodash-cli.
+%{lua:
+template = [[
+%package -n nodejs-lodash-@@PKG@@
+Summary: The Lo-Dash function `_.@@FUNC@@` as a Node.js module
+License: MIT
+Provides: npm(lodash.@@FUNC@@)
+
+%description -n nodejs-lodash-@@PKG@@
+The Lo-Dash function `_.@@FUNC@@` as a Node.js module
+generated by lodash-cli.
+
+%files -n nodejs-lodash-@@PKG@@
+%doc npm/lodash.@@FUNC@@/LICENSE.txt npm/lodash.@@FUNC@@/README.md
+%{nodejs_sitelib}/lodash.@@FUNC@@
+]]
+for func in io.open(rpm.expand("%SOURCE1")):lines() do
+ pkg = string.gsub(func, "_", "")
+ print(rpm.expand(string.gsub(string.gsub(template, "@@FUNC@@", func), "@@PKG@@", pkg)).."\n")
+end}
+
+
%prep
%setup -q -n package
rm -rf node_modules compat modern underscore
@@ -25,11 +47,20 @@ rm -rf node_modules compat modern underscore
%{nodejs_sitelib}/lodash-cli/bin/lodash modularize exports="node" -o ./compat/
%{nodejs_sitelib}/lodash-cli/bin/lodash modularize modern exports="node" -o ./modern/
%{nodejs_sitelib}/lodash-cli/bin/lodash modularize underscore exports="node" -o ./underscore/
+%{nodejs_sitelib}/lodash-cli/bin/lodash modularize modern exports="npm" -o ./npm/
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/lodash-node
cp -pr package.json compat modern underscore %{buildroot}%{nodejs_sitelib}/lodash-node
+pushd npm
+for module in lodash.*
+do
+ mkdir %{buildroot}%{nodejs_sitelib}/$module
+ cp -pr $module/package.json %{buildroot}%{nodejs_sitelib}/$module
+ cp -pr $module/index.js %{buildroot}%{nodejs_sitelib}/$module
+done
+popd
%nodejs_symlink_deps
@@ -39,6 +70,9 @@ cp -pr package.json compat modern underscore %{buildroot}%{nodejs_sitelib}/lodas
%changelog
+* Fri Aug 15 2014 Tom Hughes <tom at compton.nu> - 2.4.1-3
+- Build packages for modularized lodash
+
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
More information about the scm-commits
mailing list