.PHONY: clean-local-check
clean-local-check:
-rm -rf $(TEST_ROOTFS)/*
+
+EXTRA_DIST += \
+ debian/build.sh \
+ debian/changelog \
+ debian/control \
+ debian/copyright \
+ debian/genchangelog.sh \
+ debian/libpakfire0.install \
+ debian/libpakfire-dev.install \
+ debian/pakfire.install \
+ debian/rules \
+ debian/source/format
+
+.PHONY: debian
+debian: dist
+ $(SHELL) debian/build.sh $(PACKAGE_NAME)-$(PACKAGE_VERSION) $(distdir).tar.gz
--- /dev/null
+#!/bin/bash
+
+ARCHITECTURES=( amd64 )
+RELEASES=( bullseye )
+
+CHROOT_PATH="/var/tmp"
+
+main() {
+ if [ $# -lt 2 ]; then
+ echo "Not enough arguments" >&2
+ return 2
+ fi
+
+ # Get host architecture
+ local host_arch="$(dpkg --print-architecture)"
+ if [ -z "${host_arch}" ]; then
+ echo "Could not discover host architecture" >&2
+ return 1
+ fi
+
+ local package="${1}"
+ local sources="${2}"
+
+ # Create some temporary directory
+ local tmp="$(mktemp -d)"
+
+ # Extract the sources into it
+ mkdir -p "${tmp}/sources"
+ tar xvfa "${sources}" -C "${tmp}/sources"
+
+ # Copy the tarball under the correct Debian name
+ cp -vf "${sources}" "${tmp}/sources/${package//-/_}.orig.tar.gz"
+
+ # Change into temporary directory
+ pushd "${tmp}"
+
+ # Build the package for each release
+ local release
+ for release in ${RELEASES[@]}; do
+ local chroot="${release}-${host_arch}-sbuild"
+
+ mkdir -p "${release}"
+ pushd "${release}"
+
+ # Create a chroot environment
+ if [ ! -d "/etc/sbuild/chroot/${chroot}" ]; then
+ if ! sbuild-createchroot --arch="${host_arch}" "${release}" \
+ "${CHROOT_PATH}/${chroot}"; then
+ echo "Could not create chroot for ${release} on ${host_arch}" >&2
+ rm -rf "${tmp}"
+ return 1
+ fi
+ fi
+
+ # And for each architecture we want to support
+ local arch
+ for arch in ${ARCHITECTURES[@]}; do
+ mkdir -p "${arch}"
+ pushd "${arch}"
+
+ # Copy sources
+ cp -r "${tmp}/sources" .
+
+ # Run the build process
+ if ! sbuild --dist="${release}" --host="${arch}" --source "sources/${package}"; then
+ echo "Could not build package for ${release} on ${arch}" >&2
+ rm -rf "${tmp}"
+ return 1
+ fi
+
+ # Remove the sources
+ rm -rf "sources/${package}"
+ popd
+ done
+ popd
+ done
+
+ # Remove sources
+ rm -rf "${tmp}/sources"
+ popd
+
+ # Done!
+ echo "SUCCESS!"
+ echo " You can find your Debian packages in ${tmp}"
+ return 0
+}
+
+main "$@" || exit $?
--- /dev/null
+pakfire (0.9.28-1) unstable; urgency=medium
+
+ * Initial release.
+
+ -- Stefan Schantl <stefan.schantl@ipfire.org> Sun, 27 Oct 2019 18:55:44 +0100
--- /dev/null
+Source: pakfire
+Maintainer: Stefan Schantl <stefan.schantl@ipfire.org>
+Section: misc
+Priority: optional
+Standards-Version: 4.6.1
+Build-Depends:
+ debhelper-compat (= 13),
+ dh-sequence-python3,
+ asciidoc,
+ autoconf,
+ automake,
+ bison,
+ flex,
+ intltool,
+ libarchive-dev,
+ libcap-dev,
+ libcurl4-openssl-dev,
+ libelf-dev,
+ libgpgme-dev,
+ libjson-c-dev,
+ liblzma-dev,
+ libmagic-dev,
+ libmount-dev,
+ libpcre2-dev,
+ libseccomp-dev,
+ libsolv-dev,
+ libsqlite3-dev,
+ libssl-dev,
+ libsystemd-dev,
+ libzstd-dev,
+ pkg-config,
+ python3-all-dev,
+ python3-cpuinfo,
+ python3-kerberos,
+ python3-systemd,
+ python3-tornado,
+ python3-psutil,
+ python3-setproctitle,
+ systemd,
+ uuid-dev,
+ xsltproc,
+ docbook-xsl,
+ git,
+Rules-Requires-Root: no
+Homepage: https://pakfire.ipfire.org/
+Vcs-Git: https://git.ipfire.org/pub/git/pakfire/pakfire.git
+Vcs-Browser: https://git.ipfire.org/pub/git/pakfire/pakfire.git
+Description: Package management and build system for IPFire 3.x.
+ Pakfire combines the package management and the build system for IPFire 3.x
+ in one tool.
+
+Package: libpakfire0
+Architecture: any
+Section: libs
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+Recommends:
+ pakfire,
+Multi-Arch: same
+Description: ${source:Synopsis}
+ ${source:Extended-Description}
+ .
+ This package provides the shared library.
+
+Package: libpakfire-dev
+Architecture: any
+Section: libdevel
+Depends:
+ libpakfire0 (= ${binary:Version}),
+ ${misc:Depends},
+Multi-Arch: same
+Description: ${source:Synopsis} (development files)
+ ${source:Extended-Description}
+ .
+ This package provides the headers and development files needed to use
+ libpakfire in your own programs.
+
+Package: pakfire
+Architecture: any
+Depends:
+ ${misc:Depends},
+ ${python3:Depends},
+ ${shlibs:Depends},
+Description: ${source:Synopsis}
+ ${source:Extended-Description}
+ .
+ This package provides the pakfire tools.
--- /dev/null
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: pakfire
+Upstream-Contact: Michael Tremer <michael.tremer@ipfire.org>
+Source: https://source.ipfire.org/releases/pakfire/
+
+Files: *
+Copyright: 2017-2023 IPFire Development team <info@ipfire.org>
+License: LGPL-2.1
+
+Files: debian/*
+Copyright: 2023 Stefan Schantl <stefan.schantl@ipfire.org>
+License: LGPL-2.1
+
+License: LGPL-2.1
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; version 2.1 of the License, or (at
+ your option) any later version.
+ .
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ .
+ The complete text of the GNU General Public License
+ can be found in /usr/share/common-licenses/LGPL-2.1 file.
+ .
--- /dev/null
+#!/bin/bash -e
+gitshow () {
+ local format=$1
+ local commit=$2
+
+ git show --no-patch --format=format:"$format" "$commit"
+}
+
+main () {
+ if [ $# -lt 1 ]; then
+ local bn="$(basename $0)"
+ echo "Usage: $bn <commit range>" >&2
+ echo "Example: $bn 0.9.7..HEAD" >&2
+ echo "Example: $bn 0.9.5..0.9.6^" >&2
+ return 1
+ fi
+
+ local commitrange=$1
+
+ local commit
+ for commit in $(git rev-list --reverse "$commitrange"); do
+ # Skip commits with diffs that only have Makefile.am or d/ changes.
+ if [ "$(git diff --name-only "${commit}^..${commit}" -- . ':^Makefile.am' ':^debian/' | wc -l)" == 0 ]; then
+ continue
+ fi
+
+ local author_name="$(gitshow %an "$commit")"
+ local author_email="$(gitshow %ae "$commit")"
+ local subject="$(gitshow %s "$commit")"
+
+ echo "$author_name <$author_email> $subject"
+ DEBFULLNAME="$author_name" DEBEMAIL="$author_email" debchange --upstream --multimaint-merge "$subject"
+ done
+
+ debchange --release ''
+}
+
+main "$@" || exit $?
--- /dev/null
+#!/bin/bash
+SYMBOLS_PKG=libloc1
+LOCAL_FILE=debian/libloc1.symbols
+TEMP_FILE="$(mktemp --tmpdir libloc1.XXXXXX.symbols)"
+trap "rm -f ${TEMP_FILE}" EXIT
+
+generate () {
+ intltoolize --force --automake
+ autoreconf --install --symlink
+ ./configure CFLAGS='-g -O0' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
+
+ make
+
+ dpkg-gensymbols -p"$SYMBOLS_PKG" -O"$TEMP_FILE" -esrc/.libs/libloc.so.*
+ sed -i -E -e 's/( [0-9\.]+)-.+$/\1/' "$TEMP_FILE"
+
+ make clean
+}
+
+main () {
+ local maxver='0.0.0'
+ if [ -f "$LOCAL_FILE" ]; then
+ cp "$LOCAL_FILE" "$TEMP_FILE"
+ maxver="$(grep -E '^ ' "$LOCAL_FILE" | cut -d' ' -f3 | sort -Vru | head -n1)"
+ echo "Latest version checked: $maxver"
+ fi
+
+
+ local tag
+ for tag in $(git tag -l --sort=version:refname)
+ do
+ if [ "$(echo -e "${maxver}\n${tag}" | sort -Vr | head -n1)" == "$maxver" ]; then
+ echo "Tag $tag -- skip"
+ continue
+ fi
+
+ echo "Tag $tag -- checking"
+ git switch --quiet --detach "$tag" || return 1
+ generate || return 1
+ git switch --quiet - || return 1
+ done
+
+ echo "Current -- checking"
+ generate || return 1
+
+ mv "$TEMP_FILE" "$LOCAL_FILE"
+ chmod 644 "$LOCAL_FILE"
+}
+
+main "$@" || exit $?
--- /dev/null
+usr/include/pakfire
+usr/lib/*/libpakfire.so
--- /dev/null
+usr/lib/*/libpakfire.so.*
--- /dev/null
+etc/pakfire/*
+lib/systemd/*
+usr/bin/*
+usr/lib/pakfire/*
+usr/lib/python3*
+usr/share/*
--- /dev/null
+#!/usr/bin/make -f
+
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+
+export PYBUILD_SYSTEM=custom
+
+export PYBUILD_CLEAN_ARGS=dh_auto_clean
+
+export PYBUILD_CONFIGURE_ARGS=intltoolize --force --automake; \
+ PYTHON={interpreter} dh_auto_configure --
+
+export PYBUILD_BUILD_ARGS=dh_auto_build
+
+export PYBUILD_INSTALL_ARGS=dh_auto_install --destdir={destdir}; \
+ mkdir -p {destdir}/usr/lib/python{version}/dist-packages; \
+ mv -v {destdir}/usr/lib/python3/dist-packages/pakfire {destdir}/usr/lib/python{version}/dist-packages/pakfire; \
+ rm -vf {destdir}/usr/lib/python*/*-packages/pakfire/_pakfire.la; \
+ rm -vf {destdir}/usr/lib/*/libpakfire.la
+
+#export PYBUILD_TEST_ARGS=dh_auto_test
+
+%:
+ dh $@ --buildsystem=pybuild
--- /dev/null
+3.0 (quilt)