Skip to contentSkip to conversation

Add Debian packaging scripts and templates

PATCH In review ramesh.thomas at intel.com 2 participants 4 messages Apr 18, 2021 – Apr 19, 2021

lore
Share & tools
lore

ramesh.thomas at intel.com

#0 lore raw

cover Add Debian packaging scripts and templates

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

These patches add scripts and templates to crate Debian packaging components. The templates are stored in 'debian' subfolder. 'debdch.sh' script will update the debian/changelog file with git commits since last release till the latest release in stable branch. 'debbuild.sh' script will build the package and put the components in 'debpkg' subfolder.

README.md is updated with documentation of debian build steps and resolving dependencies.

Following packages are created along with other components necessary for upload to debian.org.
- accel-config (configuration tool)
- libaccel-config (libraries)
- libaccel-config-dev (library and headers for development)
- accel-config-test (test application and configurations)

Ramesh Thomas (2):
accel-config: Add debian template files and package creations scripts
accel-config: Update README with Debian packaging documentation

 README.md                          | 32 +++++++++++++++
 debbuild.sh                        | 64 ++++++++++++++++++++++++++++++
 debdch.sh                          | 45 +++++++++++++++++++++
 debian/accel-config-test.install   |  1 +
 debian/accel-config.install        |  3 ++
 debian/changelog                   |  5 +++
 debian/control                     | 59 +++++++++++++++++++++++++++
 debian/copyright                   | 46 +++++++++++++++++++++
 debian/libaccel-config-dev.install |  3 ++
 debian/libaccel-config.install     |  1 +
 debian/rules                       | 45 +++++++++++++++++++++
 debian/source/format               |  1 +
 12 files changed, 305 insertions(+)
 create mode 100755 debbuild.sh
 create mode 100755 debdch.sh
 create mode 100644 debian/accel-config-test.install
 create mode 100644 debian/accel-config.install
 create mode 100644 debian/changelog
 create mode 100644 debian/control
 create mode 100644 debian/copyright
 create mode 100644 debian/libaccel-config-dev.install
 create mode 100644 debian/libaccel-config.install
 create mode 100644 debian/rules
 create mode 100644 debian/source/format
Signature · 1 line
2.26.3
#1 lore raw

PATCH 1/2 accel-config: Add debian template files and package creations scripts

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Adds template files in 'debian' subfolder which will be used by the added scripts to create debian packaging components.

debdch.sh script updates the changelog template file with git commits since the last release. The changelog file can be edited before building the package.

debbuild.sh script pulls the latest released tag from stable branch and uses the template to build the debian package. It will do the build in a temporary work directory and finally move the debian package components to 'debpkg' subfolder.

Following packages are created along with other components necessary for upload to debian.org.
- accel-config (configuration tool)
- libaccel-config (libraries)
- libaccel-config-dev (library and headers for development)
- accel-config-test (test application and configurations)

Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>
---
 debbuild.sh                        | 64 ++++++++++++++++++++++++++++++
 debdch.sh                          | 45 +++++++++++++++++++++
 debian/accel-config-test.install   |  1 +
 debian/accel-config.install        |  3 ++
 debian/changelog                   |  5 +++
 debian/control                     | 59 +++++++++++++++++++++++++++
 debian/copyright                   | 46 +++++++++++++++++++++
 debian/libaccel-config-dev.install |  3 ++
 debian/libaccel-config.install     |  1 +
 debian/rules                       | 45 +++++++++++++++++++++
 debian/source/format               |  1 +
 11 files changed, 273 insertions(+)
 create mode 100755 debbuild.sh
 create mode 100755 debdch.sh
 create mode 100644 debian/accel-config-test.install
 create mode 100644 debian/accel-config.install
 create mode 100644 debian/changelog
 create mode 100644 debian/control
 create mode 100644 debian/copyright
 create mode 100644 debian/libaccel-config-dev.install
 create mode 100644 debian/libaccel-config.install
 create mode 100644 debian/rules
 create mode 100644 debian/source/format
