-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'task/#23464-Prepare_debian_release_safu' into 'debian/m…
…ain' task/#23464-Prepare_debian_release_safu See merge request elektrobit/base-os/safu!24
- Loading branch information
Showing
23 changed files
with
309 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash -eu | ||
|
||
export DEBIAN_FRONTEND="noninteractive" | ||
export DEBEMAIL="[email protected]" | ||
|
||
CODENAME="${1:-jammy}" | ||
|
||
echo "Building .deb packages for series ${CODENAME}" | ||
echo "---" | ||
echo "NOTICE: make sure to clean up before running this! Debhelper will complain otherwise" | ||
|
||
# Install dependencies | ||
apt-get update | ||
apt-get install -y git debhelper devscripts equivs software-properties-common fakeroot | ||
add-apt-repository -y ppa:elos-team/ppa | ||
|
||
# Use the native packaging folder for building the .debs | ||
rm -rf debian | ||
cp -rv debian.native debian | ||
|
||
# parse the version from the project.cmake file | ||
VERSION="$(sed -n "s/^.*VERSION\s\+\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/p" cmake/project.cmake)~test" | ||
|
||
# Add a new changelog entry | ||
git config --global --add safe.directory "$(pwd)" | ||
dch --newversion="${VERSION}" \ | ||
--distribution "${CODENAME}" "Test build" | ||
|
||
# Install dependencies | ||
yes | mk-build-deps -ir || true | ||
|
||
# Ignore Lintian errors from the native packaging | ||
mkdir -p debian/source | ||
echo "malformed-debian-changelog-version" >> debian/source/lintian-overrides | ||
echo "root-in-contact" >> debian/source/lintian-overrides | ||
echo "debian-watch-file-in-native-package" >> debian/source/lintian-overrides | ||
echo "odd-historical-debian-changelog-version" >> debian/source/lintian-overrides | ||
|
||
# Build the unsigned .debs | ||
fakeroot debuild --no-tgz-check -uc -us | ||
|
||
# Need to move the files into the project directory | ||
mv ../*.deb ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/*.substvars | ||
/files | ||
/debhelper-build-stamp | ||
/libsafu0/ | ||
/libsafu-dev/ | ||
/libmock-safu0/ | ||
/safu-doc/ | ||
/.debhelper/ | ||
/tmp/ | ||
/*.debhelper.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# safu Debian Packaging Scripts | ||
|
||
## Overview | ||
|
||
This directory contains Debian packaging scripts for building the current source | ||
tree as .deb packages. This is primarily for CI pipelines to automatically | ||
verify if the packages are buildable or if anything needs to be changed. This is | ||
not intended to be used directly for building .deb packages for new releases. | ||
|
||
## Building | ||
|
||
The .deb packages are constructed in the standard Debian way using `debhelper`. | ||
The easiest way to build the packages is to just call the `ci/build_debs.sh` | ||
script from the top-level directory from inside a Docker/Podman container, which | ||
will automatically install all of the necessary dependencies, set the package | ||
version, and build the packages using `debhelper`. | ||
|
||
It's possible to do this all in one line to verify if the packages are buildable | ||
on various Debian-based distributions and series. E.g., to build it on Ubuntu | ||
Jammy: | ||
|
||
```bash | ||
podman run --rm -v $(pwd):/build -w /build ubuntu:jammy ci/build_debs.sh | ||
``` | ||
|
||
Please note that there are some dependencies which are not (yet) in the Debian | ||
or Ubuntu archives. These have been built and published for Ubuntu in the | ||
[elos PPA](https://launchpad.net/~elos-team/+archive/ubuntu/ppa), which is | ||
automatically added by the `ci/build_debs.sh` script. This currently restricts | ||
builds using the script to Ubuntu systems, as PPAs are not available on other | ||
distributions. | ||
|
||
## Extending | ||
|
||
The Debian packaging scripts leverage the existing CMake build system used by | ||
safu to build everything, meaning that very little, if anything, generally | ||
needs to be changed inside the packaging scripts when a code change is made to | ||
safu. The major exception to this is when new libraries or files need to be | ||
installed. | ||
|
||
In most cases, new files and/or folders can be added to the `.install` file | ||
corresponding to the package name that the new files and/or folders should | ||
belong to. | ||
|
||
New packages must be added to the `control` file, and their respective files | ||
should be added to a new `.install` file matching the name of the new package. | ||
|
||
## Packaging Script Maintainer | ||
|
||
* Isaac True [email protected] [@IsaacJT](https://github.com/IsaacJT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
safu (0.0.1) unstable; urgency=medium | ||
|
||
* Dummy release. | ||
|
||
-- Isaac True <[email protected]> Mon, 10 Jun 2024 16:53:43 +0200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Source: safu | ||
Section: admin | ||
Priority: optional | ||
Maintainer: Isaac True <[email protected]> | ||
Build-Depends: | ||
debhelper-compat (= 13), | ||
cmake, | ||
git, | ||
libcmocka-mocks-dev, | ||
pkg-config, | ||
pandoc, | ||
pandoc-plantuml-filter, | ||
graphviz, | ||
Rules-Requires-Root: no | ||
Standards-Version: 4.6.0.1 | ||
Homepage: https://github.com/Elektrobit/safu | ||
Vcs-Browser: https://github.com/Elektrobit/safu | ||
Vcs-Git: https://github.com/Elektrobit/safu | ||
|
||
Package: libsafu0 | ||
Section: libs | ||
Architecture: any | ||
Depends: | ||
${misc:Depends}, | ||
${shlibs:Depends}, | ||
Description: Common utility API's used in elos and samconf | ||
Library of common utility API's used in elos and samconf. | ||
. | ||
Runtime library package. | ||
|
||
Package: libmock-safu0 | ||
Section: libs | ||
Architecture: any | ||
Depends: | ||
${misc:Depends}, | ||
${shlibs:Depends}, | ||
Description: Library of common utility API's used in elos and samconf (mocks) | ||
Library of common utility API's used in elos and samconf. | ||
. | ||
Mock library package. | ||
|
||
Package: libsafu-dev | ||
Section: libdevel | ||
Architecture: any | ||
Depends: | ||
${misc:Depends}, | ||
libsafu0 (= ${binary:Version}), | ||
libmock-safu0 (= ${binary:Version}), | ||
libcmocka-mocks-dev, | ||
Description: Library of common utility API's used in elos and samconf (development) | ||
Library of common utility API's used in elos and samconf. | ||
. | ||
Development package. | ||
|
||
Package: safu-doc | ||
Section: doc | ||
Architecture: all | ||
Depends: | ||
${misc:Depends}, | ||
Description: Library of common utility API's used in elos and samconf (documentation) | ||
Library of common utility API's used in elos and samconf. | ||
. | ||
Documentation package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: safu | ||
Upstream-Contact: https://github.com/Elektrobit/safu/issues | ||
Source: https://github.com/Elektrobit/safu | ||
|
||
Files: * | ||
Copyright: 2023, Elektrobit GmbH | ||
2023, emlix GmbH | ||
License: MIT | ||
|
||
License: MIT | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
. | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Developer documentation | ||
========================== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Contents: | ||
|
||
DeveloperManual | ||
documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
usr/lib/*/libmock_safu.so.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
usr/include/safu | ||
usr/lib/*/cmake | ||
usr/lib/*/pkgconfig | ||
usr/lib/*/libmock_safu.so | ||
usr/lib/*/libsafu.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
usr/lib/*/libsafu.so.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
usr/lib/*/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/make -f | ||
|
||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto | ||
|
||
%: | ||
dh $@ --buildsystem=cmake --builddirectory=debian/build | ||
|
||
override_dh_auto_build: | ||
dh_auto_build -- all safu_doc | ||
|
||
mkdir -p debian/build/documentation/developer | ||
|
||
pandoc --from gfm --to rst \ | ||
-o debian/build/documentation/developer/DeveloperManual.rst \ | ||
documentation/developer.md | ||
|
||
pandoc --from gfm --to rst \ | ||
-o debian/build/documentation/developer/documentation.rst \ | ||
documentation/documentation.md | ||
|
||
pandoc --from gfm --to rst \ | ||
-o debian/build/documentation/developer/index.rst \ | ||
debian/devdoc-index.md | ||
|
||
override_dh_install: | ||
dh_install | ||
# Do not ship plantuml source files | ||
find debian/ -name \*.plantuml -delete | ||
|
||
override_dh_compress: | ||
# Do not compress .md files | ||
dh_compress --exclude=.md | ||
|
||
override_dh_clean: | ||
dh_clean | ||
|
||
rm -f documentation/images/*.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
documentation/* /usr/share/doc/safu/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
safu-doc: zero-byte-file-in-doc-directory [usr/share/doc/safu/style.css] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (native) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
version=4 | ||
https://github.com/Elektrobit/safu/tags .*/safu-(\d+).(\d+).(\d+).tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
safu (0.54.1-1) UNRELEASED; urgency=medium | ||
|
||
* New upstream tag 0.54.1 | ||
|
||
-- Isaac True <[email protected]> Thu, 27 Jun 2024 13:47:51 +0000 | ||
|
||
safu (0.53.0-8) unstable; urgency=medium | ||
|
||
* Add safu-doc.lintian-overrides. | ||
|
Oops, something went wrong.