Blob Blame Raw
%{?nodejs_default_filter}
%{?nodejs_find_provides_and_requires}

Name:           nodejs-i2c
Version:        0.1.4
Release:        9%{?dist}
Summary:        Node.js native bindings for i2c-dev

%if 0%{?fedora} >= 19
ExclusiveArch:  %{nodejs_arches}
%else
ExclusiveArch:  %{ix86} x86_64 %{arm}
%endif

# package.json indicates BSD, but no license file included
# upstream notified in https://github.com/korevec/node-i2c/pull/9
# we're including a copy of the BSD license in order to comply with the terms of 
# the BSD license, as required by:
# https://fedoraproject.org/wiki/Packaging:LicensingGuidelines#License_Text
#
# src/i2c-dev.(cc|h) are GPLv2+, everything else is BSD
License:        BSD and GPLv2+
URL:            https://github.com/korevec/node-i2c
Source0:        http://registry.npmjs.org/i2c/-/i2c-%{version}.tgz
Source1:        https://raw.github.com/tchollingsworth/node-i2c/0985179d03823cab1bf3c5072bf315b22a7171c8/LICENSE

BuildRequires:  nodejs-devel node-gyp

%description
%{summary}.

Plays well with Raspberry Pi and Beaglebone.

%prep
%setup -q -n package

%nodejs_fixdep coffee-script '~1.4'
%nodejs_fixdep underscore "~1.4"
%nodejs_fixdep bindings '~1.1'

#copy LICENSE file to %%{_builddir} so it works with %%doc
cp %{SOURCE1} .

%build
node-gyp rebuild

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/i2c
cp -pr lib main.js package.json %{buildroot}%{nodejs_sitelib}/i2c

#this module is picky about the directory the shared object is in
mkdir -p %{buildroot}%{nodejs_sitelib}/i2c/build/Release
cp -pr build/Release/i2c.node %{buildroot}%{nodejs_sitelib}/i2c/build/Release
chmod 0755 %{buildroot}%{nodejs_sitelib}/i2c/build/Release/i2c.node

%nodejs_symlink_deps

%files
%{nodejs_sitelib}/i2c
%doc README.md LICENSE examples

%changelog
* Sun Apr 20 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.4-9
- fix version of npm(underscore) dependency

* Sun Apr 20 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.4-8
- put nodejs_default_filter before nodejs_find_provides_and_requires

* Sun Apr 20 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.4-7
- fix version of npm(bindings) dependency

* Fri Apr 18 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.4-6
- fix version of npm(underscore) dependency

* Fri Feb 14 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.1.4-5
- rebuild for icu-53 (via v8)

* Sun Jan 19 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.1.4-4
- fix underscore for 1.5.1

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sat Jul 13 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.4-2
- add macro for Provides and Requires

* Wed Jul 10 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.4-1
- update to upstream release 0.1.4
- fix version of coffee-script dependency

* Wed Jun 26 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.1.3-2
- fix permissions on shared object

* Fri Jun 21 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.1.3-1
- initial package