Commit 0899a441 authored by Kevin Meziere's avatar Kevin Meziere

Update ubuntu packaging

parent 8a2c7444
......@@ -18,6 +18,7 @@ rel/dalmatinerfe
rel/pkg/*.tgz
rel/pkg/build-info
rel/pkg/packlist
rel/deb/*.deb
.eqc-info
*.eqc
apps/dalmatiner_frontend/include/dalmatiner_frontend_version.hrl
......
......@@ -33,3 +33,6 @@ deb-prepare:
$(REBAR) as deb compile
$(REBAR) as deb release
make -C rel/deb prepare
deb-package: deb-prepare
make -C rel/deb package
......@@ -16,8 +16,7 @@
{jsone, "~>1.2.3"},
fifo_utils,
{msgpack, "0.3.5"},
{dproto, ".*", {git, "https://github.com/dalmatinerdb/dproto.git", {branch, "master"}}},
{ddb_client, ".*", {git, "https://github.com/dalmatinerdb/ddb_client.git", {branch, "master"}}},
%%{dqe, "~>0.5.0"},
{dqe, ".*", {git, "https://github.com/dalmatinerdb/dqe.git", {branch, "master"}}},
eper,
recon
......@@ -63,7 +62,7 @@
{profiles,
[{prod, [{relx, [{dev_mode, false}]}]},
{shell, [{deps, [sync]}]},
{deb, [{relx, [{dev_mode, false}]}]},
{deb, [{relx, [{dev_mode, false}, {overlay_vars, "rel/vars/deb.config"}]}]},
{lint,
[{plugins,
[rebar3_lint]}]},
......
VERSION = $(BUILD_NUMBER) # THis does not seem to work at the moment
VERSION ?= 0
COMPONENT = ddb
COMPONENT = dfe
.PHONY: prepare package
prepare:
mkdir -p stage/etc
mkdir -p stage/data/dalmatinerfe
mkdir -p stage/etc/systemd/system
mkdir -p stage/usr/bin
mkdir -p stage/usr/lib/dfe
mkdir -p stage/var/lib/dfe
mkdir -p stage/var/log/dfe
mkdir -p stage/DEBIAN
cp -r ../../_build/deb/rel/dalmatinerfe/bin stage/usr/lib/dfe/
cp -r ../../_build/deb/rel/dalmatinerfe/etc stage/etc/dfe
cp -r ../../_build/deb/rel/dalmatinerfe/etc stage/data/dalmatinerfe/etc/
cp -r ../../_build/deb/rel/dalmatinerfe/erts-* stage/usr/lib/dfe/
cp -r ../../_build/deb/rel/dalmatinerfe/lib stage/usr/lib/dfe/
cp -r ../../_build/deb/rel/dalmatinerfe/releases stage/usr/lib/dfe/
cp -r ../../_build/deb/rel/dalmatinerfe/share stage/usr/lib/dfe/
wget https://raw.githubusercontent.com/dalmatinerdb/dqe_idx_pg/master/priv/schema.sql -P stage/var/lib/dfe
cp -r systemd/dfe.service stage/etc/systemd/system/dfe.service
cp -r systemd/dalmatinerfe.service stage/etc/systemd/system/dalmatinerfe.service
cp control stage/DEBIAN/
cp preinst stage/DEBIAN/
cp postinst stage/DEBIAN/
chmod 555 stage/DEBIAN/preinst
chmod 555 stage/DEBIAN/postinst
package:
dpkg-deb --build stage
clean:
rm -rf ./stage
......
Package: dalmatinerfe
Version: 0.3.2
Section: base
Priority: optional
Architecture: amd64
Maintainer: Project-Fifo <info@project-fifo.net>
Description: DalmatinerFE
Distributed TSBD. Woof.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: dalmatiner-frontend
File: *
Copyright: 2014 Heinz N. Gies
License: MIT
Files: debian/*
Copyright: 2016 Heinz N. Gies <heinz@licenser.net>
License: MIT
License: MIT
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.
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
#!/bin/bash
if [ ! -d "/data/dalmatinerfe" ]; then
mkdir -p /data/dalmatinerfe
fi
if [ ! -d "/data/dalmatinerfe/log" ]; then
mkdir -p /data/dalmatinerfe/log
fi
# Sort out file permissions
if [[ $(id dalmatiner 2>/dev/null) ]] ;then
chown -R dalmatiner:dalmatiner /var/lib/dfe
chown -R dalmatiner:dalmatiner /var/log/dfe
if [[ $(id dalmatinerfe 2>/dev/null) ]] ;then
chown -R dalmatinerfe:dalmatinerfe /data/dalmatinerfe
fi
CONFFILE=/etc/dfe/dalmatinerfe.conf
CONFFILE=/data/dalmatinerfe/etc/dalmatinerfe.conf
cp ${CONFFILE}.example ${CONFFILE}
sed -i -e "s/dqe_idx_ddb/dqe_idx_pg/g" ${CONFFILE}
if [ ! -f "${CONFFILE}" ]
then
echo "Creating new configuration from example file."
cp ${CONFFILE}.example ${CONFFILE}
else
echo "Please update your configuration according to the update manual!"
fi
......@@ -2,7 +2,7 @@
# create a system user for the process, modern useradd will add the default group too
# Assume DDB home dir as default location
if [[ ! $(id dalmatiner 2>/dev/null) ]] ;then
if [[ ! $(id dalmatinerfe 2>/dev/null) ]] ;then
# create a dalmatiner system account
/usr/sbin/useradd --system --create-home --home-dir /var/lib/dfe -s /bin/bash dalmatiner
/usr/sbin/useradd --system --create-home --home-dir /data/dalmatinerfe -s /bin/bash dalmatinerfe
fi
[Unit]
Description=DalmatinerDB Frontend
Description=DalmatinerFE Frontend
After=network.target
[Service]
User=dalmatiner
User=dalmatinerfe
Group=dalmatinerfe
ExecStart=/usr/lib/dfe/bin/dalmatinerfe console -noinput +Bd
[Install]
......
%%
%% etc/app.config
%%
{log_path, "/var/log/dfe"}.
{db_path, "/var/lib/dfe"}.
%%
%% etc/vm.args
%%
{run_user, "dalmatiner"}.
{run_user_home, "/var/lib/dfe"}.
{crash_dump, "/var/log/dfe"}.
{platform_etc_dir, "/etc/dfe"}.
{platform_bin_dir, "./bin"}.
{platform_data_dir, "/var/lib/dfe"}.
{platform_lib_dir, "/usr/lib/dfe/lib"}.
{platform_log_dir, "/var/log/dfe"}.
{run_user, "dalmatinerfe"}.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment