Skip to content

Commit

Permalink
Feature/deb package (#1)
Browse files Browse the repository at this point in the history
* files to build .deb package
  • Loading branch information
wardviaene authored Mar 16, 2018
1 parent 810adf5 commit 1ec6634
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DESTDIR=dist

install:
mkdir -p $(DESTDIR)/opt/node-demo-app
npm install
cp -r node_modules/ *.js *.json $(DESTDIR)/opt/node-demo-app
mkdir -p $(DESTDIR)/lib/systemd/system/
cp init/node-demo-app.service $(DESTDIR)/lib/systemd/system/node-demo-app.service

clean:
rm -rf node_modules/
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node-demo-app (0.0.1) unstable; urgency=medium

* Initial release

-- Edward Viaene <[email protected]> Mon, 22 Mar 2010 00:37:31 +0100

1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
11 changes: 11 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Source: node-demo-app
Section: unknown
Priority: optional
Maintainer: Edward Viaene <[email protected]>
Standards-Version: 0.0.1

Package: node-demo-app
Architecture: any
Depends: nodejs
Description: node demo application
node demo application that prints hello world
3 changes: 3 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
systemctl enable node-demo-app
systemctl start node-demo-app
21 changes: 21 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

# main packaging script based on dh7 syntax
%:
dh $@
12 changes: 12 additions & 0 deletions init/node-demo-app.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=node demo app
After=network.target

[Service]
Type=simple
User=daemon
ExecStart=/usr/bin/node /opt/node-demo-app/index.js
Restart=on-failure

[Install]
WantedBy=multi-user.target

0 comments on commit 1ec6634

Please sign in to comment.