diff --git a/.gitignore b/.gitignore index e69de29..456331a 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/bson-0.2.3.tgz diff --git a/nodejs-bson.spec b/nodejs-bson.spec new file mode 100644 index 0000000..ae4501d --- /dev/null +++ b/nodejs-bson.spec @@ -0,0 +1,75 @@ +%global npm_name bson +# Although there are tests +# the dependancies aren't in Fedora yet +%global enable_tests 0 + +Summary: A bson parser for node.js and the browser +Name: nodejs-%{npm_name} +Version: 0.2.3 +Release: 3%{?dist} +Group: Development/Languages +License: ASL 2.0 +URL: https://github.com/mongodb/js-bson +Source0: http://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz +%if 0%{?enable_tests} +## To get the tests (Source1), do the following +# git clone https://github.com/mongodb/js-bson.git +# cd js-bson/ +# tar cfz nodejs-bson-test-0.2.3.tar.gz test/ +Source1: nodejs-bson-test-0.2.3.tar.gz +%endif +BuildRequires: node-gyp +BuildRequires: nodejs-devel +BuildRequires: npm(nan) +%if 0%{?enable_tests} +BuildRequires: npm(gleak) +BuildRequires: npm(nodeunit) +BuildRequires: npm(one) +%endif + +%description +A JS/C++ Bson parser for node, used in the MongoDB Native driver. + +%prep +%setup -q -n package + +%build +export CXXFLAGS="%{optflags}" +export NODE_PATH="/usr/lib/node_modules/" +node-gyp rebuild + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} +cp -pr build/Release/*.node lib package.json %{buildroot}%{nodejs_sitelib}/%{npm_name} + +# Fix permissions +chmod 755 %{buildroot}%{nodejs_sitelib}/%{npm_name}/bson.node + +%if 0%{?enable_tests} +%check +tar xfz %{SOURCE1} +nodeunit ./test/node && TEST_NATIVE=TRUE nodeunit ./test/node +%endif + +%files +%doc README.md +%{nodejs_sitelib}/%{npm_name} + +%changelog +* Tue Dec 03 2013 Troy Dawson - 0.2.3-3 +- Fixed permission on bson.node + +* Sat Nov 16 2013 Troy Dawson - 0.2.3-2 +- Updated source + +* Tue Oct 08 2013 Troy Dawson - 0.2.3-1 +- Updated to 0.2.3 +- Updated BuildRequires and added NODE_PATH +- Added testing, though set to false until packages are made. + +* Tue Oct 08 2013 Troy Dawson - 0.2.2-1 +- Updated to 0.2.2 +- Updated spec file to Fedora guidelines + +* Wed Apr 17 2013 Haibo Lin - 0.1.8-1 +- Initial build diff --git a/sources b/sources index e69de29..a4dfb86 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +aca31d5728e19605b0f2f46ab2c3acd7 bson-0.2.3.tgz