Skip to content

Commit 0f2d365

Browse files
Merge pull request #24 from FluidityProject/fix-package-building
Rewrite Debian/Ubuntu packaging
2 parents e2a52a3 + b30d9ae commit 0f2d365

File tree

18 files changed

+150
-187
lines changed

18 files changed

+150
-187
lines changed

.github/workflows/ubuntu.yml

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,30 @@ on:
99
- main
1010

1111
jobs:
12-
Ubuntu-Focal:
12+
ubuntu-local-builds:
1313
runs-on: ubuntu-latest
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
name: [ "Local Build Focal", "Local Build Jammy" ]
19+
include:
20+
21+
- name: "Local Build Focal"
22+
release: focal
23+
python: python3.8
24+
25+
- name: "Local Build Jammy"
26+
release: jammy
27+
python: python3.10
28+
29+
1430
container:
15-
image: ubuntu:focal
31+
image: ubuntu:${{ matrix.release }}
1632

1733
steps:
1834
- name: Check Out Repo
19-
uses: actions/checkout@v2
35+
uses: actions/checkout@v3
2036

2137
- name: Install dependencies
2238
run: |
@@ -37,7 +53,7 @@ jobs:
3753

3854
- name: Testing
3955
env:
40-
PYTHONPATH: /tmp/lib/python3.8/site-packages
56+
PYTHONPATH: /tmp/lib/${{ matrix.python }}/site-packages
4157
LD_LIBRARY_PATH: /tmp/lib
4258
run: |
4359
cd python
@@ -47,11 +63,68 @@ jobs:
4763
run: make doc
4864

4965
- name: Publish JUnit
50-
uses: mikepenz/action-junit-report@v2
66+
uses: mikepenz/action-junit-report@v3
5167
with:
5268
report_paths: '**/test_result*.xml'
5369
github_token: ${{ secrets.GITHUB_TOKEN }}
54-
check_name: JUnit Report
70+
check_name: JUnit Report ${{ matrix.release }} local build
5571
fail_on_failure: true
5672

5773

74+
ubuntu-package-builds:
75+
runs-on: ubuntu-latest
76+
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
name: [ "Local Build Focal", "Local Build Jammy" ]
81+
include:
82+
83+
- name: "Local Build Focal"
84+
release: focal
85+
python: python3.8
86+
87+
- name: "Local Build Jammy"
88+
release: jammy
89+
python: python3.10
90+
91+
92+
container:
93+
image: ubuntu:${{ matrix.release }}
94+
95+
steps:
96+
- name: Check Out Repo
97+
uses: actions/checkout@v3
98+
99+
- name: Install dependencies
100+
run: |
101+
echo "Europe/London" > /etc/timezone
102+
apt-get -y update
103+
DEBIAN_FRONTEND=noninteractive apt-get -y install devscripts equivs python3-junit.xml
104+
# make empty spud-build-dep package which depends on the build deps for the spud debian package
105+
mk-build-deps
106+
# install it so that build dependencies get installed
107+
DEBIAN_FRONTEND=noninteractive apt-get -y install ./spud-build-dep*deb
108+
109+
110+
- name: Build Ubuntu package
111+
run: debuild -uc -us
112+
113+
- name: Install Ubuntu package
114+
run: DEBIAN_FRONTEND=noninteractive apt-get -y install ../*.deb
115+
116+
- name: Testing fortran library
117+
run: make junittest
118+
119+
- name: Testing
120+
run: |
121+
cd python
122+
python3 test_libspud_junit.py
123+
124+
- name: Publish JUnit
125+
uses: mikepenz/action-junit-report@v3
126+
with:
127+
report_paths: '**/test_result*.xml'
128+
github_token: ${{ secrets.GITHUB_TOKEN }}
129+
check_name: JUnit Report ${{ matrix.release }} Package
130+
fail_on_failure: true

Makefile.in

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ VPATH = src/
5151
.cpp.lo:
5252
./libtool --mode=compile --tag=CXX $(CXX) $(CXXFLAGS) -c $<
5353

54-
default: libspud.la build-diamond
54+
default: libspud.la build-diamond build-pyspud
5555

5656
libspud.la: $(OBJS)
5757
./libtool --mode=link --tag=FC $(FC) $(FCFLAGS) -o $(LIB) $(OBJS) $(LIBS) -rpath @prefix@/lib
@@ -61,6 +61,9 @@ libspud.la: $(OBJS)
6161
build-diamond:
6262
cd diamond; python3 setup.py build; cd ..
6363

64+
build-pyspud: libspud.la
65+
cd python; python3 setup.py build; cd ..
66+
6467
test: unittest
6568

6669
unittest: libspud.la
@@ -95,21 +98,13 @@ install-spudtools:
9598
@INSTALL@ -m644 schema/spud_base.rng $(DESTDIR)@prefix@/share/spud
9699

97100
install-diamond:
98-
cd diamond; python3 setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
101+
cd diamond; python3 setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
99102

