Skip to content

Commit

Permalink
Merge pull request #2 from clear-code/initial-td-agent-debian-package
Browse files Browse the repository at this point in the history
Create an initial debian td-agent package
  • Loading branch information
ashie authored Jan 8, 2020
2 parents 4dd01d6 + 081a7ab commit 6269e4b
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 3 deletions.
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,17 @@
/yum/build.sh
/yum/repositories/
/yum/tmp/
/yum/env.sh
/yum/env.sh
/apt/build.sh
/apt/env.sh
/apt/repositories/debian/pool/*/*/*/*/*.diff.gz
/apt/repositories/debian/pool/*/*/*/*/*.tar.gz
/apt/repositories/debian/pool/*/*/*/*/*.tar.xz
/apt/repositories/debian/pool/*/*/*/*/*.build
/apt/repositories/debian/pool/*/*/*/*/*.changes
/apt/repositories/debian/pool/*/*/*/*/*.deb
/apt/repositories/debian/pool/*/*/*/*/*.dsc
/apt/repositories/debian/dists/
/apt/repositories/debian/*.db
/apt/repositories/debian/*.conf
/apt/tmp/
56 changes: 56 additions & 0 deletions apt/debian-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

ARG FROM=debian:buster
FROM ${FROM}

COPY qemu-* /usr/bin/

RUN \
echo "debconf debconf/frontend select Noninteractive" | \
debconf-set-selections

ARG DEBUG

RUN sed -i'' -e 's/main$/main contrib non-free/g' /etc/apt/sources.list

RUN \
quiet=$([ "${DEBUG}" = "yes" ] || echo "-qq") && \
apt update ${quiet} && \
apt install -y -V ${quiet} \
build-essential \
debhelper \
cdbs \
devscripts \
ruby-dev \
ruby-bundler \
libjemalloc-dev \
git \
libzstd-dev \
liblz4-dev \
pkg-config \
libssl-dev \
libpq-dev \
tar \
lsb-release \
zlib1g-dev && \
apt clean && \
rm -rf /var/lib/apt/lists/*
# Prohibit to use rubygems-integration's rake
RUN \
gem install rake -v 12.3.3 && \
rm -rf /usr/lib/ruby/gems/*/cache/*.gem
33 changes: 33 additions & 0 deletions apt/debian-buster/qemu-dummy-static
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Do nothing. This exists only for not requiring qemu-aarch64-static copy.
# Recent Debian (buster or later) and Ubuntu (18.10 or later) on amd64 hosts or
# arm64 host don't require qemu-aarch64-static in Docker image. But old Debian
# and Ubuntu hosts on amd64 require qemu-aarch64-static in Docker image.
#
# We use "COPY qemu* /usr/bin/" in Dockerfile. If we don't put any "qemnu*",
# the "COPY" is failed. It means that we always require "qemu*" even if we
# use recent Debian/Ubuntu or arm64 host. If we have this dummy "qemu*" file,
# the "COPY" isn't failed. It means that we can copy "qemu*" only when we
# need.
#
# See also "script" in dev/tasks/linux-packages/azure.linux.arm64.yml.
# Azure Pipelines uses old Ubuntu (18.04).
# So we need to put "qemu-aarch64-static" into this directory.
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
td-agent (3.5.1-1) UNRELEASED; urgency=low

* New upstream release.

-- Hiroshi Hatake <hatake@clear-code.com> Mon, 06 Jan 2020 06:55:08 -0000
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
28 changes: 28 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Source: td-agent
Section: net
Priority: optional
Maintainer: Fluentd developers <fluentd@googlegroups.com>
Uploaders: HATAKE Hiroshi <hatake@clear-code.com>
Build-Depends:
debhelper (>= 10),
cdbs,
autotools-dev,
pkg-config,
liblz4-dev,
zlib1g-dev,
ruby-dev,
ruby-bundler,
rake,
libjemalloc-dev,
libzstd-dev,
libssl-dev
Standards-Version: 4.3.0
Homepage: http://www.fluentd.org/

Package: td-agent
Architecture: any
Depends:
ruby,
${misc:Depends},
${shlibs:Depends},
Description: Treasure Agent: A data collector for Treasure Data
14 changes: 14 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/make -f

export GEM2DEB_TEST_RUNNER = --check-dependencies
export DH_RUBY = --gem-install

%:
dh $@

override_dh_auto_build:
rake build:plugin_gems TD_AGENT_GEM_HOME=.

override_dh_auto_clean:
rake clean
dh_auto_clean
1 change: 1 addition & 0 deletions debian/td-agent.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opt/td-agent/*
10 changes: 10 additions & 0 deletions debian/td-agent.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
td-agent: package-contains-vcs-control-file
td-agent: windows-devel-file-in-package
td-agent: dir-or-file-in-build-tree
td-agent: ruby-script-but-no-ruby-dep
td-agent: script-not-executable
td-agent: python-script-but-no-python-dep
td-agent: executable-not-elf-or-script
td-agent: missing-dep-for-interpreter
td-agent: gz-file-not-gzip
td-agent: no-upstream-changelog
2 changes: 0 additions & 2 deletions td-agent-package-task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ def build_archive

def apt_targets_default
[
"debian-stretch",
"debian-stretch-i386",
"debian-buster",
"debian-buster-i386",
]
Expand Down

0 comments on commit 6269e4b

Please sign in to comment.