Skip to content

Commit

Permalink
Changed the way to get current version
Browse files Browse the repository at this point in the history
  • Loading branch information
okynos committed Jan 14, 2022
1 parent 0343184 commit f556144
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions indexer/rpm/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ else
if [ "${spec_reference}" ];then
version=$(curl -sL https://raw.githubusercontent.com/wazuh/wazuh-packages/${spec_reference}/indexer/rpm/${target}.spec | egrep -o -m 1 '[0-9]+\.[0-9]+\.[0-9]+')
else
version=$(egrep -o -m 1 '[0-9]+\.[0-9]+\.[0-9]+' /root/indexer/rpm/${target}.spec)
version=$(cat /root/VERSION)
fi
fi

Expand All @@ -44,7 +44,6 @@ mkdir -p ${rpm_build_dir}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
pkg_name=${target}-${version}
mkdir ${build_dir}/${pkg_name}


# Including spec file
if [ "${spec_reference}" ];then
curl -sL https://github.com/wazuh/wazuh-packages/tarball/${spec_reference} | tar zx
Expand All @@ -54,16 +53,11 @@ else
cp /root/indexer/rpm/${target}.spec ${rpm_build_dir}/SPECS/${pkg_name}.spec
fi

if [ "${future}" = "yes" ];then
sed -i '/Version:/,/License:/s|[0-9]\+.[0-9]\+.[0-9]\+|99.99.0|' ${rpm_build_dir}/SPECS/${pkg_name}.spec
fi


# Generating source tar.gz
cd ${build_dir} && tar czf "${rpm_build_dir}/SOURCES/${pkg_name}.tar.gz" "${pkg_name}"

# Building RPM
/usr/bin/rpmbuild --define "_topdir ${rpm_build_dir}" \
/usr/bin/rpmbuild --define "_topdir ${rpm_build_dir}" --define "_version ${version}" \
--define "_release ${release}" --define "_localstatedir ${directory_base}" \
--target ${architecture} -ba ${rpm_build_dir}/SPECS/${pkg_name}.spec

Expand Down
4 changes: 2 additions & 2 deletions indexer/rpm/wazuh-indexer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Foundation.
Summary: Wazuh indexer is a search and analytics engine for security-related data. Documentation can be found at https://documentation.wazuh.com/current/getting-started/components/wazuh-indexer.html
Name: wazuh-indexer
Version: 4.3.0
Version: %{_version}
Release: %{_release}
License: GPL
Group: System Environment/Daemons
Expand Down Expand Up @@ -150,7 +150,7 @@ rm -fr %{buildroot}
# -----------------------------------------------------------------------------

%changelog
* Mon Jan 10 2022 support <[email protected]> - 4.3.0
* Mon Jan 10 2022 support <[email protected]> - %{version}
- More info: https://documentation.wazuh.com/current/release-notes/

# -----------------------------------------------------------------------------
Expand Down

0 comments on commit f556144

Please sign in to comment.