OSDN Git Service

debian: add packaging scripts v0.1.0
authorhylom <hylom@users.sourceforge.jp>
Fri, 2 Dec 2016 13:15:42 +0000 (22:15 +0900)
committerhylom <hylom@users.sourceforge.jp>
Fri, 2 Dec 2016 13:15:42 +0000 (22:15 +0900)
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
misc/newslash.service [new file with mode: 0644]

diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..ab6c05d
--- /dev/null
@@ -0,0 +1,5 @@
+newslash (0.1.0) unstable; urgency=low
+
+  * Initial release.
+
+-- Hiromichi MATSUSHIMA <hirom@osdn.jp> Fri, 02 Dec 2016 20:21:08 +0900
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..ad8bde4
--- /dev/null
@@ -0,0 +1,29 @@
+Source: newslash
+Section: web
+Priority: extra
+Maintainer: OSDN Corp. <admin@osdn.jp>
+Build-Depends: debhelper (>= 5), cdbs
+Standards-Version: 3.7.2
+Uploaders: Hiromichi MATSUSHIMA <hirom@osdn.jp>
+
+Package: newslash-core
+Architecture: any
+Depends:
+ libmojolicious-perl, libjs-bootstrap, libdbd-mysql, libdbi-perl, libdbd-mysql-perl, libtemplate-perl, node-less, libcrypt-openssl-random-perl, libemail-valid-perl, tinymce, libredis-perl, libhtml-tidy-perl, liburi-perl, libdate-calc-perl, libdatetime-perl, liburi-perl, libjson-perl, libcache-memcached-fast-perl, libdata-javascript-anon-perl, libwww-perl, ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
+Description: Newslash core files
+  Newsslash is 'news lashing discussion platform'. This package include core files to use Newslash.
+
+Package: newslash-sradjp-assets
+Architecture: any
+Depends:
+ newslash-core
+Description: Newslash asset files for srad.jp
+  Newsslash is 'news lashing discussion platform'. This package include assets for srad.jp like images, js, css, templates, etc.
+
+Package: newslash-sradjp
+Architecture: any
+Depends:
+ newslash-core, newslash-sradjp-assets
+Description: Newslash config files for srad.jp
+  Newsslash is 'news lashing discussion platform'. This package include configuration files for srad.jp.
+
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..2445d34
--- /dev/null
@@ -0,0 +1,2 @@
+License: GPL2
+In Debian, see /usr/share/common-licenses/GPL2 for details
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..f7830e2
--- /dev/null
@@ -0,0 +1,57 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+
+CORE=newslash-core
+ASSETS=newslash-sradjp-assets
+SRAD=newslash-sradjp
+
+SRCDIR=src/newslash_web
+CORE_DEST=$(CURDIR)/debian/$(CORE)/usr/share/newslash
+ASSETS_DEST=$(CURDIR)/debian/$(ASSETS)/usr/share/newslash
+SRAD_DEST=$(CURDIR)/debian/$(SRAD)/usr/share/newslash
+
+install/$(CORE)::
+       cd $(SRCDIR); \
+       find ./lib -name '*.pm' \
+         -exec install -pDm 644 {} $(CORE_DEST)/{} \;
+       cd $(SRCDIR); \
+       find ./external/perllib -name '*.pm' \
+         -exec install -pDm 644 {} $(CORE_DEST)/{} \;
+       install -pDm 755 $(SRCDIR)/script/newslash_web $(CORE_DEST)/script/newslash_web
+
+
+install/$(ASSETS)::
+       cd $(SRCDIR); \
+       find ./templates -name '*.tt2' \
+         -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
+       cd $(SRCDIR); \
+       find ./css ! -name '*~' ! -type l \
+         -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
+       ln -sf ../external/bootstrap-3.3.7/less $(ASSETS_DEST)/css/bootstrap
+       cd $(SRCDIR); \
+       find ./public/img ! -name '*~' ! -type l \
+         -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
+       cd $(SRCDIR); \
+       find ./public/jquery ! -name '*~' ! -type l \
+         -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
+       cd $(SRCDIR); \
+       find ./public/js ! -name '*~' ! -type l \
+         -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
+       cd $(SRCDIR); \
+       find ./public/vue ! -name '*~' ! -type l \
+         -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
+       cd $(SRCDIR); \
+       find ./external/bootstrap-3.3.7 ! -name '*~' ! -type l \
+         -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
+       ln -sf ../../external/escape-html.js/js/escape-html.js $(ASSETS_DEST)/public/js/escape-html.js
+       ln -sf ../external/bootstrap-3.3.7/dist $(ASSETS_DEST)/public/bootstrap
+       ln -sf ../external/bootstrap-3.3.7/fonts $(ASSETS_DEST)/public/fonts
+       install -pDm 644 $(SRCDIR)/external/escape-html.js/js/escape-html.js $(ASSETS_DEST)/external/escape-html.js/js/escape-html.js
+       mkdir $(ASSETS_DEST)/public/css
+
+install/$(SRAD)::
+       install -pDm 644 misc/newslash.service $(CURDIR)/debian/$(SRAD)/lib/systemd/system/newslash.service
+       install -pDm 644 $(SRCDIR)/newslash-web.production.json $(SRAD_DEST)/newslash-web.production.json
+
+# todo: restart systemd, add PIDFile dir
diff --git a/misc/newslash.service b/misc/newslash.service
new file mode 100644 (file)
index 0000000..1cb232d
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Newslash slashing discussion system
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/newslash/newslash.pid
+ExecStart=/usr/bin/hypnotoad /usr/share/newslash/script/newslash_web -m production
+ExecReload=/usr/bin/hypnotoad /usr/share/newslash/script/newslash_web -m production
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target