debbuild.sh new file +64 -0
new file mode 100755
index 0000000..afa3c81
@@ -0,0 +1,64 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright(c) 2021 Intel Corporation. All rights reserved.
+
+set -e
+
+[ -z "${DEBEMAIL}" ] || [ -z "${DEBFULLNAME}" ] && {
+	echo
+	echo "Please set following environment variables"
+	echo
+	echo 'DEBEMAIL="your.email.address(a)example.org"'
+	echo 'DEBFULLNAME="Firstname Lastname"'
+	echo
+	exit
+}
+
+NAME=accel-config
+REPODIR=idxd-config
+REFDIR=$(pwd)
+UPSTREAM=$REFDIR #TODO update once we have a public upstream
+PKGDIR=debpkg
+
+WORKDIR="$(mktemp -d --tmpdir "$NAME.XXXXXXXXXX")"
+trap 'rm -rf $WORKDIR' exit
+
+[ -d "$REFDIR" ] && REFERENCE="--reference $REFDIR"
+
+echo
+ch_entry=$(grep accel-config debian/changelog | head -n1)
+echo Last entry in debian/changelog = \"$ch_entry\"
+
+read -r -p 'Build package for this version? [y/N)] ' res
+if [[ ! "$res" =~ [yY](es)* ]]
+then
+	echo
+	echo "Please run ./debdch.sh or dch -r to update debian/changelog"
+	echo
+	exit
+fi
+
+dch -r ""
+
+pushd $WORKDIR
+
+git clone $REFERENCE "$UPSTREAM" $REPODIR
+
+cp -r $REFDIR/deb* $REPODIR #temporary till initial commit
+
+cd $REPODIR
+
+debmake -t
+DEB_BUILD_OPTIONS=nocheck debuild -us -uc
+
+popd
+
+rm -rf $PKGDIR
+mkdir $PKGDIR
+rm -rf $WORKDIR/*/
+cp -r $WORKDIR/* $PKGDIR
+
+echo
+echo "!!!Debian package created in ./$PKGDIR and is ready for upload!!!"
+echo "***debian/changelog was updated - please commit the changes***"
+echo
debdch.sh new file +45 -0

45 lines not on this page · raw message

debian/accel-config-test.install new file +1 -0
new file mode 100644
index 0000000..0045205
@@ -0,0 +1 @@
+usr/share/accel-config/test/*
debian/accel-config.install new file +3 -0
new file mode 100644
index 0000000..9654745
@@ -0,0 +1,3 @@
+etc/accel-config/accel-config.conf.sample
+usr/bin/accel-config
+usr/share/man/man1/accel-config*
debian/changelog new file +5 -0
new file mode 100644
index 0000000..f59d23f
@@ -0,0 +1,5 @@
+accel-config (3.1-1) unstable; urgency=medium
+
+  * Initial release.
+
+ -- Ramesh Thomas <ramesh.thomas(a)intel.com>  Sat, 17 Apr 2021 13:26:27 -0700
debian/control new file +59 -0

59 lines not on this page · raw message

debian/copyright new file +46 -0

46 lines not on this page · raw message

debian/libaccel-config-dev.install new file +3 -0
new file mode 100644
index 0000000..9e1ee07
@@ -0,0 +1,3 @@
+usr/include/accel-config/
+usr/lib/libaccel-config.so
+usr/lib/pkgconfig/libaccel-config.pc
debian/libaccel-config.install new file +1 -0
new file mode 100644
index 0000000..9393217
@@ -0,0 +1 @@
+usr/lib/libaccel-config.so.*
debian/rules new file +45 -0

45 lines not on this page · raw message

debian/source/format new file +1 -0
new file mode 100644
index 0000000..163aaf8
@@ -0,0 +1 @@
+3.0 (quilt)
Signature · 1 line
2.26.3
#2 lore raw

PATCH 2/2 accel-config: Update README with Debian packaging documentation

In reply to ramesh.thomas at intel.com

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Add list of dependencies that needs to be installed Add details to install DSA kernel header
Describe debian package building steps and post build actions

Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>
---
 README.md | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
README.md +32 -0
index cc634fb..aaee01f 100644
@@ -5,11 +5,25 @@ sub-system in the Linux kernel
 
 ## Resolve dependencies
 
+### Fedora, RHEL, CentOS
 ```bash
 yum groupinstall "Development Tools"
 yum install autoconf automake libtool pkgconf rpm-build rpmdevtools
 yum install asciidoc xmlto libuuid-devel json-c-devel kmod-devel libudev-devel
 ```
+### Debian
+```bash
+apt install build-essential
+apt install autoconf automake autotools-dev libtool pkgconf asciidoc xmlto
+apt install uuid-dev libjson-c-dev libkmod-dev libudev-dev libkeyutils-dev
+apt install debhelper devscripts debmake quilt fakeroot lintian asciidoctor
+apt install file gnupg patch patchutils
+```
+### DSA Kernel headers
+Run following in kernel source folder
+```bash
+sudo make headers_install INSTALL_HDR_PATH=/usr
+````
 
 ## Build
 
@@ -56,3 +70,21 @@ make rhel/accfg-test.spec
 There are a number of packages required for the build steps that may not
 be installed by default. For information about the required packages,
 see the "BuildRequires:" lines in accfg.spec.in and accfg-test.spec.in.
+
+## Build Debian Package
+```bash
+export DEBEMAIL="your.email(a)example.org"
+export DEBFULLNAME="Firstname Lastname"
+./autogen.sh
+./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc \
+    --libdir=/usr/lib64 --enable-test=yes
+
+./debdch.sh
+(Run dch -r and edit debian/changelog as necessary)
+
+./debbuild.sh
+
+Debian package components would be created in ./debpkg
+
+debian/changelog changes should be committed
+```
Signature · 1 line
2.26.3
Reviewed-by on the v1 series
#3 lore raw
In reply to ramesh.thomas at intel.com
Quoted 11 lines · ramesh.thomas(a)intel.com

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

These patches add scripts and templates to crate Debian packaging components. The templates are stored in 'debian' subfolder. 'debdch.sh' script will update the debian/changelog file with git commits since last release till the latest release in stable branch. 'debbuild.sh' script will build the package and put the components in 'debpkg' subfolder.

README.md is updated with documentation of debian build steps and resolving dependencies.

Quoted 6 lines

Following packages are created along with other components necessary for upload to debian.org.
- accel-config (configuration tool)
- libaccel-config (libraries)
- libaccel-config-dev (library and headers for development)
- accel-config-test (test application and configurations)

Reviewed-by Dave Jiang <dave.jiang(a)intel.com>
Quoted 30 lines

Ramesh Thomas (2):
accel-config: Add debian template files and package creations scripts
accel-config: Update README with Debian packaging documentation

  README.md                          | 32 +++++++++++++++
  debbuild.sh                        | 64 ++++++++++++++++++++++++++++++
  debdch.sh                          | 45 +++++++++++++++++++++
  debian/accel-config-test.install   |  1 +
  debian/accel-config.install        |  3 ++
  debian/changelog                   |  5 +++
  debian/control                     | 59 +++++++++++++++++++++++++++
  debian/copyright                   | 46 +++++++++++++++++++++
  debian/libaccel-config-dev.install |  3 ++
  debian/libaccel-config.install     |  1 +
  debian/rules                       | 45 +++++++++++++++++++++
  debian/source/format               |  1 +
  12 files changed, 305 insertions(+)

create mode 100755 debbuild.sh
create mode 100755 debdch.sh
create mode 100644 debian/accel-config-test.install create mode 100644 debian/accel-config.install create mode 100644 debian/changelog
create mode 100644 debian/control
create mode 100644 debian/copyright
create mode 100644 debian/libaccel-config-dev.install create mode 100644 debian/libaccel-config.install create mode 100644 debian/rules
create mode 100644 debian/source/format