Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename distribution files #68

Closed
24 tasks done
Tracked by #61
AlexRuiz7 opened this issue Nov 28, 2023 · 3 comments · Fixed by #69
Closed
24 tasks done
Tracked by #61

Rename distribution files #68

AlexRuiz7 opened this issue Nov 28, 2023 · 3 comments · Fixed by #69
Assignees
Labels
level/task Task issue type/change Change performed in a resource or Wazuh Cloud environment

Comments

@AlexRuiz7
Copy link
Member

AlexRuiz7 commented Nov 28, 2023

Description

To complete the Build phase of the fork update, our packages need to depict the following changes.

To be done:

For all packages:

  • Apply packages naming convention
  • Add VERSION file
  • Update packageDescription

For RPM packages:

  • Rename /etc/init.d/opensearch to /etc/init.d/wazuh-indexer
  • Rename /etc/opensearch to /etc/wazuh-indexer
  • Rename /etc/sysconfig/opensearch to /etc/sysconfig/wazuh-indexer
  • Rename /usr/lib/sysctl.d/opensearch.conf to /usr/lib/sysctl.d/wazuh-indexer.conf
  • Rename /usr/lib/systemd/system/opensearch.service to /usr/lib/systemd/system/wazuh-indexer.service
  • Rename /usr/lib/tmpfiles.d/opensearch.conf to /usr/lib/tmpfiles.d/wazuh-indexer.conf
  • Rename /usr/share/opensearch/ folder to /usr/share/wazuh-indexer/
  • Rename /var/lib/opensearch/ folder to /var/lib/wazuh-indexer/
  • Rename /var/log/opensearch/ folder to /var/log/wazuh-indexer/
  • Rename opensearch.service to wazuh-indexer.service

For DEB packages:

  • Rename /etc/default/opensearch to /etc/default/wazuh-indexer
  • Rename /etc/init.d/opensearch to /etc/init.d/wazuh-indexer
  • Rename /etc/opensearch/ folder to /etc/wazuh-indexer/
  • Rename /usr/lib/sysctl.d/opensearch.conf to /usr/lib/sysctl.d/wazuh-indexer.conf
  • Rename /usr/lib/systemd/system/opensearch.service to /usr/lib/systemd/system/wazuh-indexer.service
  • Rename /usr/lib/tmpfiles.d/opensearch.conf to /usr/lib/tmpfiles.d/wazuh-indexer.conf
  • Rename /usr/share/doc/opensearch/ folder to /usr/share/doc/wazuh-indexer/
  • Rename /usr/share/opensearch/ folder to /usr/share/wazuh-indexer/
  • Rename /var/lib/opensearch/ folder to /var/lib/wazuh-indexer/
  • Rename /var/log/opensearch/ folder to /var/log/wazuh-indexer/
  • Rename opensearch.service to wazuh-indexer.service

image

Originally posted by @AlexRuiz7 in #63 (comment)

@AlexRuiz7 AlexRuiz7 self-assigned this Nov 28, 2023
@AlexRuiz7 AlexRuiz7 added level/task Task issue type/change Change performed in a resource or Wazuh Cloud environment labels Nov 28, 2023
@wazuhci wazuhci moved this to In progress in Release 4.9.0 Nov 28, 2023
@AlexRuiz7
Copy link
Member Author

AlexRuiz7 commented Nov 28, 2023

Evidence

RPM

image

DEB

image

This was referenced Nov 29, 2023
@AlexRuiz7
Copy link
Member Author

I tried including the version file to the packages by modifying the wazuh-indexer/distribution/build.gradle file, which contains a section for common files to all distribution packages, but I didn't manage to get it working, so I decided to modify each distribution project directly.

