From f821e2dd3f3962ab52918ab2b0b4b6edffb297a4 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Tue, 25 Apr 2023 13:42:36 +0900 Subject: [PATCH] apt: use fluent-package instead of td-agent Signed-off-by: Kentaro Hayashi --- Rakefile | 4 +- fluent-package/Rakefile | 40 +++++------ fluent-package/apt/commonvar.sh | 2 +- fluent-package/config.rb | 2 +- fluent-package/debian/changelog | 2 +- fluent-package/debian/control | 4 +- fluent-package/debian/fluent-package.install | 2 +- .../debian/fluent-package.lintian-overrides | 66 +++++++++---------- fluent-package/debian/fluent-package.manpages | 4 +- .../lintian/fluent-package/debian.profile | 2 +- .../lintian/fluent-package/ubuntu.profile | 2 +- fluent-package/debian/rules | 4 +- .../debian/source/lintian-overrides | 4 +- lib/apt/build.sh | 2 +- 14 files changed, 70 insertions(+), 70 deletions(-) diff --git a/Rakefile b/Rakefile index aa4908f9e..9f10ed55a 100755 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,7 @@ # PACKAGES = [ - "td-agent", + "fluent-package", ] APT_SOURCE_PACKAGES = [ @@ -24,7 +24,7 @@ APT_SOURCE_PACKAGES = [ ] ALL_PACKAGE = [ - "td-agent", + "fluent-package", "fluentd-apt-source", ] diff --git a/fluent-package/Rakefile b/fluent-package/Rakefile index fe9d9a408..d7c307baf 100755 --- a/fluent-package/Rakefile +++ b/fluent-package/Rakefile @@ -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 @@ -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? @@ -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) @@ -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 @@ -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" @@ -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) @@ -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") @@ -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") @@ -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}" @@ -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 @@ -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 @@ -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 diff --git a/fluent-package/apt/commonvar.sh b/fluent-package/apt/commonvar.sh index 7969d54ea..2840195f2 100644 --- a/fluent-package/apt/commonvar.sh +++ b/fluent-package/apt/commonvar.sh @@ -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) diff --git a/fluent-package/config.rb b/fluent-package/config.rb index a96d215e9..80bede8f0 100644 --- a/fluent-package/config.rb +++ b/fluent-package/config.rb @@ -1,4 +1,4 @@ -PACKAGE_NAME = "td-agent" +PACKAGE_NAME = "fluent-package" PACKAGE_VERSION = "5.0.0" FLUENTD_REVISION = '0a6d706a9cee5882d751b2cc6169696709df0134' # v1.16.1 diff --git a/fluent-package/debian/changelog b/fluent-package/debian/changelog index 4da643ca2..d89f81be7 100644 --- a/fluent-package/debian/changelog +++ b/fluent-package/debian/changelog @@ -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. diff --git a/fluent-package/debian/control b/fluent-package/debian/control index fb82a630d..f34a2a571 100644 --- a/fluent-package/debian/control +++ b/fluent-package/debian/control @@ -1,4 +1,4 @@ -Source: td-agent +Source: fluent-package Section: net Priority: optional Maintainer: Fluentd developers @@ -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: diff --git a/fluent-package/debian/fluent-package.install b/fluent-package/debian/fluent-package.install index 4771c8cc6..47a07055e 100644 --- a/fluent-package/debian/fluent-package.install +++ b/fluent-package/debian/fluent-package.install @@ -3,5 +3,5 @@ usr/bin/* usr/sbin/* usr/lib/tmpfiles.d/* etc/logrotate.d/* -etc/td-agent/* +etc/fluent-package/* lib/systemd/system/* diff --git a/fluent-package/debian/fluent-package.lintian-overrides b/fluent-package/debian/fluent-package.lintian-overrides index c8c21fb00..79de94419 100644 --- a/fluent-package/debian/fluent-package.lintian-overrides +++ b/fluent-package/debian/fluent-package.lintian-overrides @@ -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 diff --git a/fluent-package/debian/fluent-package.manpages b/fluent-package/debian/fluent-package.manpages index 1bcc3d51b..9b4c5a87b 100644 --- a/fluent-package/debian/fluent-package.manpages +++ b/fluent-package/debian/fluent-package.manpages @@ -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 diff --git a/fluent-package/debian/lintian/fluent-package/debian.profile b/fluent-package/debian/lintian/fluent-package/debian.profile index ff1d9ca28..28237e791 100644 --- a/fluent-package/debian/lintian/fluent-package/debian.profile +++ b/fluent-package/debian/lintian/fluent-package/debian.profile @@ -1,3 +1,3 @@ -Profile: td-agent/main +Profile: fluent-package/main Extends: debian/main Disable-Tags: dir-or-file-in-opt \ No newline at end of file diff --git a/fluent-package/debian/lintian/fluent-package/ubuntu.profile b/fluent-package/debian/lintian/fluent-package/ubuntu.profile index 83521d110..d1f5c0276 100644 --- a/fluent-package/debian/lintian/fluent-package/ubuntu.profile +++ b/fluent-package/debian/lintian/fluent-package/ubuntu.profile @@ -1,3 +1,3 @@ -Profile: td-agent/main +Profile: fluent-package/main Extends: ubuntu/main Disable-Tags: dir-or-file-in-opt diff --git a/fluent-package/debian/rules b/fluent-package/debian/rules index c1cabec1c..c48368e8f 100755 --- a/fluent-package/debian/rules +++ b/fluent-package/debian/rules @@ -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: diff --git a/fluent-package/debian/source/lintian-overrides b/fluent-package/debian/source/lintian-overrides index e0f948d33..00ddd29f6 100644 --- a/fluent-package/debian/source/lintian-overrides +++ b/fluent-package/debian/source/lintian-overrides @@ -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 diff --git a/lib/apt/build.sh b/lib/apt/build.sh index 30e078697..ff00deaba 100755 --- a/lib/apt/build.sh +++ b/lib/apt/build.sh @@ -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