Skip to content

Commit

Permalink
Start of debian package
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrasseur-aneo committed Aug 11, 2023
1 parent 984aca3 commit a04df27
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(version 0.1.0)
set(SOLUTION_NAME ArmoniK.Api)
project(${SOLUTION_NAME} C CXX)
if(NOT DEFINED BUILD_DIR)
set(BUILD_DIR "${CMAKE_SOURCE_DIR}/build")
set(BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if(NOT DEFINED PROTO_FILES_DIR)
set(PROTO_FILES_DIR "${CMAKE_SOURCE_DIR}/../../Protos/V1")
Expand Down
2 changes: 1 addition & 1 deletion packages/cpp/tools/BuildEnv.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ RUN ( \

RUN yes password | passwd root

CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_test_clion"]
ENTRYPOINT ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_test_clion"]
34 changes: 34 additions & 0 deletions packages/cpp/tools/packaging/deb.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:23.04

# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" apt-get install -y \
gcc \
g++ \
make \
build-essential \
cmake \
libc-ares-dev \
protobuf-compiler-grpc \
grpc-proto \
libgrpc-dev \
libgrpc++-dev \
debhelper \
debmake \
quilt

WORKDIR /app/libarmonik
COPY Protos/V1/. ./Protos/
COPY packages/cpp/ArmoniK.Api.Common/. ./ArmoniK.Api.Common/
COPY packages/cpp/ArmoniK.Api.Client/. ./ArmoniK.Api.Client/
COPY packages/cpp/ArmoniK.Api.Worker/. ./ArmoniK.Api.Worker/
COPY packages/cpp/CMakeLists.txt .
COPY packages/cpp/NOTICE.txt .
COPY --chmod=755 packages/cpp/tools/packaging/debian/. ./debian/

ARG PACKAGE_NAME="libarmonik"
ARG VERSION="0.1.0"

RUN debmake -T -t -f "ANEO Consulting" -e "[email protected]" -p "$PACKAGE_NAME" -u "$VERSION" -b libarmonik:lib -i debuild

ENTRYPOINT [ "bash" ]

58 changes: 58 additions & 0 deletions packages/cpp/tools/packaging/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
# See debhelper(7) (uncomment to enable)
# This is an autogenerated template for debian/rules.
#
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1
#
# Copy some variable definitions from pkg-info.mk and vendor.mk
# under /usr/share/dpkg/ to here if they are useful.
#
# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1)
# Apply all hardening options
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# 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
#
# With debhelper version 9 or newer, the dh command exports
# all buildflags. So there is no need to include the
# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer.
#
# These are rarely used code. (START)
#
# The following include for *.mk magically sets miscellaneous
# variables while honoring existing values of pertinent
# environment variables:
#
# Architecture-related variables such as DEB_TARGET_MULTIARCH:
#include /usr/share/dpkg/architecture.mk
# Vendor-related variables such as DEB_VENDOR:
#include /usr/share/dpkg/vendor.mk
# Package-related variables such as DEB_DISTRIBUTION
#include /usr/share/dpkg/pkg-info.mk
#
# You may alternatively set them susing a simple script such as:
# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor)
#
# These are rarely used code. (END)
#

# main packaging script based on post dh7 syntax
%:
dh $@

# debmake generated override targets
override_dh_auto_configure:
dh_auto_configure -- -DBUILD_WORKER=ON -DBUILD_CLIENT=ON -DFETCHCONTENT_FULLY_DISCONNECTED=OFF -DPROTO_FILES_DIR="$(shell pwd)/Protos"
#
# You may need to patch CMakeLists.txt to set the library install path to be:
#-install(TARGETS <sharedlibname> LIBRARY DESTINATION lib)
#+install(TARGETS <sharedlibname> LIBRARY DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE})

# Multiarch package requires library files to be installed to
# /usr/lib/<triplet>/ . If the build system does not support
# $(DEB_HOST_MULTIARCH), you may need to override some targets such as
# dh_auto_configure or dh_auto_install to use $(DEB_HOST_MULTIARCH) .
5 changes: 5 additions & 0 deletions packages/cpp/tools/packaging/make-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -x
script_path="$(readlink -f "${BASH_SOURCE:-$0}")"
script_dir="$(dirname "$script_path")"
docker build -t "debbuild" -f deb.Dockerfile --progress=plain "${script_dir}/../../../.."

0 comments on commit a04df27

Please sign in to comment.