Skip to content

Commit

Permalink
Add custom tag in Debian and RPM
Browse files Browse the repository at this point in the history
Signed-off-by: YashTatkondawar <[email protected]>
  • Loading branch information
YashTatkondawar committed Oct 22, 2021
1 parent d450699 commit 47f4468
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions make_deb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ echo -n "Populating the package and updating version file..."
cd "${package_name}"
cp -R ${GIT_ROOT}/packages/Debian/* .
sed -i "s/Version: 0.0.0/Version: ${version}/g" DEBIAN/control
if [[ ${branch_name} = "main" ]] || [[ ${branch_name} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then echo "Build: ${git_tag_info:1}" >> DEBIAN/control; fi
echo "Done."


Expand Down
12 changes: 8 additions & 4 deletions make_rpm
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ fi

version=`cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[" ,]//g'`
BUILD_ROOT="${GIT_ROOT}/packages/build"

git_tag_info=$(git describe --tags | sed 's/-/_/g') && commit_count=$(echo ${git_tag_info} | cut -d_ -f2) || { commit_count=$(git rev-list --count HEAD); git_tag_info="v$version_$commit_count_$(git rev-parse --short HEAD)"; }
branch_name=$(git rev-parse --abbrev-ref HEAD)
if [[ ${branch_name} = "main" ]] || [[ ${branch_name} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then commit_count=1; fi
# Final package name
package_name="fledge-gui-${version}"
package_name="fledge-gui-${version}-${commit_count}"

arch=`arch`

Expand Down Expand Up @@ -129,12 +131,14 @@ cd "${package_name}"
cp -R ${GIT_ROOT}/packages/RPM/* .
sed -i "s/__VERSION__/${version}/g" SPECS/fledge-gui.spec
sed -i "s/__ARCH__/${arch}/g" SPECS/fledge-gui.spec
sed -i "s/__RELEASE__/${commit_count}/g" SPECS/fledge-gui.spec
sed -i "s/__VCS__/${git_tag_info:1}/g" SPECS/fledge-gui.spec
echo "Done."

mkdir BUILDROOT
cd BUILDROOT
mkdir -p ${package_name}-1.${arch}
cd ${package_name}-1.${arch}
mkdir -p ${package_name}.${arch}
cd ${package_name}.${arch}

# sed -i 's/dist/\/usr\/share\/nginx\/html/g' ${GIT_ROOT}/dist/nginx.conf

Expand Down
3 changes: 2 additions & 1 deletion packages/RPM/SPECS/fledge-gui.spec
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Name: fledge-gui
Vendor: Dianomic Systems Inc. <[email protected]>
Version: __VERSION__
Release: 1
Release: __RELEASE__
BuildArch: __ARCH__
Summary: Fledge GUI
License: Apache License
Group: IoT
URL: http://www.dianomic.com
Requires: nginx
VCS: __VCS__

%description
Fledge GUI
Expand Down

0 comments on commit 47f4468

Please sign in to comment.