Skip to content

Commit

Permalink
apt: use fluent-package instead of td-agent
Browse files Browse the repository at this point in the history
Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys committed Apr 25, 2023
1 parent 823a271 commit f821e2d
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 70 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
#

PACKAGES = [
"td-agent",
"fluent-package",
]

APT_SOURCE_PACKAGES = [
"fluentd-apt-source"
]

ALL_PACKAGE = [
"td-agent",
"fluent-package",
"fluentd-apt-source",
]

Expand Down
40 changes: 20 additions & 20 deletions fluent-package/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ require 'logger'
require 'find'

DOWNLOADS_DIR = File.expand_path("downloads")
STAGING_DIR = File.expand_path(ENV["TD_AGENT_STAGING_PATH"] || "staging")
STAGING_DIR = File.expand_path(ENV["FLUENT_PACKAGE_STAGING_PATH"] || "staging")

@logger = Logger.new(STDOUT, Logger::Severity::INFO)
if ENV["TD_AGENT_LOG_LEVEL"] and ENV["TD_AGENT_LOG_LEVEL"] == "debug"
if ENV["FLUENT_PACKAGE_LOG_LEVEL"] and ENV["FLUENT_PACKAGE_LOG_LEVEL"] == "debug"
@logger = Logger.new(STDOUT, Logger::Severity::DEBUG)
end

Expand Down Expand Up @@ -65,14 +65,14 @@ CLEAN.include("msi/*.wixpdb")
CLOBBER.include("msi/*.msi")

# macOS
CLEAN.include("dmg/td-agent.icns")
CLEAN.include("dmg/td-agent.rsrc")
CLEAN.include("dmg/fluent-package.icns")
CLEAN.include("dmg/fluent-package.rsrc")
CLEAN.include("dmg/resources/pkg/Distribution.xml")
CLEAN.include("dmg/resources/pkg/scripts/postinstall")
CLEAN.include("dmg/resources/dmg/td-agent.osascript")
CLEAN.include("dmg/resources/dmg/fluent-package.osascript")
CLOBBER.include("dmg/*.pkg")
CLOBBER.include("dmg/*.dmg")
CLOBBER.include("dmg/td-agent.iconset")
CLOBBER.include("dmg/fluent-package.iconset")
CLOBBER.include("dmg/dmg")

def windows?
Expand Down Expand Up @@ -147,7 +147,7 @@ def render_template(dest, src, config, opts={})
erb_binding.local_variable_set(key, value)
end

destination = dest.gsub('td-agent', config[:project_name])
destination = dest.gsub('fluent-package', config[:project_name])
directory = File.dirname(destination)
mode = opts.fetch(:mode, 0644)

Expand Down Expand Up @@ -411,7 +411,7 @@ class BuildTask
ENV["GEM_HOME"] = gem_staging_dir
ENV["INSTALL_GEM_FROM_LOCAL_REPO"] = "yes"
sh(bundle_command, "_#{BUNDLER_VERSION}_", "install")
# Ensure to install binstubs under /opt/td-agent/bin
# Ensure to install binstubs under /opt/fluent-package/bin
sh(gem_command, "pristine", "--only-executables", "--all", "--bindir", staging_bindir)
ENV["GEM_HOME"] = gem_home

Expand Down Expand Up @@ -472,7 +472,7 @@ class BuildTask
end
end

desc "Create td-agent configuration files from template"
desc "Create fluent-package configuration files from template"
task :td_agent_config do
configs = [
"etc/#{PACKAGE_NAME}/#{PACKAGE_NAME}.conf"
Expand Down Expand Up @@ -654,16 +654,16 @@ class BuildTask
]

if JEMALLOC_VERSION.split('.')[0].to_i >= 4
if ENV["TD_AGENT_STAGING_PATH"] and
(ENV["TD_AGENT_STAGING_PATH"].end_with?("el8.aarch64") or
ENV["TD_AGENT_STAGING_PATH"].end_with?("el7.aarch64"))
if ENV["FLUENT_PACKAGE_STAGING_PATH"] and
(ENV["FLUENT_PACKAGE_STAGING_PATH"].end_with?("el8.aarch64") or
ENV["FLUENT_PACKAGE_STAGING_PATH"].end_with?("el7.aarch64"))
# NOTE: There is a case that PAGE_SIZE detection on
# CentOS 7 CentOS 8 with aarch64 AWS ARM instance.
# So, explicitly set PAGE_SIZE by with-lg-page 16 (2^16 = 65536)
configure_opts.concat(["--with-lg-page=16"])
end
if ENV["TD_AGENT_STAGING_PATH"] and
ENV["TD_AGENT_STAGING_PATH"].end_with?("el8.ppc64le")
if ENV["FLUENT_PACKAGE_STAGING_PATH"] and
ENV["FLUENT_PACKAGE_STAGING_PATH"].end_with?("el8.ppc64le")
# NOTE: There is a case that PAGE_SIZE detection on
# CentOS 8 with ppc64le.
# So, explicitly set PAGE_SIZE by with-lg-page 16 (2^16 = 65536)
Expand Down Expand Up @@ -704,7 +704,7 @@ class BuildTask
end

