[Pkg-javascript-commits] [node-mime-db] 02/08: first commit debian files
Leo Iannacone
l3on-guest at moszumanska.debian.org
Mon Sep 15 08:17:24 UTC 2014
This is an automated email from the git hooks/post-receive script.
l3on-guest pushed a commit to branch master
in repository node-mime-db.
commit 7f5e7ee50ab1094ff9b4c23c9d70414de9142350
Author: Leo Iannacone <l3on at ubuntu.com>
Date: Mon Sep 15 09:54:42 2014 +0200
first commit debian files
---
debian/changelog | 6 ++
debian/compat | 1 +
debian/control | 28 ++++++++
debian/copyright | 36 ++++++++++
debian/docs | 1 +
debian/install | 3 +
debian/patches/0001-use-system-mime-types.patch | 89 +++++++++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 16 +++++
debian/source/format | 1 +
debian/tests/control | 2 +
debian/tests/require | 3 +
debian/watch | 5 ++
13 files changed, 192 insertions(+)
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..3a6bab1
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,6 @@
+node-mime-db (1.0.1-1) UNRELEASED; urgency=low
+
+ * Initial release (Closes: #nnnn)
+
+ -- Leo Iannacone <l3on at ubuntu.com> Sat, 13 Sep 2014 16:16:53 +0200
+
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..3567bc7
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,28 @@
+Source: node-mime-db
+Section: web
+Priority: extra
+Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
+Uploaders: Leo Iannacone <l3on at ubuntu.com>
+Build-Depends:
+ debhelper (>= 8)
+ , dh-buildinfo
+ , nodejs
+ , mime-common
+ , node-mime
+ , mocha
+Standards-Version: 3.9.5
+Homepage: https://github.com/jshttp/mime-db
+Vcs-Git: git://anonscm.debian.org/pkg-javascript/node-mime-db.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-javascript/node-mime-db.git
+XS-Testsuite: autopkgtest
+
+Package: node-mime-db
+Architecture: all
+Depends:
+ ${misc:Depends}
+ , nodejs
+Description: mime types database for Node.js
+ This module provides a single JSON file which aggregates all the
+ mime-types available on the system.
+ .
+ Node.js is an event-based server-side JavaScript engine.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..edf4366
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,36 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: mime-db
+Upstream-Contact: https://github.com/jshttp/mime-db/issues
+Source: https://github.com/jshttp/mime-db
+ Repackaged, excluding pre-compiled JSON files
+Files-Excluded: db.json src/*.json
+
+Files: *
+Copyright: 2014 Jonathan Ong <me at jongleberry.com>
+License: Expat
+
+Files: debian/*
+Copyright: 2014 Leo Iannacone <l3on at ubuntu.com>
+License: Expat
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..b43bf86
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README.md
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..4f35c66
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,3 @@
+package.json usr/lib/nodejs/mime-db/
+index.js usr/lib/nodejs/mime-db/
+db.json usr/lib/nodejs/mime-db/
diff --git a/debian/patches/0001-use-system-mime-types.patch b/debian/patches/0001-use-system-mime-types.patch
new file mode 100644
index 0000000..ea4030c
--- /dev/null
+++ b/debian/patches/0001-use-system-mime-types.patch
@@ -0,0 +1,89 @@
+Description: use system's mime-types instead of taking
+ them from Internet.
+Author: Leo Iannacone <l3on at ubuntu.com>
+Forwarded: not-needed
+
+---
+ scripts/build.js | 31 +------------------------------
+ scripts/extensions.js | 20 ++++----------------
+ 2 files changed, 5 insertions(+), 46 deletions(-)
+
+--- a/scripts/build.js
++++ b/scripts/build.js
+@@ -1,41 +1,12 @@
+
+ var db = {}
+
+-// initialize with all the IANA types
+-require('../src/iana.json').forEach(function (mime) {
+- // i don't think the name is useful,
+- // and i don't think we need to bother with the "Reference"
+- // just look at the site yourself!
+-
+- var name = mime[0]
+- var template = mime[1]
+- // for some reason, references are split into multiple values...
+- var type = mime[mime.length - 1]
+-
+- if (!template) {
+- // some types don't have a template, so we guess it
+- console.log('guessing: %s/%s', type, name)
+- template = type + '/' + name
+- }
+-
+- if (!~template.indexOf('/')) {
+- // i don't know what templates exactly are,
+- // but some aren't valid mime types.
+- console.log('prefixing: %s/%s', type, template)
+- template = type + '/' + template
+- }
+-
+- db[template.toLowerCase()] = {
+- source: 'iana'
+- }
+-})
+-
+ // add the mime extensions from Apache
+ var mime = require('../src/mime.json')
+ Object.keys(mime).forEach(function (type) {
+ var e = mime[type]
+ var t = type.toLowerCase()
+- var o = db[t] = db[t] || {source: 'apache'}
++ var o = db[t] = db[t] || {source: 'mime-support'}
+ if (e.length) o.extensions = (o.extensions || []).concat(e)
+ })
+
+--- a/scripts/extensions.js
++++ b/scripts/extensions.js
+@@ -3,27 +3,15 @@
+ * Convert these text files to JSON for browser usage.
+ */
+
+-var co = require('co')
+ var fs = require('fs')
+ var path = require('path')
+-var cogent = require('cogent')
+
+-co(function* () {
+- yield [
+- get('http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types'),
+- get('https://raw.githubusercontent.com/broofa/node-mime/master/types/node.types')
+- ]
+-})()
++get('/etc/mime.types');
++get('/usr/share/node-mime/node.types');
+
+-function* get(url) {
+- var res = yield* cogent(url, {
+- string: true
+- })
++function get(url) {
+
+- if (res.statusCode !== 200)
+- throw new Error('got status code ' + res.statusCode + ' from ' + url)
+-
+- var text = res.text
++ var text = fs.readFileSync(url, 'utf8')
+ var json = {}
+ // http://en.wikipedia.org/wiki/Internet_media_type#Naming
+ /**
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8788b82
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-use-system-mime-types.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..d793d20
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,16 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
+
+override_dh_auto_build:
+ nodejs scripts/extensions
+ nodejs scripts/types
+ nodejs scripts/build
+
+override_dh_auto_test:
+ mocha -C --reporter spec --bail --check-leaks test/
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..4e36985
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: require
+Depends: node-mime-db
diff --git a/debian/tests/require b/debian/tests/require
new file mode 100644
index 0000000..520130e
--- /dev/null
+++ b/debian/tests/require
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+nodejs -e "require('mime-db');"
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..60fac81
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=3
+opts=\
+dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\
+filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-mime-db-$1.tar.gz/ \
+ https://github.com/jshttp/mime-db/tags .*/archive/v?([\d\.]+).tar.gz
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mime-db.git
More information about the Pkg-javascript-commits
mailing list