-
Notifications
You must be signed in to change notification settings - Fork 4
/
package.js
59 lines (51 loc) · 1.49 KB
/
package.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Package.describe({
name: 'numtel:pg-server',
version: '1.0.1',
summary: 'Run PostgreSQL server inside your Meteor app',
git: 'https://github.com/numtel/meteor-pg-server',
documentation: 'README.md'
});
function determinePlatformNpmPackage() {
switch(process.platform + '_' + process.arch) {
case 'linux_x64': return 'pg-server-9.4-linux-x64';
case 'linux_ia32': return 'pg-server-9.4-linux-i386';
case 'darwin_x64': return 'pg-server-9.4-osx-x64';
default: return null;
}
}
// Force Meteor to recognize that this package has binary deps
// bcrypt is an npm package that
// has different binaries for differnet architectures.
Npm.depends({
bcrypt: '0.8.2'
});
var npmPkg = determinePlatformNpmPackage();
if(npmPkg === null) {
console.error('ERROR: Platform is not supported by numtel:pg-server!');
console.error(' Supports only Linux (32 and 64 bit) and OSX (64 bit)');
} else {
var depend = {
// For initialization queries
'pg': '4.4.1'
};
// platform dependent pg-server-xxx package
depend[npmPkg] = '9.4.4';
Package.registerBuildPlugin({
name: 'pgServer',
use: [ '[email protected]' ],
sources: [
'plugin/pgServer.js'
],
npmDependencies: depend
});
}
Package.onUse(function(api) {
api.versionsFrom('1.1.0.2');
});
Package.onTest(function(api) {
api.use('tinytest');
api.use('numtel:pg-server');
api.use('numtel:[email protected]');
api.addFiles('test.pg.json', 'server');
api.addFiles('pg-server-tests.js', 'server');
});