Skip to content

Commit

Permalink
Added Automate version replace on packages
Browse files Browse the repository at this point in the history
  • Loading branch information
okynos committed Nov 26, 2023
1 parent 67510a4 commit 391e770
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/deb/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pkg_dir="${sources_dir}/pkg/deb"

mkdir -p ${sources_dir}
cp -R ${base_dir}/* ${sources_dir}/
sed -i "s|FIM_VERSION|${version}|g" ${sources_dir}/pkg/fim.1

# Generating directory structure to build the .deb package
cd ${build_dir} && tar -czf ${pkg_name}.orig.tar.gz "${pkg_name}"
Expand Down
4 changes: 2 additions & 2 deletions pkg/fim.1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.\" *
.\" **************************************************************************
.\"
.TH fim 1 "01 Jun 2022" "FIM 0.5.0" "FIM Manual"
.TH fim 1 "01 Jun 2022" "FIM FIM_VERSION" "FIM Manual"

.SH NAME
.B FIM
Expand Down Expand Up @@ -62,7 +62,7 @@ The events are stored in /var/lib/fim/events.json
.SH COPYRIGHT
.PP
Copyright 2021 Achiefs. All rights reserved
https://achiefs.github.io/fim/
https://achiefs.com/

.SH CREDITS
.PP
Expand Down
2 changes: 2 additions & 0 deletions pkg/msi/builder.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
$version = (gc ..\..\Cargo.toml | findstr "version" | select -First 1).split(" ")[2].trim("`"", " ")

(Get-Content .\fim.wxs) -replace 'FIM_VERSION', $version | Set-Content -NoNewLine fim.wxs

cd ..\..\
cargo build --release
cd pkg\msi
Expand Down
2 changes: 1 addition & 1 deletion pkg/msi/fim.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='File Integrity Monitor' Manufacturer='Achiefs LLC.' Id='*'
UpgradeCode='5b9136b1-f19d-4af0-9efe-356fabdf1467'
Language='1033' Codepage='1252' Version='0.5.0'>
Language='1033' Codepage='1252' Version='FIM_VERSION'>
<Package Id='*' Keywords='Installer'
Description="FIM is a Host-based file monitoring tool that performs file system analysis and real time alerting."
Comments='FIM is an open source application, coded in Rust.'
Expand Down
1 change: 1 addition & 0 deletions pkg/rpm/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mkdir -p ${rpm_build_dir}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
# Prepare the sources directory to build the source tar.gz
mkdir -p ${sources_dir}
cp -R ../../* ${sources_dir}
sed -i "s|FIM_VERSION|${version}|g" ${sources_dir}/pkg/fim.1

cp ${brand}.spec ${rpm_build_dir}/SPECS/${pkg_name}.spec

Expand Down

0 comments on commit 391e770

Please sign in to comment.