%{?nodejs_find_provides_and_requires} %global packagename grunt-typescript # Tests disabled because the 0.8.0 release isn't tagged in githubt, and the # gruntfile from master tries to run tests that don't exist in 0.8.0 %global enable_tests 0 Name: nodejs-grunt-typescript Version: 0.8.0 Release: 1%{?dist} Summary: Compile typescript to JavaScript License: MIT URL: https://github.com/k-maru/grunt-typescript Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # The test files are not included in the npm tarball. # Source1 is generated by running Source10, which pulls from the upstream # version control repository. Source1: tests-%{version}.tar.bz2 Source2: src-%{version}.tar.bz2 Source3: typings-%{version}.tar.bz2 Source10: dl-tests.sh # Gruntfile Source11: https://raw.githubusercontent.com/k-maru/grunt-typescript/master/Gruntfile.js BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging BuildRequires: npm(grunt-cli) %if 0%{?enable_tests} #BuildRequires: %endif %description Compile typescript to JavaScript. %prep %setup -q -n package # setup the tests, src, typings %setup -q -T -D -a 1 -n package %setup -q -T -D -a 2 -n package %setup -q -T -D -a 3 -n package # Gruntfile cp -p %{SOURCE11} . %build # building from source fails, with lots of "TS2300: Duplicate identifier" errors #%%nodejs_symlink_deps --check #grunt build #rm -rf ./node_modules/ %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json tasks/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} grunt test %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Thu Feb 25 2016 Jared Smith - 0.8.0-1 - Initial packaging