Blob Blame History Raw
%global enable_tests 0

Name:       nodejs-express
Version:    3.1.0
Release:    3%{?dist}
Summary:    Sinatra inspired web development framework for Node.js
License:    MIT
Group:      System Environment/Libraries
URL:        https://github.com/visionmedia/express
Source0:    http://registry.npmjs.org/express/-/express-%{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
Source10:   dl-tests.sh
# Pull request sent upstream:
# https://github.com/visionmedia/express/pull/1545
Source20:   express.1
BuildArch:  noarch

BuildRequires:  nodejs-devel

%if 0%{?enable_tests}
BuildRequires:  npm(buffer-crc32)
BuildRequires:  npm(connect)
BuildRequires:  npm(cookie)
BuildRequires:  npm(cookie-signature)
BuildRequires:  npm(debug)
BuildRequires:  npm(fresh)
BuildRequires:  npm(jade)
BuildRequires:  npm(methods)
BuildRequires:  npm(mocha)
BuildRequires:  npm(range-parser)
BuildRequires:  npm(send)
BuildRequires:  npm(should)
BuildRequires:  npm(supertest)
%endif

%description
This Node.js module is a fast, unopinionated, minimalist web development
framework inspired by Sinatra.

The Express philosophy is to provide small, robust tooling for HTTP servers.
Making it a great solution for single page applications, web sites, hybrids,
or public HTTP APIs.

Built on Connect you can use only what you need, and nothing more,
applications can be as big or as small as you like, even a single file.
Express does not force you to use any specific ORM or template engine. With
support for over 14 template engines via Consolidate.js you can quickly craft
your perfect framework.


%prep
%setup -q -n package
%setup -q -T -D -a 1 -n package
%nodejs_fixdep commander '1.1.x'
%nodejs_fixdep connect '~2.7.2'
%nodejs_fixdep mkdirp '0.3.x'
%nodejs_fixdep buffer-crc32 '~0.1'


%build
#nothing to do


%install
mkdir -p %{buildroot}%{nodejs_sitelib}/express
cp -pr package.json client.js index.js lib/ \
    %{buildroot}%{nodejs_sitelib}/express
mkdir -p %{buildroot}%{nodejs_sitelib}/express/bin
install -p -D -m0755 bin/express \
    %{buildroot}%{nodejs_sitelib}/express/bin/express
mkdir -p %{buildroot}%{_bindir}
ln -s %{nodejs_sitelib}/express/bin/express %{buildroot}%{_bindir}/express

mkdir -p %{buildroot}%{_mandir}/man1
install -p -D -m0644 %{SOURCE20} %{buildroot}%{_mandir}/man1/express.1

%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
cp -pr %{nodejs_sitelib} .
rm -f test.js
NODE_ENV=test %{nodejs_sitelib}/mocha/bin/mocha --reporter dot
NODE_ENV=test %{nodejs_sitelib}/mocha/bin/mocha --reporter dot --bail \
    test/acceptance/*.js
%endif


%files
%doc History.md LICENSE Readme.md
%{nodejs_sitelib}/express
%{_bindir}/express
%{_mandir}/man1/express.1*


%changelog
* Sat Mar 16 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.1.0-3
- add a custom man page

* Wed Feb 20 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.1.0-2
- fix version of npm(connect) dependency

* Wed Feb 20 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.1.0-1
- update to upstream release 3.1.0

* Wed Feb 13 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.6-2
- make use of %%nodejs_fixdep

* Mon Feb 11 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.6-1
- initial package