Skip to content

Commit

Permalink
Merge 28469df into 70a7f7b
Browse files Browse the repository at this point in the history
  • Loading branch information
DaAwesomeP committed Jun 23, 2023
2 parents 70a7f7b + 28469df commit 32814b9
Show file tree
Hide file tree
Showing 32 changed files with 183 additions and 243 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
- name: Install Git
run: apt-get -y install git
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all tags for generating OLA_BUILD_NAME
- name: Install build tools
shell: bash
run: |
Expand Down
54 changes: 47 additions & 7 deletions .github/workflows/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,36 @@ jobs:
# create a .git folder or .git.config. The Problem Matcher looks for
# .git/config to find where the root of the repo is, so it must be
# present.
- name: Install Git
run: apt-get -y install git
- name: Install Git and lsb-release
run: apt-get -y install git lsb-release
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all tags for generating OLA_BUILD_NAME
- name: Generate build name
shell: bash
run: |
chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775
export OLA_BUILD_NAME=$(./scripts/build_name.sh)
# No docker number tag for testing, so must use lsb_release
export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)+deb$(lsb_release --short --release)
echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT
echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_ENV # Set build name globally so that modifications don't cause -dirty
echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT
echo "Build name: $OLA_BUILD_NAME"
echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION"
id: generate-build-name
- name: Install build tools
run: apt-get -y install devscripts adduser fakeroot sudo
- name: Create Debian version for build
shell: bash
run: |
DEBFULLNAME="GitHub Actions" DEBEMAIL=actions@github.com \
debchange --force-bad-version \
--newversion ${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} \
"GitHub Actions Build \
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Install build dependencies
run: mk-build-deps -t "apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends" -i -r
- name: Set up build user
Expand All @@ -38,7 +63,7 @@ jobs:
chown -R builduser:builduser .
chown builduser:builduser ..
- name: Build
run: sudo -u builduser dpkg-buildpackage -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }}
run: sudo -u builduser env "OLA_BUILD_NAME=$OLA_BUILD_NAME" dpkg-buildpackage -v${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }}
- name: Move built files
if: always()
run: |
Expand All @@ -56,7 +81,7 @@ jobs:
- uses: actions/upload-artifact@v3
if: always()
with:
name: ola-built-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
name: ola-built-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }}
path: ./built
debian-test:
name: 'Debian Test ${{ matrix.image_tag }} ${{ matrix.architecture }}'
Expand All @@ -70,11 +95,26 @@ jobs:
architecture: [amd64]
container: debian:${{ matrix.image_tag }}
steps:
- uses: actions/checkout@master
- name: Update package database
run: apt-get update -y
- name: Install Git and lsb-release
run: apt-get -y install git lsb-release
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all tags for generating OLA_DEBIAN_BUILD_VERSION
- name: Generate build name # Job step outputs can't be passed between builds for matrix jobs, so we re-generate
shell: bash
run: |
chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775
# No docker number tag for testing, so must use lsb_release
export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)+deb$(lsb_release --short --release)
echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT
echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION"
id: generate-build-name
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: ola-built-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
name: ola-built-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }}
path: built
- name: Display structure of artifact files
run: ls -alR
Expand All @@ -88,5 +128,5 @@ jobs:
- uses: actions/upload-artifact@v3
if: always() # Always upload the test output, even on failed tests
with:
name: ola-test-output-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
name: ola-test-output-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }}
path: test-output
1 change: 1 addition & 0 deletions common/base/Flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ void FlagRegistry::DisplayUsage() {
*/
void FlagRegistry::DisplayVersion() {
cout << "OLA " << m_argv0 << " version: " << ola::base::Version::GetVersion()
<< ", build: " << ola::base::Version::GetBuildName()
<< endl;
}

Expand Down
4 changes: 4 additions & 0 deletions common/base/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ unsigned int Version::GetRevision() {
return OLA_VERSION_REVISION;
}

string Version::GetBuildName() {
return OLA_BUILD_NAME;
}

string Version::GetVersion() {
std::ostringstream str;
str << GetMajor() << "." << GetMinor() << "." << GetRevision();
Expand Down
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ AC_SUBST([ola_revision_version])
OLA_REVISION_VERSION=ola_revision_version
AC_SUBST(OLA_REVISION_VERSION)

# Build name is separate because AC_CHECK_PROG must come after AC_INIT
# build_name.sh also checks for Git, but this allows that check to show
# up in ./configure for troubleshooting
AC_CHECK_PROG([git],[git],[yes],[no])
AM_CONDITIONAL([FOUND_GIT], [test "x$git" = xyes])
AC_SUBST(OLA_BUILD_NAME)
AC_ARG_VAR([OLA_BUILD_NAME], [Override the build name])
AS_IF([test "x$OLA_BUILD_NAME" = x], [
OLA_BUILD_NAME="$(./scripts/build_name.sh)"
])

# Checks for programs.
AC_LANG([C++])
AC_PROG_CXX
Expand Down Expand Up @@ -1025,6 +1036,7 @@ echo \
"-------------------------------------------------------
${PACKAGE_NAME} Version ${PACKAGE_VERSION}

Build Name: ${OLA_BUILD_NAME}
Prefix: '${prefix}'
Compiler: '${CXX} ${CXXFLAGS} ${CPPFLAGS}'
Linker: '${LD} ${AM_LDFLAGS} ${LIBS}'
Expand Down
8 changes: 2 additions & 6 deletions debian/Makefile.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Debian build files
EXTRA_DIST += \
debian/changelog \
debian/compat \
debian/control \
debian/copyright \
debian/libola-dev.dirs \
Expand All @@ -10,20 +9,17 @@ EXTRA_DIST += \
debian/ola-python.dirs \
debian/ola-python.install \
debian/ola-rdm-tests.bash-completion \
debian/ola-rdm-tests.config \
debian/ola-rdm-tests.dirs \
debian/ola-rdm-tests.install \
debian/ola-rdm-tests.postinst \
debian/ola-rdm-tests.rdm_test_server.init \
debian/ola-rdm-tests.templates \
debian/ola-rdm-tests.rdm_test_server.service \
debian/ola.bash-completion \
debian/ola.config \
debian/ola.dirs \
debian/ola.docs \
debian/ola.install \
debian/ola.olad.init \
debian/ola.olad.service \
debian/ola.postinst \
debian/ola.templates \
debian/ola.udev \
debian/org.openlighting.ola.ola.metainfo.xml \
debian/rules \
Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
ola (0.11.0-1) UNRELEASED; urgency=medium
* debian/ola.postinst: add --home parameter to adduser invocation
* This change pulled from Debian by Perry Naseck <git@perrynaseck.com>
https://salsa.debian.org/wouter/ola/-/commit/b9a0e2ab290d64f215891e1d543079dd78e7125e
* Remove debconf usage
* This change pulled from Debian by Perry Naseck <git@perrynaseck.com>
https://salsa.debian.org/wouter/ola/-/commit/6d27c071547426536b6f8f0db193dcfd7a4e5991
* This change pulled from Debian by Perry Naseck <git@perrynaseck.com>
191514d233d2300674df7e9c3febb35c2890c50c

-- Perry Naseck <git@perrynaseck.com> Thu, 20 Apr 2023 18:47:03 -0400

ola (0.10.9-2) UNRELEASED; urgency=medium

* Fix ola-rdm-tests Debian package by patching python shebangs to python3
Expand Down
1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: ola
Priority: optional
Maintainer: Wouter Verhelst <wouter@debian.org>
Uploaders: RenZO <renzo@imaginux.com>
Build-Depends: debhelper (>= 13), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy
Build-Depends: debhelper-compat (= 12), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy
Standards-Version: 3.9.8
Section: libs
Vcs-Git: https://github.com/OpenLightingProject/ola.git
Expand Down
30 changes: 0 additions & 30 deletions debian/ola-rdm-tests.config

This file was deleted.

1 change: 1 addition & 0 deletions debian/ola-rdm-tests.dirs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
etc/ola
usr/bin
usr/lib
usr/share
64 changes: 0 additions & 64 deletions debian/ola-rdm-tests.postinst

This file was deleted.

7 changes: 1 addition & 6 deletions debian/ola-rdm-tests.rdm_test_server.init
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$CMD.pid
DESC="OLA RDM Test Server"
USER=olad
DAEMON_ARGS="--world-writable"

# Reads config file (will override defaults above)
[ -r /etc/default/ola-rdm-tests ] && . /etc/default/ola-rdm-tests

if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then
DAEMON_ARGS="--world-writeable"
elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then
echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola-rdm-tests\" to change this." >&2
fi

[ -x "$DAEMON" ] || exit 0

. /lib/lsb/init-functions
Expand Down
13 changes: 13 additions & 0 deletions debian/ola-rdm-tests.rdm_test_server.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Open Lighting Architecture RDM Test Server
Documentation=man:olad(1)
After=network.target remote-fs.target olad.service
Wants=olad.service

[Service]
User=olad
Environment=RDM_TEST_SERVER_OPTS="--world-writable"
ExecStart=/usr/bin/rdm_test_server.py $RDM_TEST_SERVER_OPTS

[Install]
WantedBy=multi-user.target
10 changes: 0 additions & 10 deletions debian/ola-rdm-tests.templates

This file was deleted.

30 changes: 0 additions & 30 deletions debian/ola.config

This file was deleted.

1 change: 1 addition & 0 deletions debian/ola.dirs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
etc/ola
usr/bin
usr/lib
usr/share/olad/www
Expand Down
Loading

0 comments on commit 32814b9

Please sign in to comment.