project.ext {
/*****************************************************************************
* Common files in all distributions *
*****************************************************************************/
libFiles = {
copySpec {
// delay by using closures, since they have not yet been configured, so no jar task exists yet
from(configurations.libs)
into('tools/plugin-cli') {
from(configurations.libsPluginCli)
}
into('tools/keystore-cli') {
from(configurations.libsKeystoreCli)
}
into('tools/upgrade-cli') {
from(configurations.libsUpgradeCli)
}
}
}
modulesFiles = { platform ->
copySpec {
eachFile {
if (it.relativePath.segments[-2] == 'bin' || (platform == 'darwin-x64' && it.relativePath.segments[-2] == 'MacOS')) {
// bin files, wherever they are within modules (eg platform specific) should be executable
// and MacOS is an alternative to bin on macOS
it.mode = 0755
} else {
it.mode = 0644
}
}
def buildModules = buildModulesTaskProvider
List excludePlatforms = ['darwin-x64', 'freebsd-x64', 'linux-x64', 'linux-arm64', 'linux-s390x', 'linux-ppc64le', 'windows-x64', 'darwin-arm64']
if (platform != null) {
excludePlatforms.remove(excludePlatforms.indexOf(platform))
} else {
excludePlatforms = []
}
from(buildModules) {
for (String excludePlatform : excludePlatforms) {
exclude "**/platform/${excludePlatform}/**"
}
}
if (BuildParams.isSnapshotBuild()) {
from(buildExternalTestModulesTaskProvider)
}
if (project.path.startsWith(':distribution:packages') || ['freebsd-x64','linux-x64', 'linux-arm64'].contains(platform)) {
from(buildSystemdModuleTaskProvider)
}
}
}
transportModulesFiles = copySpec {
from buildTransportModulesTaskProvider
}
configFiles = { distributionType, java ->
copySpec {
with copySpec {
// main config files, processed with distribution specific substitutions
from '../src/config'
exclude 'log4j2.properties' // this is handled separately below
MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, java))
}
from project(':distribution').buildLog4jConfig
from project(':distribution').buildConfig
}
}
binFiles = { distributionType, java ->
copySpec {
// non-windows files, for all distributions
with copySpec {
from '../src/bin'
exclude '*.exe'
exclude '*.bat'
eachFile { it.setMode(0755) }
MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, java))
}
// windows files, only for zip
if (distributionType == 'zip') {
with copySpec {
from '../src/bin'
include '*.bat'
filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf'))
MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, java))
}
with copySpec {
from '../src/bin'
include '*.exe'
}
}
// module provided bin files
with copySpec {
eachFile { it.setMode(0755) }
from project(':distribution').buildBin
if (distributionType != 'zip') {
exclude '*.bat'
}
}
}
}
noticeFile = { java ->
copySpec {
if (project.name == 'integ-test-zip') {
from buildServerNoticeTaskProvider
} else {
if (java != JavaPackageType.NONE) {
from buildNoticeTaskProvider
} else {
from buildNoJdkNoticeTaskProvider
}
}
}
}
jdkFiles = { Project project, String platform, String architecture ->
return copySpec {
/*
* Jdk uses aarch64 from ARM. Translating from arm64 to aarch64 which Jdk understands.
*/
if ("arm64".equals(architecture)) {
architecture = "aarch64"
}
from project.jdks."bundled_jdk_${platform}_${architecture}"
exclude "demo/**"
/*
* The Contents/MacOS directory interferes with notarization, and is unused by our distribution, so we exclude
* it from the build.
*/
if ("darwin".equals(platform)) {
exclude "Contents/MacOS"
}
eachFile { FileCopyDetails details ->
if (details.relativePath.segments[-2] == 'bin' || details.relativePath.segments[-1] == 'jspawnhelper') {
details.mode = 0755
}
if (details.name == 'src.zip') {
details.exclude()
}
}
}
}
jreFiles = { Project project, String platform, String architecture ->
return copySpec {
/*
* Jdk uses aarch64 from ARM. Translating from arm64 to aarch64 which Jdk understands.
*/
if ("arm64".equals(architecture)) {
architecture = "aarch64"
}
from project.jres."bundled_jre_${platform}_${architecture}"
exclude "demo/**"
/*
* The Contents/MacOS directory interferes with notarization, and is unused by our distribution, so we exclude
* it from the build.
*/
if ("darwin".equals(platform)) {
exclude "Contents/MacOS"
}
eachFile { FileCopyDetails details ->
if (details.relativePath.segments[-2] == 'bin' || details.relativePath.segments[-1] == 'jspawnhelper') {
details.mode = 0755
}
}
}
}
}
}

@AlexRuiz7
Copy link
Member Author

The packageDescription metadata is not included in any of the packages.

@wazuhci wazuhci moved this from In progress to Done in Release 4.9.0 Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/change Change performed in a resource or Wazuh Cloud environment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant