-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: add native debian package
For development purposes, add native debian packaging. - Add debian package metadata to /packaging/debian - Add build-deb.sh to /scripts/ to build the debs - Add github workflow to validate debs Signed-off-by: Chris Patterson <[email protected]>
- Loading branch information
Showing
9 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Debian Packaging CI | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-22.04] | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.sha }} | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- name: Get tags from upstream, if needed | ||
if: github.repository != 'Azure/azure-nvme-utils' | ||
run: | | ||
git remote add upstream https://github.com/Azure/azure-nvme-utils.git | ||
git fetch upstream --tags | ||
- name: Setup | ||
run: | | ||
sudo apt update | ||
sudo apt install gcc pandoc cmake devscripts debhelper -y | ||
- name: Build debs | ||
run: | | ||
DEBEMAIL="Azure NVMe Utils CI <azure/[email protected]>" ./scripts/build-deb.sh | ||
- name: Lintian check | ||
run: | | ||
lintian out/*.deb | ||
- name: Install debs | ||
run: | | ||
sudo dpkg -i out/*.deb | ||
- name: Verify installation | ||
run: | | ||
set -x | ||
dpkg -L azure-nvme-utils | ||
test -f /usr/share/man/man1/azure-nvme-id.1.gz | ||
test -f /usr/sbin/azure-nvme-id | ||
test -f /lib/udev/rules.d/80-azure-nvme.rules | ||
azure-nvme-id --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Source: azure-nvme-utils | ||
Section: utils | ||
Priority: optional | ||
Maintainer: Chris Patterson <[email protected]> | ||
Build-Depends: cmake, pandoc, debhelper-compat (= 12) | ||
Standards-Version: 4.5.0 | ||
Homepage: https://github.com/Azure/azure-nvme-utils | ||
Rules-Requires-Root: no | ||
|
||
Package: azure-nvme-utils | ||
Architecture: any | ||
Multi-Arch: foreign | ||
Depends: ${misc:Depends}, ${shlibs:Depends} | ||
Description: Utilities to assist managing NVMe devices on Azure | ||
This package provides azure-nvme-id for NVMe device identification and udev | ||
rules to provide symlinks using available identifiers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: azure-nvme-utils | ||
Upstream-Contact: https://github.com/Azure/azure-nvme-utils/issues | ||
Source: https://github.com/Azure/azure-nvme-utils | ||
|
||
Files: * | ||
Copyright: 2024 Microsoft Corporation | ||
License: Expat | ||
|
||
License: Expat | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
. | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/make -f | ||
export DH_VERBOSE = 1 | ||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all | ||
export DEB_CFLAGS_MAINT_APPEND = -Wall -Werror -Wextra | ||
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed | ||
|
||
%: | ||
dh $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (native) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
source: no-nmu-in-changelog | ||
source: source-nmu-has-incorrect-version-number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
|
||
project_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
git_version="$(git describe --tags --always --dirty)" | ||
git_ref="$(echo "${git_version}" | sed 's/.*-g//' | sed 's/-dirty/DIRTY/')" | ||
deb_version="$(echo "${git_version}" | sed 's/^v//' | sed 's/-.*//')+git${git_ref}" | ||
output_dir="${project_dir}/out" | ||
|
||
echo "project root: $project_dir" | ||
echo "project version: $git_version" | ||
|
||
cd "$project_dir" | ||
mkdir -p debian | ||
rsync -a packaging/debian/. debian/. | ||
|
||
rm -f debian/changelog | ||
if [[ -z ${DEBEMAIL:-} ]]; then | ||
git_user="$(git config user.name)" | ||
git_email="$(git config user.email)" | ||
export DEBEMAIL="${git_user} <${git_email}>" | ||
fi | ||
dch --create -v "${deb_version}" --package "azure-nvme-utils" "development build: ${git_version}" | ||
|
||
debuild --no-tgz-check | ||
|
||
mkdir -p "${output_dir}" | ||
rm -f "${output_dir}"/*.deb | ||
mv ../azure-nvme-utils*"${deb_version}"* "${output_dir}"/ |