mkdir_p(openssldir)
# Install cert.pem into install_prefix/etc/openssl and staging/opt/td-agent/etc/openssl/cert.pem.
# Install cert.pem into install_prefix/etc/openssl and staging/opt/fluent-package/etc/openssl/cert.pem.
[File.join(openssldir, "cert.pem"), File.join(install_prefix, "etc", "openssl", "cert.pem")].each do |path|
File.open(path, 'w', 0644) do |f|
f.write(valid_certificates.join("\n") << "\n")
Expand Down Expand Up @@ -1142,7 +1142,7 @@ class LinuxPackageTask < PackageTask

def build_copyright_file
# Note: maintain debian/copyright manually is inappropriate way because
# many gem is bundled with td-agent package.
# many gem is bundled with fluent-package package.
# We use gem specification GEMFILE to solve this issue.
src = File.join("templates", "package-scripts", "#{PACKAGE_NAME}", "deb", "copyright")
dest = File.join("debian", "copyright")
Expand Down Expand Up @@ -1197,7 +1197,7 @@ EOS

def build_include_binaries_file
# Note: maintain debian/source/include-binaries manually is inappropriate way
# because many gem files are bundled with td-agent package.
# because many gem files are bundled with fluent-package package.
# We use gem specification GEMFILE to solve this issue.
paths = []
command = "bundle config set --local cache_path #{DOWNLOADS_DIR}"
Expand Down Expand Up @@ -1277,7 +1277,7 @@ EOS

private
def detect_release_time
release_time_env = ENV["TD_AGENT_RELEASE_TIME"]
release_time_env = ENV["FLUENT_PACKAGE_RELEASE_TIME"]
if release_time_env
Time.parse(release_time_env).utc
else
Expand Down Expand Up @@ -1454,7 +1454,7 @@ end
class MacOSPackageTask
include Rake::DSL

PKG_OUTPUT_DIR = ENV["TD_AGENT_PKG_OUTPUT_PATH"] || "."
PKG_OUTPUT_DIR = ENV["FLUENT_PACKAGE_PKG_OUTPUT_PATH"] || "."

def initialize(logger:)
@package = PACKAGE_NAME
Expand Down Expand Up @@ -1507,7 +1507,7 @@ end
class WindowsPackageTask
include Rake::DSL

MSI_OUTPUT_DIR = ENV["TD_AGENT_MSI_OUTPUT_PATH"] || "."
MSI_OUTPUT_DIR = ENV["FLUENT_PACKAGE_MSI_OUTPUT_PATH"] || "."

def initialize
@package = PACKAGE_NAME
Expand Down
2 changes: 1 addition & 1 deletion fluent-package/apt/commonvar.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
code_name=$(lsb_release --codename --short)
architecture=$(dpkg --print-architecture)
repositories_dir=/fluentd/td-agent/apt/repositories
repositories_dir=/fluentd/fluent-package/apt/repositories
java_jdk=openjdk-11-jre
case ${code_name} in
xenial)
Expand Down
2 changes: 1 addition & 1 deletion fluent-package/config.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PACKAGE_NAME = "td-agent"
PACKAGE_NAME = "fluent-package"
PACKAGE_VERSION = "5.0.0"

FLUENTD_REVISION = '0a6d706a9cee5882d751b2cc6169696709df0134' # v1.16.1
Expand Down
2 changes: 1 addition & 1 deletion fluent-package/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
td-agent (5.0.0-1) unstable; urgency=low
fluent-package (5.0.0-1) unstable; urgency=low

* New upstream release.

Expand Down
4 changes: 2 additions & 2 deletions fluent-package/debian/control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: td-agent
Source: fluent-package
Section: net
Priority: optional
Maintainer: Fluentd developers <[email protected]>
Expand All @@ -17,7 +17,7 @@ Build-Depends:
Standards-Version: 4.3.0
Homepage: https://www.fluentd.org/

