Skip to content

Commit

Permalink
build: add make deb target for test packaging
Browse files Browse the repository at this point in the history
Problem: We have 'make deb' for testing flux-core and flux-sched,
but not flux-pmix.

Copy the scripts and metadata added by Mark Grondona to flux-core in

flux-framework/flux-core@a0b0bad

and customize them for this project.
  • Loading branch information
garlick committed Jul 13, 2023
1 parent 28e9b88 commit 9451bee
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ CODE_COVERAGE_IGNORE_PATTERN = \

CODE_COVERAGE_LCOV_OPTIONS =
@CODE_COVERAGE_RULES@

export DEB_BUILD_OPTIONS ?= nocheck terse
deb: debian scripts/debbuild.sh
@$(top_srcdir)/scripts/debbuild.sh $(abs_top_srcdir)

clean-local:
@rm -rf debbuild
Empty file added debian/README.Debian
Empty file.
Empty file added debian/README.source
Empty file.
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
22 changes: 22 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Source: flux-pmix
Section: devel
Priority: optional
Maintainer: Jim Garlick <[email protected]>
Standards-Version: 4.1.2
Build-Depends:
debhelper (>= 10),
flux-core (>= 0.49.0),
libjansson-dev (>= 2.10),
libpmix-dev (>= 3.2.3)

Homepage: https://github.com/flux-framework/flux-pmix
Package: flux-pmix
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: pmix support for the Flux resource manager framework
flux-pmix provides a Flux shell plugin that adds pmix service to the flux
shell for launching some versions of openmpi, and a Flux PMI client plugin
that enables Flux to be launched by a foreign launcher that only supports
pmix.
Note: This package is for testing purposes only and may not comply
with all Debian packaging guidelines.
45 changes: 45 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: flux-core
Source: <https://github.com/flux-framework/flux-core>

Files: *
Copyright: 2014-2023 Lawrence Livermore National Security
License: LGPL-3+

Files: src/common/libtap/*
Copyright: Copyright (c) the Contributors as noted in the AUTHORS file.
License: LGPL

Files: src/common/libccan/*
Copyright: Rusty Russell <[email protected]>
License: CC0

Files: src/common/libccan/base64/*
Copyright: Rusty Russell <[email protected]>
License: BSD-MIT

Files: t/sharness.sh
Copyright: Copyright (c) 2011-2012 Mathias Lafeldt
Copyright (c) 2005-2012 Git project
Copyright (c) 2005-2012 Junio C Hamano
Copyright (c) 2019-2023 Felipe Contreras
License: GPL-2.0

Files: debian/*
Copyright: 2023 Jim Garlick <garlick.jim@unknown>
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".
26 changes: 26 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
dh $@

override_dh_auto_configure:
PYTHON_VERSION=3 dh_auto_configure --

override_dh_autoreconf:
@echo not running autogen.sh on dist product

override_dh_auto_install:
dh_auto_install
find . -name '*.la' -delete
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
41 changes: 41 additions & 0 deletions scripts/debbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh
PACKAGE=flux-pmix
USER=$(git config --get user.name)
DEBFULLNAME=$USER
EMAIL=$(git config --get user.email)
DEBEMAIL=$EMAIL

SRCDIR=${1:-$(pwd)}

die() { echo "debbuild: $@" >&2; exit 1; }
log() { echo "debbuild: $@"; }

test -z "$USER" && die "User name not set in git-config"
test -z "$EMAIL" && die "User email not set in git-config"

log "Running make dist"
make dist >/dev/null || exit 1

log "Building package from latest dist tarball"
tarball=$(ls -tr *.tar.gz | tail -1)
version=$(echo $tarball | sed "s/${PACKAGE}-\(.*\)\.tar\.gz/\1/")

rm -rf debbuild
mkdir -p debbuild && cd debbuild

mv ../$tarball .

log "Unpacking $tarball"
tar xvfz $tarball >/dev/null

log "Creating debian directory and files"
cd ${PACKAGE}-${version}
cp -a ${SRCDIR}/debian . || die "failed to copy debian dir"

export DEBEMAIL DEBFULLNAME
log "Creating debian/changelog"
dch --create --package=$PACKAGE --newversion $version build tree release

log "Running debian-buildpackage -b"
dpkg-buildpackage -b
log "Check debbuild directory for results"

0 comments on commit 9451bee

Please sign in to comment.