summaryrefslogtreecommitdiff
path: root/packages/ddclient
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ddclient')
-rw-r--r--packages/ddclient/.gitignore1
-rw-r--r--packages/ddclient/Jenkinsfile34
-rwxr-xr-xpackages/ddclient/build.sh49
3 files changed, 84 insertions, 0 deletions
diff --git a/packages/ddclient/.gitignore b/packages/ddclient/.gitignore
new file mode 100644
index 00000000..600e4cd1
--- /dev/null
+++ b/packages/ddclient/.gitignore
@@ -0,0 +1 @@
+ddclient/
diff --git a/packages/ddclient/Jenkinsfile b/packages/ddclient/Jenkinsfile
new file mode 100644
index 00000000..317362e9
--- /dev/null
+++ b/packages/ddclient/Jenkinsfile
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 VyOS maintainers and contributors
+//
+// This program is free software; you can redistribute it and/or modify
+// in order to easy exprort images built to "external" world
+// it under the terms of the GNU General Public License version 2 or later as
+// published by the Free Software Foundation.
+//
+// This program 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 <http://www.gnu.org/licenses/>.
+@NonCPS
+
+// Using a version specifier library, use 'current' branch. The underscore (_)
+// is not a typo! You need this underscore if the line immediately after the
+// @Library annotation is not an import statement!
+@Library('vyos-build@current')_
+
+def pkgList = [
+ ['name': 'ddclient-debian',
+ 'scmCommit': 'debian/3.10.0-3',
+ 'scmUrl': 'https://salsa.debian.org/debian/ddclient',
+ 'buildCmd': '/bin/true'],
+ ['name': 'ddclient-github',
+ 'scmCommit': 'v3.11.2',
+ 'scmUrl': 'https://github.com/ddclient/ddclient',
+ 'buildCmd': 'cd ..; ./build.sh'],
+]
+
+// Start package build using library function from https://github.com/vyos/vyos-build
+buildPackage('ddclient', pkgList, null, null, "**/packages/ddclient/**")
diff --git a/packages/ddclient/build.sh b/packages/ddclient/build.sh
new file mode 100755
index 00000000..82e9b899
--- /dev/null
+++ b/packages/ddclient/build.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+CWD=$(pwd)
+set -e
+
+SRC_DEBIAN=ddclient-debian
+SRC_GITHUB=ddclient-github
+
+if [ ! -d ${SRC_DEBIAN} ]; then
+ echo "${SRC_DEBIAN} directory does not exists, please 'git clone'"
+ exit 1
+fi
+
+if [ ! -d ${SRC_GITHUB} ]; then
+ echo "${SRC_GITHUB} directory does not exists, please 'git clone'"
+ exit 1
+fi
+
+echo "I: Copy Debian build instructions"
+cp -a ${SRC_DEBIAN}/debian ${SRC_GITHUB}
+# Preserve some of the Debian's default patches
+cat > ${SRC_GITHUB}/debian/patches/series << EOF
+maxinterval.diff
+news.diff
+EOF
+# Remove vestigial documentation
+sed -i '/README\.ssl/d' ${SRC_GITHUB}/debian/docs
+
+PATCH_DIR=${CWD}/patches
+if [ -d ${PATCH_DIR} ]; then
+ for patch in $(ls ${PATCH_DIR})
+ do
+ echo "I: Apply patch: ${patch} to main repository"
+ cp ${PATCH_DIR}/${patch} ${SRC_GITHUB}/debian/patches/
+ echo ${patch} >> ${SRC_GITHUB}/debian/patches/series
+ done
+fi
+
+cd ${SRC_GITHUB}
+
+echo "I: Ensure Debian build dependencies are met"
+sudo mk-build-deps --install --tool "apt-get --yes --no-install-recommends"
+
+echo "I: Bump Debian Package version"
+version="$(git describe --tags)"
+dch -v "${version:1}+vyos0" "Patchset for miscellaneous fixes"
+dch -a "Forward port to upstream version ${version:1}"
+
+echo "I: Build Debian Package"
+dpkg-buildpackage -uc -us -tc -b