[nodejs-mbtiles] Initial import

Tom Hughes tomh at fedoraproject.org
Thu Mar 21 10:27:54 UTC 2013


commit 112dce1b48d61ff54ed9944e5640ea5b2c0effb6
Author: Tom Hughes <tom at compton.nu>
Date:   Thu Mar 21 10:27:44 2013 +0000

    Initial import

 .gitignore                      |    1 +
 nodejs-mbtiles-manpages.patch   |  339 +++++++++++++++++++++++++++++++++++++++
 nodejs-mbtiles-underscore.patch |   19 +++
 nodejs-mbtiles-unlink.patch     |   48 ++++++
 nodejs-mbtiles.spec             |   83 ++++++++++
 sources                         |    1 +
 6 files changed, 491 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..bbe8d79 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/mbtiles-0.2.8.tgz
diff --git a/nodejs-mbtiles-manpages.patch b/nodejs-mbtiles-manpages.patch
new file mode 100644
index 0000000..c6f654b
--- /dev/null
+++ b/nodejs-mbtiles-manpages.patch
@@ -0,0 +1,339 @@
+commit 5ee5335f0ade3caad2e7fb17280f15b809b0d428
+Author: Tom Hughes <tom at compton.nu>
+Date:   Wed Mar 20 20:31:28 2013 +0000
+
+    Add manual pages for commands
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..ba6d9a5
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,4 @@
++all: man/mbcheck.1 man/mbcompact.1 man/mbpipe.1 man/mbrekey.1
++
++man/%.1: ronn/%.md
++	ronn --roff $< > $@
+diff --git a/man/mbcheck.1 b/man/mbcheck.1
+new file mode 100644
+index 0000000..5d44dea
+--- /dev/null
++++ b/man/mbcheck.1
+@@ -0,0 +1,30 @@
++.\" Generated with Ronnjs 0.3.8
++.\" http://github.com/kapouer/ronnjs/
++.
++.TH "MBCHECK" "1" "March 2013" "" ""
++.
++.SH "NAME"
++\fBmbcheck\fR \-\- Check an mbtiles for missing metadata and tiles
++.
++.SH "SYNOPSIS"
++\fBmbcheck\fR <file>
++.
++.SH "DESCRIPTION"
++The mbcheck(1) command checks an mbtiles archive for missing
++metadata and tiles\.
++.
++.SH "OPTIONS"
++\fB\-\-help\fR display this help and exit
++.
++.SH "EXAMPLES"
++mbcheck world\.mbtiles
++.
++.SH "AUTHOR"
++Written by MapBox\.
++.
++.SH "REPORTING BUGS"
++Please report bugs on the GitHub issue tracker:
++<\fBhttps://github\.com/mapbox/node\-mbtiles/issues\fR>
++.
++.SH "SEE ALSO"
++mbcompact(1), mbpipe(1), mbrekey(1)
+diff --git a/man/mbcompact.1 b/man/mbcompact.1
+new file mode 100644
+index 0000000..1c5af97
+--- /dev/null
++++ b/man/mbcompact.1
+@@ -0,0 +1,30 @@
++.\" Generated with Ronnjs 0.3.8
++.\" http://github.com/kapouer/ronnjs/
++.
++.TH "MBCOMPACT" "1" "March 2013" "" ""
++.
++.SH "NAME"
++\fBmbcompact\fR \-\- Eliminate duplicate images to reduce mbtiles file size
++.
++.SH "SYNOPSIS"
++\fBmbcompact\fR <file>
++.
++.SH "DESCRIPTION"
++The mbcompact(1) command eliminates duplicate images to reduce
++the size of an mbtiles archive\.
++.
++.SH "OPTIONS"
++\fB\-\-help\fR display this help and exit
++.
++.SH "EXAMPLES"
++mbcompact world\.mbtiles
++.
++.SH "AUTHOR"
++Written by MapBox\.
++.
++.SH "REPORTING BUGS"
++Please report bugs on the GitHub issue tracker:
++<\fBhttps://github\.com/mapbox/node\-mbtiles/issues\fR>
++.
++.SH "SEE ALSO"
++mbcheck(1), mbpipe(1), mbrekey(1)
+diff --git a/man/mbpipe.1 b/man/mbpipe.1
+new file mode 100644
+index 0000000..aa2df22
+--- /dev/null
++++ b/man/mbpipe.1
+@@ -0,0 +1,30 @@
++.\" Generated with Ronnjs 0.3.8
++.\" http://github.com/kapouer/ronnjs/
++.
++.TH "MBPIPE" "1" "March 2013" "" ""
++.
++.SH "NAME"
++\fBmbpipe\fR \-\- Pipe each tile in an mbtiles to a command
++.
++.SH "SYNOPSIS"
++\fBmbpipe\fR <command> <file>
++.
++.SH "DESCRIPTION"
++The mbpipe(1) command pipes each tile in an mbtiles archive to
++the specified command and write stdout back into the archive\.
++.
++.SH "OPTIONS"
++\fB\-\-help\fR display this help and exit
++.
++.SH "EXAMPLES"
++mbpipe "pngquant 32" world\.mbtiles
++.
++.SH "AUTHOR"
++Written by MapBox\.
++.
++.SH "REPORTING BUGS"
++Please report bugs on the GitHub issue tracker:
++<\fBhttps://github\.com/mapbox/node\-mbtiles/issues\fR>
++.
++.SH "SEE ALSO"
++mbcheck(1), mbcompact(1), mbrekey(1)
+diff --git a/man/mbrekey.1 b/man/mbrekey.1
+new file mode 100644
+index 0000000..65cee3e
+--- /dev/null
++++ b/man/mbrekey.1
+@@ -0,0 +1,30 @@
++.\" Generated with Ronnjs 0.3.8
++.\" http://github.com/kapouer/ronnjs/
++.
++.TH "MBREKEY" "1" "March 2013" "" ""
++.
++.SH "NAME"
++\fBmbrekey\fR \-\- Rekey a compacted mbtiles to save space
++.
++.SH "SYNOPSIS"
++\fBmbrekey\fR <file>
++.
++.SH "DESCRIPTION"
++The mbrekey(1) command rekeys a compacted mbtiles archive to
++save space\.
++.
++.SH "OPTIONS"
++\fB\-\-help\fR display this help and exit
++.
++.SH "EXAMPLES"
++mbrekey world\.mbtiles
++.
++.SH "AUTHOR"
++Written by MapBox\.
++.
++.SH "REPORTING BUGS"
++Please report bugs on the GitHub issue tracker:
++<\fBhttps://github\.com/mapbox/node\-mbtiles/issues\fR>
++.
++.SH "SEE ALSO"
++mbcheck(1), mbcompact(1), mbpipe(1)
+diff --git a/package.json b/package.json
+index b481d9c..309ac96 100644
+--- a/package.json
++++ b/package.json
+@@ -17,6 +17,12 @@
+         "mbpipe": "./bin/mbpipe",
+         "mbrekey": "./bin/mbrekey"
+     },
++    "man": [
++        "./man/mbcheck.1",
++        "./man/mbcompact.1",
++        "./man/mbpipe.1",
++        "./man/mbrekey.1"
++    ],
+     "repositories": [{
+         "type": "git",
+         "url": "http://github.com/mapbox/node-mbtiles.git"
+@@ -36,7 +42,8 @@
+         "sphericalmercator": "~1.0.1"
+     },
+     "devDependencies": {
+-        "expresso": "~0.9.0"
++        "expresso": "~0.9.0",
++        "ronn": "*"
+     },
+     "engines": {
+         "node": ">= 0.6.0"
+diff --git a/ronn/mbcheck.md b/ronn/mbcheck.md
+new file mode 100644
+index 0000000..afb4a38
+--- /dev/null
++++ b/ronn/mbcheck.md
+@@ -0,0 +1,32 @@
++mbcheck(1) -- Check an mbtiles for missing metadata and tiles
++=============================================================
++
++## SYNOPSIS
++
++`mbcheck` <file>
++
++## DESCRIPTION
++
++The mbcheck(1) command checks an mbtiles archive for missing
++metadata and tiles.
++
++## OPTIONS
++
++`--help` display this help and exit
++
++## EXAMPLES
++
++mbcheck world.mbtiles
++
++## AUTHOR
++
++Written by MapBox.
++
++## REPORTING BUGS
++
++Please report bugs on the GitHub issue tracker:
++<`https://github.com/mapbox/node-mbtiles/issues`>
++
++## SEE ALSO
++
++mbcompact(1), mbpipe(1), mbrekey(1)
+diff --git a/ronn/mbcompact.md b/ronn/mbcompact.md
+new file mode 100644
+index 0000000..eccd736
+--- /dev/null
++++ b/ronn/mbcompact.md
+@@ -0,0 +1,32 @@
++mbcompact(1) -- Eliminate duplicate images to reduce mbtiles file size
++======================================================================
++
++## SYNOPSIS
++
++`mbcompact` <file>
++
++## DESCRIPTION
++
++The mbcompact(1) command eliminates duplicate images to reduce
++the size of an mbtiles archive.
++
++## OPTIONS
++
++`--help` display this help and exit
++
++## EXAMPLES
++
++mbcompact world.mbtiles
++
++## AUTHOR
++
++Written by MapBox.
++
++## REPORTING BUGS
++
++Please report bugs on the GitHub issue tracker:
++<`https://github.com/mapbox/node-mbtiles/issues`>
++
++## SEE ALSO
++
++mbcheck(1), mbpipe(1), mbrekey(1)
+diff --git a/ronn/mbpipe.md b/ronn/mbpipe.md
+new file mode 100644
+index 0000000..e024ecb
+--- /dev/null
++++ b/ronn/mbpipe.md
+@@ -0,0 +1,32 @@
++mbpipe(1) -- Pipe each tile in an mbtiles to a command
++======================================================
++
++## SYNOPSIS
++
++`mbpipe` <command> <file>
++
++## DESCRIPTION
++
++The mbpipe(1) command pipes each tile in an mbtiles archive to
++the specified command and write stdout back into the archive.
++
++## OPTIONS
++
++`--help` display this help and exit
++
++## EXAMPLES
++
++mbpipe "pngquant 32" world.mbtiles
++
++## AUTHOR
++
++Written by MapBox.
++
++## REPORTING BUGS
++
++Please report bugs on the GitHub issue tracker:
++<`https://github.com/mapbox/node-mbtiles/issues`>
++
++## SEE ALSO
++
++mbcheck(1), mbcompact(1), mbrekey(1)
+diff --git a/ronn/mbrekey.md b/ronn/mbrekey.md
+new file mode 100644
+index 0000000..fffc905
+--- /dev/null
++++ b/ronn/mbrekey.md
+@@ -0,0 +1,32 @@
++mbrekey(1) -- Rekey a compacted mbtiles to save space
++=====================================================
++
++## SYNOPSIS
++
++`mbrekey` <file>
++
++## DESCRIPTION
++
++The mbrekey(1) command rekeys a compacted mbtiles archive to
++save space.
++
++## OPTIONS
++
++`--help` display this help and exit
++
++## EXAMPLES
++
++mbrekey world.mbtiles
++
++## AUTHOR
++
++Written by MapBox.
++
++## REPORTING BUGS
++
++Please report bugs on the GitHub issue tracker:
++<`https://github.com/mapbox/node-mbtiles/issues`>
++
++## SEE ALSO
++
++mbcheck(1), mbcompact(1), mbpipe(1)
diff --git a/nodejs-mbtiles-underscore.patch b/nodejs-mbtiles-underscore.patch
new file mode 100644
index 0000000..d0802bf
--- /dev/null
+++ b/nodejs-mbtiles-underscore.patch
@@ -0,0 +1,19 @@
+commit 9e7fbc2ed7e7b209d8af8cec5b276f0fcd179c0e
+Author: Tom Hughes <tom at compton.nu>
+Date:   Wed Feb 13 00:09:18 2013 +0000
+
+    Update to use v1.4.x of underscore
+
+diff --git a/package.json b/package.json
+index 5a64f69..b481d9c 100644
+--- a/package.json
++++ b/package.json
+@@ -29,7 +29,7 @@
+         "Konstantin Käfer <kkaefer>"
+     ],
+     "dependencies": {
+-        "underscore": "~1.3.3",
++        "underscore": "~1.4.4",
+         "step": "~0.0.5",
+         "optimist": "~0.3.1",
+         "sqlite3": "~2.1.1",
diff --git a/nodejs-mbtiles-unlink.patch b/nodejs-mbtiles-unlink.patch
new file mode 100644
index 0000000..4a6f9c3
--- /dev/null
+++ b/nodejs-mbtiles-unlink.patch
@@ -0,0 +1,48 @@
+commit 3f416c071d4e8cc9025e7840384ee08f6e42c184
+Author: Tom Hughes <tom at compton.nu>
+Date:   Sun Mar 17 11:59:53 2013 +0000
+
+    Use unlinkSync consistently in tests
+    
+    Using unlink means that the exception may be thrown asynchronously
+    and we will then fail to catch it and the test will abort.
+
+diff --git a/test/info.test.js b/test/info.test.js
+index c6467b2..bad884e 100644
+--- a/test/info.test.js
++++ b/test/info.test.js
+@@ -9,7 +9,7 @@ var fixtures = {
+     empty: __dirname + '/fixtures/empty.mbtiles'
+ };
+ 
+-try { fs.unlink(fixtures.empty); } catch (err) {}
++try { fs.unlinkSync(fixtures.empty); } catch (err) {}
+ 
+ 
+ exports['get metadata'] = function(beforeExit, assert) {
+diff --git a/test/list.test.js b/test/list.test.js
+index 845f142..db23e49 100644
+--- a/test/list.test.js
++++ b/test/list.test.js
+@@ -8,7 +8,7 @@ var fixtures = {
+     doesnotexist: __dirname + '/doesnotexist'
+ };
+ 
+-try { fs.unlink(fixtures.doesnotexist); } catch (err) {}
++try { fs.unlinkSync(fixtures.doesnotexist); } catch (err) {}
+ 
+ 
+ exports['list'] = function(beforeExit, assert) {
+diff --git a/test/read.test.js b/test/read.test.js
+index b0f4ac5..1b3bcf9 100644
+--- a/test/read.test.js
++++ b/test/read.test.js
+@@ -13,7 +13,7 @@ var fixtures = {
+     corrupt: __dirname + '/fixtures/corrupt.mbtiles'
+ };
+ 
+-try { fs.unlink(fixtures.non_existent); } catch (err) {}
++try { fs.unlinkSync(fixtures.non_existent); } catch (err) {}
+ 
+ function yieldsError(assert, status, error, msg) {
+     return function(err) {
diff --git a/nodejs-mbtiles.spec b/nodejs-mbtiles.spec
new file mode 100644
index 0000000..54c0c2e
--- /dev/null
+++ b/nodejs-mbtiles.spec
@@ -0,0 +1,83 @@
+%global enable_tests 1
+
+Name:           nodejs-mbtiles
+Version:        0.2.8
+Release:        2%{?dist}
+Summary:        Utilities and tilelive integration for the MBTiles format
+
+License:        BSD
+URL:            https://github.com/mapbox/node-mbtiles
+Source0:        http://registry.npmjs.org/mbtiles/-/mbtiles-%{version}.tgz
+# Offered upstream - https://github.com/mapbox/node-mbtiles/pull/25
+Patch0:         nodejs-mbtiles-underscore.patch
+# Offered upstream - https://github.com/mapbox/node-mbtiles/pull/26
+Patch1:         nodejs-mbtiles-unlink.patch
+# Offered upstream - https://github.com/mapbox/node-mbtiles/pull/27
+Patch2:         nodejs-mbtiles-manpages.patch
+BuildArch:      noarch
+
+BuildRequires:  nodejs-devel
+
+%if 0%{?enable_tests}
+BuildRequires:  npm(expresso)
+BuildRequires:  npm(sphericalmercator)
+BuildRequires:  npm(sqlite3)
+BuildRequires:  npm(step)
+BuildRequires:  npm(underscore)
+%endif
+
+%description
+%summary
+
+
+%prep
+%setup -q -n package
+%patch0 -p1 -b .underscore
+%patch1 -p1 -b .unlink
+%patch2 -p1 -b .manpages
+rm -rf node_modules
+
+
+%build
+
+
+%install
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -pr lib/schema.sql %{buildroot}/%{_datadir}/%{name}
+mkdir -p %{buildroot}/%{nodejs_sitelib}/mbtiles
+cp -pr package.json bin %{buildroot}/%{nodejs_sitelib}/mbtiles
+mkdir -p %{buildroot}/%{nodejs_sitelib}/mbtiles/lib
+cp -pr lib/*.js %{buildroot}/%{nodejs_sitelib}/mbtiles/lib
+ln -s %{_datadir}/%{name}/schema.sql  %{buildroot}/%{nodejs_sitelib}/mbtiles/lib
+mkdir -p %{buildroot}/%{_bindir}
+ln -s %{nodejs_sitelib}/mbtiles/bin/mbcheck %{buildroot}/%{_bindir}
+ln -s %{nodejs_sitelib}/mbtiles/bin/mbcompact %{buildroot}/%{_bindir}
+ln -s %{nodejs_sitelib}/mbtiles/bin/mbpipe %{buildroot}/%{_bindir}
+ln -s %{nodejs_sitelib}/mbtiles/bin/mbrekey %{buildroot}/%{_bindir}
+mkdir -p %{buildroot}/%{_mandir}/man1
+cp -pr man/mb*.1 %{buildroot}/%{_mandir}/man1
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+ln -s %{nodejs_sitelib} .
+%{nodejs_sitelib}/expresso/bin/expresso
+%endif
+
+
+%files
+%doc LICENSE README.md CHANGELOG.md
+%{nodejs_sitelib}/mbtiles
+%{_datadir}/%{name}
+%{_bindir}/mb*
+%{_mandir}/man1/mb*.1.gz
+
+
+%changelog
+* Tue Mar 19 2013 Tom Hughes <tom at compton.nu> - 0.2.8-2
+- Avoid deleting schema.sql in %%install
+- Add manual pages
+
+* Sun Feb 10 2013 Tom Hughes <tom at compton.nu> - 0.2.8-1
+- Initial build of 0.2.8
diff --git a/sources b/sources
index e69de29..9181710 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+56b6a20b1aadb45a4d3bce9d20c2ba7d  mbtiles-0.2.8.tgz


More information about the scm-commits mailing list