Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic creation of .deb packages #72

Merged
merged 34 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3f3f228
Updates makefile for CalculiX v2.17
KyleDavisSA Nov 10, 2020
d40944d
Adds adpater files for CalculiX v2.17
KyleDavisSA Nov 10, 2020
22367df
Updates README
KyleDavisSA Nov 10, 2020
7ce9478
Fixes reading preCICE arguments
KyleDavisSA Nov 10, 2020
7ad9d6c
Updates ccx_2.17
KyleDavisSA Nov 10, 2020
2779beb
Added Debian Packaging, updated Makefile
boris-martin Oct 21, 2021
94e1ef4
Updated action to pull the correct branch
boris-martin Oct 21, 2021
f6c0dac
Updated manpage
boris-martin Oct 21, 2021
8042b73
update manpage
boris-martin Oct 21, 2021
c84d066
Fixed bad formatting
boris-martin Oct 21, 2021
5c600b9
Switch to newest non-LTS Ubuntu.
boris-martin Nov 10, 2021
47e5586
Added preCICE version in Github Action
boris-martin Nov 10, 2021
cfc9b25
Update .github/workflows/ubuntu_build.yml
boris-martin Nov 10, 2021
bf53326
Update .github/workflows/ubuntu_build.yml
boris-martin Nov 10, 2021
e6ce2b3
Consistency
boris-martin Nov 10, 2021
42db163
Update packaging/manpage.md
boris-martin Nov 10, 2021
086d97c
--best compression
boris-martin Nov 10, 2021
01db6a6
Updated Copyright notice of the .deb (GPL3)
boris-martin Nov 20, 2021
cbf5519
(Theoretical) compatibility with all versions of preCICE 2.x
boris-martin Nov 20, 2021
2b38dec
Added SHA256 checksum automation
boris-martin Nov 20, 2021
3137b4b
Cleanup (first part)
boris-martin Nov 20, 2021
fb2b9ed
Update manpage.md
boris-martin Nov 21, 2021
eda773a
Improved worfklow flexibility, renamed package
boris-martin Nov 21, 2021
630491e
Update packaging/README.md
boris-martin Nov 21, 2021
6d96c6e
Update README.md
boris-martin Nov 21, 2021
8d733cf
Typo
boris-martin Nov 22, 2021
d65282b
Update README.md
boris-martin Nov 22, 2021
2e0f961
various refromulations
boris-martin Dec 5, 2021
0f7b24a
Workflow cleanup
boris-martin Dec 5, 2021
8c1cbd3
Update manpage
boris-martin Dec 5, 2021
f65ab77
update copyright
boris-martin Dec 5, 2021
6595587
Update packaging/manpage.md
boris-martin Dec 8, 2021
fd179a8
Merge branch 'v2.17' into debian_packaging_PR
MakisH Dec 13, 2021
3f9f2d1
Update package description
boris-martin Dec 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Calculix 2.17 with preCICE adapter test build

on: [push, pull_request]

jobs:
build:

strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
include:
- os: ubuntu-18.04
name: bionic
- os: ubuntu-20.04
name: focal
runs-on: ${{matrix.os}}
continue-on-error: true
env: # Versioning is "calculix-preciceX_2.YY-Z[...]" with X the major preCICE version, YY the minor CCX version and Z the package version
PACKAGE_NAME: "calculix-precice2_2.17-1_amd64"

steps:
- name: Update system
run: sudo apt update && sudo apt upgrade -y
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get preCICE v2.3.0
run: wget https://github.com/precice/precice/releases/download/v2.3.0/libprecice2_2.3.0_${{matrix.name}}.deb &&
sudo apt install ./libprecice2_2.3.0_${{matrix.name}}.deb -y
- name: install dependencies
run: sudo apt install libarpack2-dev libspooles-dev libyaml-cpp-dev -y
- name: Download CalculiX
run: wget http://www.dhondt.de/ccx_2.17.src.tar.bz2
- name: Unpack Calculix
run: tar -xjf ccx_2.17.src.tar.bz2
- name: make
run: make -j 4 CCX="./CalculiX/ccx_2.17/src"
- name: Test run
run: ./bin/ccx_preCICE -h
- name: Download tools for packaging
run: sudo apt install lintian pandoc -y
- name: Create Debian Package
run: |
mkdir -p "packaging/calculix-precice2_2.17-1_amd64/usr/bin" &&
cp ./bin/ccx_preCICE ./packaging/calculix-precice2_2.17-1_amd64/usr/bin/ccx_preCICE &&
cd packaging && pwd && bash ./make_deb.sh ${{matrix.name}}
- name: Store Debian package artifact
uses: actions/upload-artifact@v2
with:
name: "${{env.PACKAGE_NAME}}_${{matrix.name}}.deb"
path: "packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb"
- name: Compute SHA256 checksum
run: sha256sum "packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb" > "packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb.sha256"
- name: Store SHA256 checksum as artifact
uses: actions/upload-artifact@v2
with:
name: "${{env.PACKAGE_NAME}}_${{matrix.name}}.deb.sha256"
path: "packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb.sha256"
- name: Inspect package with lintian
run: sudo apt install lintian -y && lintian ./packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb
11 changes: 11 additions & 0 deletions packaging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatic packaging of the adapter

This contains the necessary files to build a Debian package containing the adapter. (Built without PaStiX)

## Note for maintainers