Package: td-agent
Package: fluent-package
Architecture: any
Pre-Depends: adduser
Depends:
Expand Down
2 changes: 1 addition & 1 deletion fluent-package/debian/fluent-package.install
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ usr/bin/*
usr/sbin/*
usr/lib/tmpfiles.d/*
etc/logrotate.d/*
etc/td-agent/*
etc/fluent-package/*
lib/systemd/system/*
66 changes: 33 additions & 33 deletions fluent-package/debian/fluent-package.lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
td-agent: windows-devel-file-in-package
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
td-agent: library-not-linked-against-libc
td-agent: wrong-path-for-interpreter
td-agent: duplicate-font-file
td-agent: jar-not-in-usr-share
td-agent: possibly-insecure-handling-of-tmp-files-in-maintainer-script
td-agent: maintainer-script-should-not-use-recursive-chown-or-chmod
td-agent: unusual-interpreter opt/td-agent/lib/ruby/gems/*/gems/bundler-*/lib/bundler/templates/Executable #!<%=
td-agent: unusual-interpreter opt/td-agent/lib/ruby/gems/*/gems/bundler-*/lib/bundler/templates/Executable.bundler #!<%=
td-agent: unusual-interpreter opt/td-agent/lib/ruby/gems/*/gems/bundler-*/lib/bundler/templates/Executable.standalone #!<%=
td-agent: incorrect-path-for-interpreter opt/td-agent/bin/jeprof (#!/usr/bin/env perl != /usr/bin/perl)
td-agent: uses-dpkg-database-directly postinst (line 37)
td-agent: uses-dpkg-database-directly postinst (line 40)
td-agent: unusual-interpreter opt/td-agent/lib/ruby/*/bundler/templates/Executable #!<%=
td-agent: unusual-interpreter opt/td-agent/lib/ruby/*/bundler/templates/Executable.bundler #!<%=
td-agent: unusual-interpreter opt/td-agent/lib/ruby/*/bundler/templates/Executable.standalone #!<%=
td-agent: package-contains-vcs-control-file
td-agent: binary-or-shlib-defines-rpath opt/td-agent/lib/ruby/gems/*/extensions/x86_64-linux/*/nokogiri-*/nokogiri/nokogiri.so /build/td-agent-*/debian/tmp/opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxml2/*/lib
td-agent: binary-or-shlib-defines-rpath opt/td-agent/lib/ruby/gems/*/extensions/x86_64-linux/*/nokogiri-*/nokogiri/nokogiri.so /build/td-agent-*/debian/tmp/opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxslt/*/lib
td-agent: binary-or-shlib-defines-rpath opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/lib/nokogiri/nokogiri.so /build/td-agent-*/debian/tmp/opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxslt/*/lib
td-agent: binary-or-shlib-defines-rpath opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ext/nokogiri/nokogiri.so /build/td-agent-*/debian/tmp/opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxslt/*/lib
td-agent: binary-or-shlib-defines-rpath opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ext/nokogiri/nokogiri.so /build/td-agent-*/debian/tmp/opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxml2/*/lib
td-agent: binary-or-shlib-defines-rpath opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/lib/nokogiri/nokogiri.so /build/td-agent-*/debian/tmp/opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxml2/*/lib
td-agent: embedded-library opt/td-agent/lib/ruby/gems/*/extensions/x86_64-linux/*/nokogiri-*/nokogiri/nokogiri.so: libxml2
td-agent: embedded-library opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/ext/nokogiri/nokogiri.so: libxml2
td-agent: embedded-library opt/td-agent/lib/ruby/gems/*/gems/nokogiri-*/lib/nokogiri/nokogiri.so: libxml2
fluent-package: windows-devel-file-in-package
fluent-package: ruby-script-but-no-ruby-dep
fluent-package: script-not-executable
fluent-package: python-script-but-no-python-dep
fluent-package: executable-not-elf-or-script
fluent-package: missing-dep-for-interpreter
fluent-package: gz-file-not-gzip
fluent-package: no-upstream-changelog
fluent-package: library-not-linked-against-libc
fluent-package: wrong-path-for-interpreter
fluent-package: duplicate-font-file
fluent-package: jar-not-in-usr-share
fluent-package: possibly-insecure-handling-of-tmp-files-in-maintainer-script
fluent-package: maintainer-script-should-not-use-recursive-chown-or-chmod
fluent-package: unusual-interpreter opt/fluent-package/lib/ruby/gems/*/gems/bundler-*/lib/bundler/templates/Executable #!<%=
fluent-package: unusual-interpreter opt/fluent-package/lib/ruby/gems/*/gems/bundler-*/lib/bundler/templates/Executable.bundler #!<%=
fluent-package: unusual-interpreter opt/fluent-package/lib/ruby/gems/*/gems/bundler-*/lib/bundler/templates/Executable.standalone #!<%=
fluent-package: incorrect-path-for-interpreter opt/fluent-package/bin/jeprof (#!/usr/bin/env perl != /usr/bin/perl)
fluent-package: uses-dpkg-database-directly postinst (line 37)
fluent-package: uses-dpkg-database-directly postinst (line 40)
fluent-package: unusual-interpreter opt/fluent-package/lib/ruby/*/bundler/templates/Executable #!<%=
fluent-package: unusual-interpreter opt/fluent-package/lib/ruby/*/bundler/templates/Executable.bundler #!<%=
fluent-package: unusual-interpreter opt/fluent-package/lib/ruby/*/bundler/templates/Executable.standalone #!<%=
fluent-package: package-contains-vcs-control-file
fluent-package: binary-or-shlib-defines-rpath opt/fluent-package/lib/ruby/gems/*/extensions/x86_64-linux/*/nokogiri-*/nokogiri/nokogiri.so /build/fluent-package-*/debian/tmp/opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxml2/*/lib
fluent-package: binary-or-shlib-defines-rpath opt/fluent-package/lib/ruby/gems/*/extensions/x86_64-linux/*/nokogiri-*/nokogiri/nokogiri.so /build/fluent-package-*/debian/tmp/opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxslt/*/lib
fluent-package: binary-or-shlib-defines-rpath opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/lib/nokogiri/nokogiri.so /build/fluent-package-*/debian/tmp/opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxslt/*/lib
fluent-package: binary-or-shlib-defines-rpath opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ext/nokogiri/nokogiri.so /build/fluent-package-*/debian/tmp/opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxslt/*/lib
fluent-package: binary-or-shlib-defines-rpath opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ext/nokogiri/nokogiri.so /build/fluent-package-*/debian/tmp/opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxml2/*/lib
fluent-package: binary-or-shlib-defines-rpath opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/lib/nokogiri/nokogiri.so /build/fluent-package-*/debian/tmp/opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ports/x86_64-pc-linux-gnu/libxml2/*/lib
fluent-package: embedded-library opt/fluent-package/lib/ruby/gems/*/extensions/x86_64-linux/*/nokogiri-*/nokogiri/nokogiri.so: libxml2
fluent-package: embedded-library opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/ext/nokogiri/nokogiri.so: libxml2
fluent-package: embedded-library opt/fluent-package/lib/ruby/gems/*/gems/nokogiri-*/lib/nokogiri/nokogiri.so: libxml2
4 changes: 2 additions & 2 deletions fluent-package/debian/fluent-package.manpages
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
debian/td.1
debian/td-agent.1
debian/td-agent-gem.1
debian/fluent-package.1
debian/fluent-package-gem.1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Profile: td-agent/main
Profile: fluent-package/main
Extends: debian/main
Disable-Tags: dir-or-file-in-opt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Profile: td-agent/main
Profile: fluent-package/main
Extends: ubuntu/main
Disable-Tags: dir-or-file-in-opt
4 changes: 2 additions & 2 deletions fluent-package/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ override_dh_builddeb:
dh_builddeb -- -Zxz

override_dh_auto_install:
rake build:deb_config TD_AGENT_STAGING_PATH="$(CURDIR)/debian/tmp" NO_VAR_RUN=1
rake build:all TD_AGENT_STAGING_PATH="$(CURDIR)/debian/tmp" PATH="$(HOME)/.cargo/bin:$(PATH)"
rake build:deb_config FLUENT_PACKAGE_STAGING_PATH="$(CURDIR)/debian/tmp" NO_VAR_RUN=1
rake build:all FLUENT_PACKAGE_STAGING_PATH="$(CURDIR)/debian/tmp" PATH="$(HOME)/.cargo/bin:$(PATH)"
dh_installman

override_dh_auto_clean:
Expand Down
4 changes: 2 additions & 2 deletions fluent-package/debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
td-agent source: changelog-should-mention-nmu
td-agent source: source-nmu-has-incorrect-version-number
fluent-package source: changelog-should-mention-nmu
fluent-package source: source-nmu-has-incorrect-version-number
2 changes: 1 addition & 1 deletion lib/apt/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if [ "${DEBUG:-no}" = "yes" ]; then
fi
else
if [ "${LINTIAN:-yes}" = "yes" ]; then
run debuild -us -uc --lintian-opts --profile td-agent/${distribution} > /dev/null
run debuild -us -uc --lintian-opts --profile fluent-package/${distribution} > /dev/null
else
run debuild --no-lintian -us -uc > /dev/null
fi
Expand Down

0 comments on commit f821e2d

Please sign in to comment.