%global shortname tern Name: nodejs-%{shortname} Version: 0.7.0 Release: 3%{?dist} Summary: JavaScript code analyzer for deep, cross-editor language support License: MIT URL: http://ternjs.net/ Source0: http://registry.npmjs.org/%{shortname}/-/%{shortname}-%{version}.tgz Source1: %{shortname}-init.el BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: npm(acorn) BuildRequires: emacs Requires: emacs-filesystem >= %{_emacs_version} %description Tern is a stand-alone, editor-independent JavaScript analyzer that can be used to improve the JavaScript integration of existing editors. %prep %setup -qn package %nodejs_fixdep glob %nodejs_fixdep minimatch %build #nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{shortname}/bin/ cp -pr package.json bin/ lib/ plugin/ %{buildroot}%{nodejs_sitelib}/%{shortname} cp -pr bin/condense bin/from_ts bin/tern %{buildroot}%{nodejs_sitelib}/%{shortname}/bin/ # Don't install this zero-length file rm %{buildroot}%{nodejs_sitelib}/%{shortname}/lib/jsdoc.js # Don't install this test file rm %{buildroot}%{nodejs_sitelib}/%{shortname}/bin/test # Install & symlink files from defs in _datadir mkdir -p %{buildroot}%{_datadir}/%{name} cp -pr defs/* %{buildroot}%{_datadir}/%{name} pushd %{buildroot}%{nodejs_sitelib}/%{shortname}/ ln -s %{_datadir}/%{name}/ defs popd # Symlink tern executable file to _bindir mkdir -p %{buildroot}%{_bindir} pushd %{buildroot}%{_bindir} ln -s %{nodejs_sitelib}/%{shortname}/bin/%{shortname} popd # Install emacs files mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{shortname} cp -pr emacs/* %{buildroot}%{_emacs_sitelispdir}/%{shortname} mkdir %{buildroot}%{_emacs_sitestartdir} cp -pr %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}/ %nodejs_symlink_deps %check %nodejs_symlink_deps --check sh -c './bin/test' %files %{nodejs_sitelib}/%{shortname} %{_datadir}/%{name} %{_bindir}/%{shortname} %{_emacs_sitelispdir}/%{shortname} %{_emacs_sitestartdir}/%{shortname}-init.el %doc LICENSE README.md doc/ index.html %changelog * Mon Nov 24 2014 Gerard Ryan - 0.7.0-3 - Install & symlink files from defs in _datadir - Symlink tern executable file to _bindir - Install emacs files * Sun Nov 23 2014 Gerard Ryan - 0.7.0-2 - Add BR on npm(acorn) for tests * Sat Nov 22 2014 Gerard Ryan - 0.7.0-1 - Initial package