- Keep up to date the list of dependencies in the control file with `dpkg-shlibs`. In theory, it will detect preCICE with the version used for the build, so we update it manually to the lowest possible version. For instance, if the adapter is built with preCICE 2.3.0, we update the dependency as >= 2.0.0
- Update the changelog.
- The script `make_deb.sh` compresses the changelog and manpage and puts them at the right places. Building the package should be as simple as running this script.
- Dependencies: `lintian` (to validate the package) and `pandoc` (to generate the `man` page).
- To update CalculiX version: update the Github action workflow file (in `.github/workflows`). Update the `PACKAGE_NAME` variable and the paths (e.g. replace `wget http://www.dhondt.de/ccx_2.17.src.tar.bz2` by `wget http://www.dhondt.de/ccx_2.XX.src.tar.bz2` with XX the corresponding minor version of CalculiX and folder paths). The files `make_deb.sh`, `DEBIAN/control`, `changelog.DEBIAN` and `manpage.md` may require an update too.
14 changes: 14 additions & 0 deletions packaging/calculix-precice2_2.17-1_amd64/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Package: calculix-precice2
Version: 2.17-1
Source: calculix-precice2
Architecture: amd64
Section: contrib/science
Priority: optional
Maintainer: The preCICE team (precice.org) <info@precice.org>
Depends: libarpack2 (>= 2.1), libblas3 | libblas.so.3, libc6 (>= 2.29), libgcc-s1 (>= 4.0), libgfortran5 (>= 8), libgomp1 (>= 4.9), liblapack3 | liblapack.so.3, libprecice2 (>= 2.0.0), libspooles2.2, libstdc++6 (>= 9), libyaml-cpp0.6 (>= 0.6.2)
Bugs: https://github.com/precice/calculix-adapter/issues
Description: Official preCICE adapter for CalculiX.
CalculiX is a Finite Element Method solver for structural mechanics.
The preCICE adapter (ccx_preCICE) allows interfacing with the preCICE library
for multiphysics simulations, while still maintaining backwards
compatibility with the original "ccx" program.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: preCICE
Upstream-Contact: preCICE developers <info@precice.org>
Copyright: (c) 2021 the preCICE developers <info@precice.org>
Source: https://github.com/precice/calculix-adapter

Files: *
Copyright: (c) 2021 the preCICE developers <info@precice.org>
License: GPL-3

Files: *
Copyright: 1998-2015, Guido Dhondt
License: GPL-3
7 changes: 7 additions & 0 deletions packaging/changelog.Debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
calculix-precice (2.17) unstable; urgency=medium
* Initial packaging
* First official Debian package of the CalculiX adapter for preCICE


-- Boris Martin <boris.martin@tum.de> Tue, 19 Oct 2021 22:30:00 +0200

26 changes: 26 additions & 0 deletions packaging/make_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/bash

DISTRIBUTION="_$1"
echo $DISTRIBUTION

# Compress the changelog, strip the binaries
cp changelog.Debian calculix-precice2_2.17-1_amd64/usr/share/doc/calculix-precice2/changelog.Debian
# Options : --best for best compression, -f for removing file if it was there, -n for no time stamp
gzip --best -f -n calculix-precice2_2.17-1_amd64/usr/share/doc/calculix-precice2/changelog.Debian
strip --strip-unneeded calculix-precice2_2.17-1_amd64/usr/bin/ccx_preCICE

#Compile and compress the manual

pandoc manpage.md -s -t man -o ccx_preCICE.1
mkdir -p calculix-precice2_2.17-1_amd64/usr/share/man/man1
gzip -9 -n -f ccx_preCICE.1
chmod 644 ccx_preCICE.1.gz
mv ccx_preCICE.1.gz calculix-precice2_2.17-1_amd64/usr/share/man/man1

# Copy to a folder with appropriate postfix

cp -r calculix-precice2_2.17-1_amd64/ "calculix-precice2_2.17-1_amd64$DISTRIBUTION"

dpkg-deb --build --root-owner-group "calculix-precice2_2.17-1_amd64$DISTRIBUTION"
lintian *.deb

35 changes: 35 additions & 0 deletions packaging/manpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# NAME
ccx_preCICE - Adapter for using CalculiX with the preCICE library.

# SYNOPSIS
**ccx_preCICE** [*OPTION*] *files*

# DESCRIPTION

This page briefly summarizes how to use CalculiX with or without preCICE. For more detailed instructions, read the CalculiX documention on http://www.dhondt.de/ccx_2.17.pdf and preCICE documentation on https://precice.org/docs.html.
Omitting the -precice-participant option starts a stand-alone CalculiX simulation.


# OPTIONS

**-v, --version, -h, --help**

: Prints current version of CalculiX.

**-i < jobname >**

: Starts the job defined in <jobname>.inp. Be sure to omit the extension .inp in the job name.

**-precice-participant < participant >**

: Runs a preCICE simulation with name < participant >. This name must be the same as the one used in the adapter configuration file as well as in the preCICE configuration file.

# EXAMPLES

**ccx_preCICE -i flap -precice-participant CalculiX** : Runs the coupled simulation flap.inp as participant "CalculiX".

**ccx_preCICE -i flap** : Runs a CalculiX-only simulation with flap.inp as input file.

# REPORTING BUGS

: Report issues on the Github repository: https://github.com/precice/calculix-adapter.