diff options
author | Txus <me@txus.io> | 2016-04-13 14:41:42 +0200 |
---|---|---|
committer | Txus <me@txus.io> | 2016-04-13 16:29:10 +0200 |
commit | 724a5bce5052a96e1f2714fadfea2eda92e3670e (patch) | |
tree | 2807d0e0482f579d2143b8344d2a51a3100957cb | |
parent | 4d0018695806fd535bd2ec174b9d88cd164e669a (diff) | |
download | rvi_sota_client-724a5bce5052a96e1f2714fadfea2eda92e3670e.tar.gz |
Build DEB and RPM packages with configurable version
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | pkg/Dockerfile | 2 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/changelog | 5 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/compat | 1 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/control | 12 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/copyright | 0 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.dirs | 2 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.install | 2 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.service | 10 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/rules | 3 | ||||
-rw-r--r-- | pkg/deb/ota-plus-client-0.1.0/debian/source/format | 1 | ||||
-rw-r--r-- | pkg/ota-client.service (renamed from pkg/rpm/ota-client.service) | 0 | ||||
-rwxr-xr-x | pkg/pkg.sh | 25 |
13 files changed, 12 insertions, 55 deletions
@@ -6,9 +6,7 @@ all: ota_plus_client .PHONY: ota_plus_client ota_plus_client: src/ cargo build --release --target=$(MUSL) - mkdir -p pkg/deb/ota-plus-client-0.1.0/bin - cp target/$(MUSL)/release/ota_plus_client pkg/deb/ota-plus-client-0.1.0/bin/ - cp target/$(MUSL)/release/ota_plus_client pkg/rpm/ + cp target/$(MUSL)/release/ota_plus_client pkg/ .PHONY: deb deb: ota_plus_client diff --git a/pkg/Dockerfile b/pkg/Dockerfile index 88a5d84..eccbe0b 100644 --- a/pkg/Dockerfile +++ b/pkg/Dockerfile @@ -1,7 +1,7 @@ FROM clux/muslrust # for statically linking binaries; see https://github.com/clux/muslrust -ENV FPM_VER 1.4.0 +ENV FPM_VER 1.5.0 RUN apt-get update \ && apt-get install -y \ diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/changelog b/pkg/deb/ota-plus-client-0.1.0/debian/changelog deleted file mode 100644 index ce20224..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -ota-plus-client (0.1.0-1) unstable; urgency=medium - - * Initial release. - - -- Jerry <jerry@advancedtelematic.com> Wed, 26 Feb 2016 17:33:03 +0200 diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/compat b/pkg/deb/ota-plus-client-0.1.0/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/control b/pkg/deb/ota-plus-client-0.1.0/debian/control deleted file mode 100644 index ec8d1e7..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/control +++ /dev/null @@ -1,12 +0,0 @@ -Source: ota-plus-client -Maintainer: Jerry Trieu <jerry@advancedtelematic.com> -Section: misc -Priority: optional -Standards-Version: 3.9.2 -Build-Depends: debhelper (>= 9), dh-systemd - -Package: ota-plus-client -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: ATS OTA+ Client SDK - ATS OTA+ Client SDK for a vehicle or device diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/copyright b/pkg/deb/ota-plus-client-0.1.0/debian/copyright deleted file mode 100644 index e69de29..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/copyright +++ /dev/null diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.dirs b/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.dirs deleted file mode 100644 index f7048c8..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.dirs +++ /dev/null @@ -1,2 +0,0 @@ -opt/ats/ota/bin -opt/ats/ota/etc diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.install b/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.install deleted file mode 100644 index 1fe11f2..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.install +++ /dev/null @@ -1,2 +0,0 @@ -bin/* opt/ats/ota/bin -etc/* opt/ats/ota/etc diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.service b/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.service deleted file mode 100644 index 22cda1d..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/ota-plus-client.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=OTA+ Client -After=network.target - -[Service] -Type=simple -ExecStart=/opt/ats/ota/bin/ota_plus_client --config /opt/ats/ota/etc/ota.toml - -[Install] -WantedBy=multi-user.target diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/rules b/pkg/deb/ota-plus-client-0.1.0/debian/rules deleted file mode 100644 index 93646c7..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/rules +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/make -f -%: - dh $@ --with=systemd diff --git a/pkg/deb/ota-plus-client-0.1.0/debian/source/format b/pkg/deb/ota-plus-client-0.1.0/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/pkg/deb/ota-plus-client-0.1.0/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/pkg/rpm/ota-client.service b/pkg/ota-client.service index 9c2dafd..9c2dafd 100644 --- a/pkg/rpm/ota-client.service +++ b/pkg/ota-client.service @@ -3,7 +3,7 @@ set -eo pipefail PKG_NAME="ota-plus-client" -PKG_VER="0.1.0" +PKG_VER=$VERSION PKG_DIR="${PKG_NAME}-${PKG_VER}" PKG_TARBALL="${PKG_NAME}_${PKG_VER}" PREFIX=/opt/ats @@ -31,20 +31,15 @@ function envsub { function make_deb { export PACKAGE_MANAGER="dpkg" - workdir="${TMPDIR:-/tmp}/pkg-ota-plus-client-$$" - cp -pr $PKG_SRC_DIR/deb $workdir - cd $workdir + cd $PKG_SRC_DIR + envsub ota.toml.template > $PKG_NAME.toml - mkdir -p $PKG_DIR/bin - mkdir -p $PKG_DIR/etc - envsub ${PKG_SRC_DIR}/ota.toml.template > $PKG_DIR/etc/ota.toml - tar czf $PKG_TARBALL $PKG_DIR/bin $PKG_DIR/etc + fpm -s dir -t deb -n ${PKG_NAME} -v ${PKG_VER} --prefix ${PREFIX} -a native \ + --deb-systemd $PKG_SRC_DIR/ota-client.service \ + $PKG_SRC_DIR/ota_plus_client=ota_plus_client $PKG_NAME.toml=ota.toml - cd $PKG_DIR - debuild -i -us -uc -b - mv -n ../ota-plus-client*.deb $dest - cd $PKG_SRC_DIR - rm -rf $workdir + mv -n ota-plus-client*.deb $dest + rm $PKG_NAME.toml } function make_rpm { @@ -54,8 +49,8 @@ function make_rpm { envsub ota.toml.template > $PKG_NAME.toml fpm -s dir -t rpm -n ${PKG_NAME} -v ${PKG_VER} --prefix ${PREFIX} -a native \ - --rpm-service $PKG_SRC_DIR/rpm/ota-client.service \ - $PKG_SRC_DIR/rpm/ota_plus_client=ota_plus_client $PKG_NAME.toml=ota.toml + --rpm-service $PKG_SRC_DIR/ota-client.service \ + $PKG_SRC_DIR/ota_plus_client=ota_plus_client $PKG_NAME.toml=ota.toml mv -n ota-plus-client*.rpm $dest rm $PKG_NAME.toml |