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
diff --git a/debbuild.sh b/debbuild.sh
new file mode 100755
index 0000000..afa3c81
--- /dev/null
+++ b/debbuild.sh
@@ -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
diff --git a/debdch.sh b/debdch.sh
new file mode 100755
index 0000000..3e6d3ce
--- /dev/null
+++ b/debdch.sh
@@ -0,0 +1,45 @@
+#!/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
+}
+
+[ -n "$1" ] && REVISION=$1 || REVISION=1
+
+VERSION=$(echo $(./git-version) | sed 's/\.git.*//')
+DEB_VERSION=$VERSION-$REVISION
+
+echo
+echo "Updating debian/changelog.."
+echo "accel-config version = $VERSION"
+echo "Debian revision = $REVISION"
+echo "New version = $DEB_VERSION"
+echo
+echo "Adding changes..."
+echo
+
+dch -v $DEB_VERSION --package accel-config -D unstable ""
+cur_release=$(git describe --tags --abbrev=0)
+prev_release=$(git describe --tags --abbrev=0 $cur_release^)
+git log $prev_release..$cur_release --pretty=format:"%s" -i -E \
+ --invert-grep --grep=release 2>/dev/null |
+ while IFS= read -r line;
+ do
+ line=$(echo $line | sed -e "s/^accel-config: //")
+ dch -a "$line" 2>/dev/null
+ echo "* $line"
+ done
+
+echo
+echo Please run "dch -r" to review and update debian/changelog before building
package
+echo
diff --git a/debian/accel-config-test.install b/debian/accel-config-test.install
new file mode 100644
index 0000000..0045205
--- /dev/null
+++ b/debian/accel-config-test.install
@@ -0,0 +1 @@
+usr/share/accel-config/test/*
diff --git a/debian/accel-config.install b/debian/accel-config.install
new file mode 100644
index 0000000..9654745
--- /dev/null
+++ b/debian/accel-config.install
@@ -0,0 +1,3 @@
+etc/accel-config/accel-config.conf.sample
+usr/bin/accel-config
+usr/share/man/man1/accel-config*
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..f59d23f
--- /dev/null
+++ b/debian/changelog
@@ -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
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..fcac5a9
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,59 @@
+Source: accel-config
+Maintainer: Ramesh Thomas <ramesh.thomas(a)intel.com>
+Section: libs
+Priority: optional
+Standards-Version: 4.4.1
+Homepage:
https://github.com/intel/idxd-config
+Vcs-Browser:
https://salsa.debian.org/debian/idxd-config
+Vcs-Git:
https://salsa.debian.org/debian/idxd-config.git
+Rules-Requires-Root: no
+Build-Depends: asciidoctor,
+ debhelper-compat (= 12),
+ libjson-c-dev,
+ libkeyutils-dev,
+ libkmod-dev,
+ libudev-dev,
+ pkg-config,
+ uuid-dev
+
+Package: accel-config
+Section: misc
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Description: Utility for configuring the DSA subsystem
+ Intel Accelerator Utilities (accel-config) provides a user interface to the
+ Intel Data Streaming Accelerator (DSA). DSA is a high-performance data copy
+ and transformation accelerator integrated into Intel Xeon processors.
+ .
+ This package contains a utility for configuring the DSA (Data Stream
+ Accelerator) subsystem in the Linux kernel.
+
+Package: libaccel-config
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Utility library wrapping the Intel DSA sysfs ABI. It provides
+ access to work queues by using the mmap portal from the character device and
+ send work to the accelerator. It also provides interfaces to manage virtual DSA
+ devices exposed by the driver to the guest via VFIO mediated device framework.
+ .
+ This package contains a utility library for managing the DSA (Data Stream
+ Accelerator) subsystem in the Linux kernel.
+
+Package: libaccel-config-dev
+Section: libdevel
+Architecture: linux-any
+Depends: libaccel-config (= ${binary:Version}), ${misc:Depends}
+Description: Development files for libaccel-config
+ Header files and development library for compiling C programs to link with the
+ libaccel-config library and manage the DSA subsystem in the Linux kernel.
+
+Package: accel-config-test
+Section: misc
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Description: Utility to test the DSA subsystem
+ This utility has test cases that exercise the DSA subsysem. It uses
+ libaccel-config API to configure workqueues and issues ENQCMD and MOVDIR64
+ instructions to move memory.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..bdff1b0
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,46 @@
+Format:
https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: idxd-config
+Source:
https://github.com/intel/idxd-config
+
+Files: *
+Copyright: 2021 Intel Corporation
+License: LGPLv2.1
+
+Files: accfg/lib/*
+Copyright: 2021 Intel Corporation
+License: LGPLv2.1
+
+Files: accfg/*
+ Documentation/*
+ util/*
+ test/*
+Copyright: 2021 Intel Corporation
+License: GPLv2
+
+Files: debian/*
+Copyright: 2021 Intel Corporation
+License: GPL-2+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <
https://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
+# Please avoid picking licenses with terms that are more restrictive than the
+# packaged work, as it may make Debian's contributions unacceptable upstream.
+#
+# If you need, there are some extra license texts available in two places:
+# /usr/share/debhelper/dh_make/licenses/
+# /usr/share/common-licenses/
diff --git a/debian/libaccel-config-dev.install b/debian/libaccel-config-dev.install
new file mode 100644
index 0000000..9e1ee07
--- /dev/null
+++ b/debian/libaccel-config-dev.install
@@ -0,0 +1,3 @@
+usr/include/accel-config/
+usr/lib/libaccel-config.so
+usr/lib/pkgconfig/libaccel-config.pc
diff --git a/debian/libaccel-config.install b/debian/libaccel-config.install
new file mode 100644
index 0000000..9393217
--- /dev/null
+++ b/debian/libaccel-config.install
@@ -0,0 +1 @@
+usr/lib/libaccel-config.so.*
diff --git a/debian/rules b/debian/rules
new file mode 100644
index 0000000..2313f63
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,45 @@
+#!/usr/bin/make -f
+
+export DH_VERBOSE = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+%:
+ dh $@
+
+override_dh_autoreconf:
+ dh_autoreconf ./autogen.sh
+
+override_dh_auto_configure:
+ dh_auto_configure -- CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --enable-test=yes
+
+override_dh_clean:
+ #removing files generated by autogen.sh
+ rm -fr build-aux/
+ rm -fr m4/*
+ rm -fr Documentation/Makefile.in
+ rm -fr Makefile.in
+ rm -fr aclocal.m4
+ rm -fr autom4te.cache
+ rm -fr config.h.in
+ rm -fr configure
+ rm -fr accfg/lib/Makefile.in
+ rm -fr accfg/Makefile.in
+ rm -fr test/Makefile.in
+ # created by tests and not cleaned up after
+ rm -fr version.m4
+ rm -fr Documentation/accfg/asciidoc.conf
+ rm -fr Documentation/accfg/Makefile.in
+ rm -fr config.log
+ dh_clean
+
+override_dh_install:
+ find debian/tmp -name '*.la' -print -delete
+ dh_install
+
+override_dh_makeshlibs:
+ dh_makeshlibs -- -c4
+
+#override_dh_missing:
+ dh_missing --fail-missing
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
--
2.26.3