100103
install-pyspud:
101-
ifeq ($(origin BUILDING_DEBIAN),undefined)
102104
cd python; python3 setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
103-
else
104-
cd python; for python in $(shell py3versions -r); do $$python setup.py install --prefix=$(DESTDIR)@prefix@ --install-layout=deb; done; cd ..
105-
endif
106105

107106
install-dxdiff:
108-
ifeq ($(origin BUILDING_DEBIAN),undefined)
109107
cd dxdiff; python3 setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
110-
else
111-
cd dxdiff; for python in $(shell py3versions -r); do $$python setup.py install --prefix=$(DESTDIR)@prefix@ --install-layout=deb; done; cd ..
112-
endif
113108

114109
clean:
115110
@cd doc; $(MAKE) clean

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
spud (1.2) UNRELEASED; urgency=medium
2+
3+
* Rewrite Debian/Ubuntu packaging
4+
5+
-- Stephan Kramer <s.kramer@imperial.ac.uk> Tue, 25 Oct 2022 12:12:05 +0100
6+
17
spud (1.1.8) buster; urgency=medium
28

39
* Change to python3 and remove python(2) dependecies

debian/compat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9
1+
11

debian/control

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ Source: spud
22
Maintainer: The ICOM team <patrick.farrell@imperial.ac.uk>
33
Uploaders: David Ham <david.ham@imperial.ac.uk>
44
Section: science
5-
Priority: extra
6-
Build-Depends: gfortran (>=4.2), g++ (>=4.2), python3-setuptools (>= 0.6b3-1), python3-all-dev (>= 2.3.5-11), debhelper (>= 5.0.38), dh-python, texlive
5+
Priority: optional
6+
Build-Depends: gfortran (>=4.2), g++ (>=4.2), python3-setuptools (>= 39), python3-all-dev, debhelper (>= 5.0.38), dh-python, texlive
77
Standards-Version: 3.8.0
8-
XS-Python-Version: >= 2.5
8+
X-Python3-Version: >= 3.6
99

1010
Package: spud-diamond
1111
Architecture: all
@@ -16,7 +16,7 @@ Conflicts: python-diamond, diamond
1616
Replaces: python-diamond
1717
Provides: ${python:Provides}
1818
X-Python-Version: ${python:Versions}
19-
Description: A schema-driven interface for writing XML documents
19+
Description: Schema-driven interface for writing XML documents
2020
Diamond is a dynamic schema-driven graphical user interface for writing
2121
XML documents. The interface is automatically generated from a schema
2222
written in RELAX NG describing an XML language. The interface is optimised
@@ -29,7 +29,7 @@ Depends: ${shlibs:Depends}, spudtools, libtinyxml-dev, ${misc:Depends}
2929
Recommends: spud-diamond
3030
Section: libdevel
3131
Suggests:
32-
Description: An automatic options system for scientific models.
32+
Description: Automatic options system for scientific models.
3333
Spud is an automatic options system which reads an xml options file
3434
into a dictionary for immediate access from within the model. The xml
3535
file is generated using a spud-compatible RELAX NG schema and a
@@ -43,7 +43,7 @@ Conflicts: libspud-dev (<<1.0.6)
4343
Replaces: libspud-dev (<<1.0.6)
4444
Section: science
4545
Suggests:
46-
Description: An automatic options system for scientific models.
46+
Description: Automatic options system for scientific models.
4747
Spud is an automatic options system which reads an xml options file
4848
into a dictionary for immediate access from within the model. The xml
4949
file is generated using a spud-compatible RELAX NG schema and a
@@ -58,7 +58,7 @@ Replaces: python-spud
5858
Architecture: any
5959
X-Python-Version: ${python:Versions}
6060
Depends: libspud-dev (= ${binary:Version}), ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}
61-
Description: An automatic options system for scientific models (python interface).
61+
Description: Automatic options system for scientific models (python interface).
6262
Spud is an automatic options system which reads an xml options file
6363
into a dictionary for immediate access from within the model. The xml
6464
file is generated using a spud-compatible RELAX NG schema and a
@@ -72,6 +72,6 @@ Replaces: python-dxdiff
7272
Architecture: all
7373
X-Python-Version: ${python:Versions}
7474
Depends: ${python3:Depends}, ${misc:Depends}
75-
Description: An XML aware diff tool.
75+
Description: XML aware diff tool.
7676
DXdiff (Diamond Xml diff) is an XML aware diff tool for finding edit scripts
7777
between two XML files.

debian/install.spud-diamond

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/libspud-dev.dirs

Lines changed: 0 additions & 2 deletions
This file was deleted.

debian/libspud-dev.install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
usr/lib/libspud*
2+
usr/include/spud*

debian/postinst

Lines changed: 0 additions & 2 deletions
This file was deleted.

debian/python3-dxdiff.install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
usr/lib/python3*/dist-packages/dxdiff*
2+
usr/bin/dxdiff

0 commit comments

Comments
 (0)