From 186a4dfdc62bd1b36e4c3d37ad8fd916c8460237 Mon Sep 17 00:00:00 2001 From: Karel Bilek Date: Mon, 27 Apr 2015 19:13:07 +0200 Subject: [PATCH 1/2] Adding udev packaging --- udev/dist/Dockerfile | 35 +++++++++++++++++++++++++++++++++++ udev/dist/Makefile | 18 ++++++++++++++++++ udev/dist/release.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 udev/dist/Dockerfile create mode 100644 udev/dist/Makefile create mode 100755 udev/dist/release.sh diff --git a/udev/dist/Dockerfile b/udev/dist/Dockerfile new file mode 100644 index 0000000000..51c4a7bfe4 --- /dev/null +++ b/udev/dist/Dockerfile @@ -0,0 +1,35 @@ +# initialize from the image + +FROM fedora:21 + +# update package repositories + +RUN yum install -y deltarpm yum-plugin-fastestmirror +RUN yum update -y + +# install tools + +RUN yum install -y cmake make wget +RUN yum install -y gcc gcc-c++ git make patchutils pkgconfig wget + +# install dependencies for Linux packaging + +RUN yum install -y ruby-devel rubygems rpm-build +RUN gem install fpm --no-document + +# install dependencies for Linux build + +#RUN yum install -y glibc-devel glibc-static libgcc libstdc++-static zlib-devel +#RUN yum install -y boost-static libusbx-devel protobuf-static + +#RUN yum install -y glibc-devel.i686 glibc-static.i686 libgcc.i686 libstdc++-static.i686 zlib-devel.i686 +#RUN yum install -y boost-static.i686 libusbx-devel.i686 protobuf-static.i686 + +# protobuf-static does not install protobuf-devel, workaround + +#RUN yum install -y protobuf-devel + +# install used networking libraries + +#RUN yum install -y libcurl-devel libmicrohttpd-devel +#RUN yum install -y libcurl-devel.i686 libmicrohttpd-devel.i686 diff --git a/udev/dist/Makefile b/udev/dist/Makefile new file mode 100644 index 0000000000..86adeac9eb --- /dev/null +++ b/udev/dist/Makefile @@ -0,0 +1,18 @@ +VOL_MOUNT = -v $(shell pwd):/release +IMAGETAG = trezor-udev-build-env + +all: .package + +.package: .docker-image trezor.rules + $(info Packaging ...) + docker run -t $(VOL_MOUNT) $(IMAGETAG) /release/release.sh + +trezor.rules: + cp ../51-trezor-udev.rules trezor.rules + +.docker-image: + $(info Preparing docker image ...) + docker build -t $(IMAGETAG) . + +shell: .docker-image + docker run -i -t $(VOL_MOUNT) $(IMAGETAG) /bin/bash diff --git a/udev/dist/release.sh b/udev/dist/release.sh new file mode 100755 index 0000000000..ec0144b380 --- /dev/null +++ b/udev/dist/release.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +cd $(dirname $0) + +VERSION="1" + + +install -D -m 0644 ./trezor.rules ./lib/udev/rules.d/52-trezor-extension.rules + +NAME=trezor-udev + +tar cfj $NAME-$VERSION.tar.bz2 ./lib + +for TYPE in "deb" "rpm"; do + fpm \ + -s tar \ + -t $TYPE \ + -a all \ + -n $NAME \ + -v $VERSION \ + --license "LGPL-3.0" \ + --vendor "SatoshiLabs" \ + --description "Udev rules for using Bitcoin Trezor on Linux" \ + --maintainer "SatoshiLabs " \ + --url "http://bitcointrezor.com/" \ + --category "Productivity/Security" \ + $NAME-$VERSION.tar.bz2 +done + +rm $NAME-$VERSION.tar.bz2 +rm -rf ./lib From 55fa04c24750173787c42a06a048e37f36969b60 Mon Sep 17 00:00:00 2001 From: Karel Bilek Date: Mon, 27 Apr 2015 19:40:45 +0200 Subject: [PATCH 2/2] moving number back to 51 --- udev/{23-trezor.rules => 51-trezor.rules} | 0 udev/dist/Makefile | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename udev/{23-trezor.rules => 51-trezor.rules} (100%) diff --git a/udev/23-trezor.rules b/udev/51-trezor.rules similarity index 100% rename from udev/23-trezor.rules rename to udev/51-trezor.rules diff --git a/udev/dist/Makefile b/udev/dist/Makefile index 86adeac9eb..dff2eb2934 100644 --- a/udev/dist/Makefile +++ b/udev/dist/Makefile @@ -8,7 +8,7 @@ all: .package docker run -t $(VOL_MOUNT) $(IMAGETAG) /release/release.sh trezor.rules: - cp ../51-trezor-udev.rules trezor.rules + cp ../51-trezor.rules trezor.rules .docker-image: $(info Preparing docker image ...)