summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-11-02 11:33:44 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-11-02 11:49:44 +0100
commit072890e9b0ec5af1b28b3c1b213554c5b16ab50e (patch)
tree2d5eeb6bd59601516c9e3d39c93aa932e95a2267
parent7c4b2a289cab34e4ec1b966663530a7babf08707 (diff)
Backport changes to package scripts
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--Makefile.am2
-rw-r--r--packages/APKBUILD46
-rw-r--r--packages/Dockerfile71
-rw-r--r--packages/PKGBUILD82
-rw-r--r--packages/README.md121
-rwxr-xr-xpackages/build57
-rwxr-xr-xpackages/build-all22
-rwxr-xr-xpackages/build-helper148
-rw-r--r--packages/debian/changelog63
-rw-r--r--packages/debian/clean1
-rw-r--r--packages/debian/control87
-rw-r--r--packages/debian/copyright55
-rw-r--r--packages/debian/libsquashfs-dev.install5
-rw-r--r--packages/debian/libsquashfs1.install1
-rwxr-xr-xpackages/debian/rules19
-rw-r--r--packages/debian/source/format1
-rw-r--r--packages/debian/squashfs-tools-ng.install2
-rw-r--r--packages/debian/watch2
-rw-r--r--packages/squashfs-tools-ng.spec38
19 files changed, 807 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am
index 8492596..1ae9b69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@ check_SCRIPTS =
pkgconfig_DATA =
EXTRA_DIST = autogen.sh README.md CHANGELOG.md COPYING.md mkwinbins.sh licenses
-EXTRA_DIST += doc packages
+EXTRA_DIST += doc
TESTS =
include lib/zlib/Makemodule.am
diff --git a/packages/APKBUILD b/packages/APKBUILD
new file mode 100644
index 0000000..92d95ee
--- /dev/null
+++ b/packages/APKBUILD
@@ -0,0 +1,46 @@
+# -*- sh -*-
+
+# Contributor:
+# Maintainer: Sébastien Gross <invalid@invalid.tld>
+
+pkgname=squashfs-tools-ng
+pkgver=1.0.2
+pkgrel=0
+pkgdesc="New set of tools for working with SquashFS images."
+url="https://github.com/AgentD/squashfs-tools-ng"
+arch="all"
+license="GPL3"
+depends="squashfs-tools"
+makedepends="autoconf automake libtool m4 make gcc doxygen lzo-dev zstd-dev lz4-dev xz-dev zlib-dev libselinux-dev"
+install=""
+subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
+source="https://github.com/AgentD/squashfs-tools-ng/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
+
+build() {
+ cd "$builddir"
+ ./autogen.sh
+ ./configure --prefix=/usr
+ make
+ make doxygen-doc
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make -j1 DESTDIR="$pkgdir" install
+}
+
+doc() {
+ cd "$builddir"
+ pkgdesc="$pkgname documemtation"
+ default_doc
+ install -d "$subpkgdir/usr/share/doc/$pkgname"
+ cp -a doxygen-doc/* "$subpkgdir/usr/share/doc/$pkgname"
+
+}
+
+sha512sums="409cec3c932ad0653958746b07371ce19979cd53f9f38482243bc425a08ca62c79c5560a03c0c7d0560bb04234dab7a94a60bbe1a1ed7497f3afcec744e2fda6 squashfs-tools-ng-1.0.2.tar.gz"
diff --git a/packages/Dockerfile b/packages/Dockerfile
new file mode 100644
index 0000000..5fadea9
--- /dev/null
+++ b/packages/Dockerfile
@@ -0,0 +1,71 @@
+# Dockerfile fo build a package for following Linux distributions:
+#
+#
+# * alpine
+# * archlinux
+# * centos
+# * fedora
+# * debian
+# * ubuntu
+# * opensuse
+#
+
+ARG vendor
+ARG release
+ARG version=1.0.2
+
+FROM $vendor:$release
+# Args are not globaly scoped
+ARG vendor
+ARG release
+ARG version=1.0.2
+
+# Install tools required to build a package for several distributions.
+#
+# Create a user and add it to sudoers.
+RUN case $vendor in \
+ alpine) \
+ apk add alpine-sdk sudo ;\
+ ;; \
+ archlinux) \
+ pacman -Sy; \
+ pacman -S --noconfirm fakeroot binutils namcap sudo ;\
+ ;; \
+ centos|fedora) \
+ yum install -y rpm-build spectool sudo ;\
+ ;; \
+ debian|ubuntu) \
+ apt-get update ;\
+ DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ -o Dpkg::Options::=--force-confdef \
+ -o APT::Install-Recommends=no \
+ build-essential \
+ ca-certificates \
+ devscripts \
+ equivs \
+ libdistro-info-perl \
+ sudo \
+ wget \
+ ;\
+ ;; \
+ opensuse|opensuse/leap) \
+ zypper install -y rpm-build sudo wget ;\
+ ;; \
+ *) \
+ echo "Unsupported vendor '$vendor' (version: '$version')"; \
+ exit 1; \
+ ;; \
+ esac; \
+ case $vendor in \
+ alpine) adduser -G abuild -s /bin/ash -D builder ;; \
+ *) useradd -m -s /bin/sh builder ;; \
+ esac; \
+ echo 'builder ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/builder; \
+ chmod 0400 /etc/sudoers.d/builder
+
+USER builder
+WORKDIR /home/builder
+
+ENV vendor=$vendor
+ENV release=$release
+ENV version=$version
diff --git a/packages/PKGBUILD b/packages/PKGBUILD
new file mode 100644
index 0000000..e7152bb
--- /dev/null
+++ b/packages/PKGBUILD
@@ -0,0 +1,82 @@
+# -*- sh -*-
+
+# Maintainer: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
+# Contributor:
+
+pkgname=('squashfs-tools-ng' 'squashfs-tools-ng-doc')
+pkgver=1.0.2
+pkgrel=1
+epoch=
+pkgdesc="New set of tools for working with SquashFS images."
+url="https://github.com/AgentD/squashfs-tools-ng"
+license=('GPL3')
+arch=('x86_64')
+groups=()
+makedepends=(
+ 'fakeroot'
+ 'binutils'
+ 'autoconf'
+ 'automake'
+ 'autogen'
+ 'libtool'
+ 'pkgconf'
+ 'm4'
+ 'make'
+ 'gcc'
+ 'doxygen')
+#
+depends=('zstd' 'lzo' 'attr')
+checkdepends=()
+optdepends=('squashfs-tools')
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+changelog=
+source=("https://github.com/AgentD/squashfs-tools-ng/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
+noextract=()
+
+## Generated using: makepkg -g PKGBUILD
+md5sums=('7e78c57513d58e374afc60c000032fa7')
+sha1sums=('a50a7d2aa31b71b22de4297e23e5f68e5fc8c0e1')
+sha224sums=('43abdd9552b3872380387b5dadfd44e8e7dbd8cab1772bef83dea7b7')
+sha256sums=('5eb0e3faaba6cef92e0c03b13b9965e744d8eb5291db5b118970d4c34eeaec8c')
+sha384sums=('47f589f7b6c82d39c404e67888045beca5062b595766b294d337ea0c8e026d063b58b7b4e83fd81cea0ea48fec1c2545')
+sha512sums=('409cec3c932ad0653958746b07371ce19979cd53f9f38482243bc425a08ca62c79c5560a03c0c7d0560bb04234dab7a94a60bbe1a1ed7497f3afcec744e2fda6')
+b2sums=('c2a48909dd9cac89a45cc468735b24f842a8466629ad75f523c1db736fe51036c96bcb46a2b351aa24753028a88ea5efa56aab3ca87efdd339e6d58a0b92abd9')
+
+validpgpkeys=()
+
+prepare() {
+ cd "$pkgname-$pkgver"
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ ./autogen.sh
+ ./configure --prefix=/usr
+ make
+ make doxygen-doc
+}
+
+check() {
+ cd "$pkgname-$pkgver"
+ make -k check
+}
+
+package_squashfs-tools-ng() {
+ #depends=('zstd' 'attr' 'zlib' 'xz' 'lzo' )
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir/" install
+}
+
+package_squashfs-tools-ng-doc() {
+ arch=('any')
+ optdepend=()
+ depends=()
+ cd "$pkgbase-$pkgver"
+ install -d "$pkgdir/usr/share/doc/$pkgbase"
+ cp -a doxygen-doc/* "$pkgdir/usr/share/doc/$pkgbase"
+}
diff --git a/packages/README.md b/packages/README.md
new file mode 100644
index 0000000..0e094e0
--- /dev/null
+++ b/packages/README.md
@@ -0,0 +1,121 @@
+# Package builder
+
+This directory contains files to build packages for several Linux
+distributions.
+
+## Build using Docker images
+
+Packages for a specific release can be built using Docker. Use the
+`build` script for that:
+
+```
+./build VENDOR RELEASE
+```
+
+If you want to build all supported vendors and releases, you can use
+the `build_all` script.
+
+Packages will be output in `_out` directory.
+
+## Manual build
+
+### APK
+
+[APKBUILD]() containts all definition to build APK packages for Alpine
+linux.
+
+From a fresh install setup the build environment for a reqular user
+named `pkg-builder` (user name is up to you):
+
+```
+adduser pkg-builder
+addgroup pkg-builder abuild
+echo '%abuild ALL=(ALL) NOPASSWD:/sbin/apk, /bin/mkdir -p /etc/apk/keys, /bin/cp -i *.pub /etc/apk/keys/' > /etc/sudoers.d/abuild
+chmod 0400 /etc/sudoers.d/abuild
+apk add alpine-sdk
+```
+
+Build the package as `pkg-builder`:
+
+```
+abuild-keygen -nai
+abuild -r
+```
+
+### DEB
+
+The [debian]() directory contains all definitions to build Debian and
+Ubuntu packages.
+
+Package building for Debian like distibutions is a bit tricky. In this
+case we want to add the codename to the version number in order to
+differentiate builds.
+
+To build package for version 1.0.2, run following commands:
+
+```
+apt-get install devscripts build-essential wget
+source /etc/os-release
+wget https://github.com/AgentD/squashfs-tools-ng/archive/v1.0.2/squashfs-tools-ng-1.0.2.tar.gz -O squashfs-tools-ng_1.0.2+$VERSION_CODENAME.orig.tar.gz
+tar xfz squashfs-tools-ng_1.0.2+$VERSION_CODENAME.orig.tar.gz
+cd squashfs-tools-ng-1.0.2
+ln -s packages/debian
+DEBFULLNAME="$USER" DEBEMAIL="$USER@localhost" dch -v 1.0.2+$VERSION_CODENAME-1 -D $VERSION_CODENAME "Build 1.0.2 for $VERSION_CODENAME."
+mk-build-deps --install --tool='apt-get --no-install-recommends --yes' debian/control
+rm *.deb
+debuild
+debuild -- clean
+```
+
+
+### PKG
+
+[PKGBUILD]() contains all definition to build Archlinux packages.
+
+Run following commands:
+
+```
+sudo pacman -S --noconfirm fakeroot binutils namcap
+makepkg --noconfirm -Cfsir PKGBUILD
+```
+
+You can check the packages using `namcap`:
+
+```
+namcap -i squashfs-tools-*.pkg.tar.zst PKGBUILD
+```
+
+### RPM
+
+[squashfs-tools-ng.spec]() contains all definitions to build RPM
+packages.
+
+#### CentOS, Fedora
+
+Run following commands:
+
+```
+yum install -y rpm-build spectool
+rpmdev-setuptree
+spectool -g -R squashfs-tools-ng.spec
+rpmspec --parse squashfs-tools-ng.spec | grep BuildRequires | cut -d' ' -f2 | xargs sudo yum install -y
+rpmbuild --clean -ba squashfs-tools-ng.spec
+```
+
+### OpenSUSE
+
+Run following commands:
+
+```
+zypper install -y rpm-build
+rpmspec --parse squashfs-tools-ng.spec | grep Source0 | awk '{print $2}' | xargs wget -N -P $(rpm --eval '%{_sourcedir}')
+rpmspec --parse squashfs-tools-ng.spec | grep BuildRequires | cut -d' ' -f2 | xargs sudo zypper install -y
+rpmbuild --clean -ba squashfs-tools-ng.spec
+```
+
+Note:
+* `spectool` does not natively exists on OpenSUSE, hence source has to
+ be downloaded manually.
+* `zypper` is used intead of `yum`.
+
+
diff --git a/packages/build b/packages/build
new file mode 100755
index 0000000..21327d6
--- /dev/null
+++ b/packages/build
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# Build a package for a specific distribution using a Docker image.
+#
+# ./build DISTRO RELEASE
+#
+# From a given DISTRO:RELEASE it create a new local Docker image named
+# DISTRO-builder:RELEASE and installs tools required to build a
+# package (it does not install package build depends).
+#
+# It also creates a builder user to prevent from building packages as
+# root.
+#
+# Once the image is setup, it starts a docker image and run
+# build-helper to build the packages. The packages files are stored in
+# _OUT/DISTRO/RELEASE.
+#
+
+
+vendor="$1"
+release="$2"
+
+if test -z "$vendor" -o -z "$release"; then
+ cat<<EOF >&2
+$0 VENDOR RELEASE
+EOF
+ exit 1
+fi
+
+source_dir=$(git rev-parse --show-toplevel)
+output_dir=$source_dir/_out
+empty_dir=$output__dir/_empty
+
+if test "$vendor" = "opensuse"; then
+ vendor=opensuse/leap
+ pkg_dir=$output_dir/$vendor-$release
+else
+ pkg_dir=$output_dir/$vendor/$release
+fi
+
+image=$vendor-builder:$release
+
+mkdir -p $pkg_dir
+mkdir -p $output_dir/_empty
+
+# Build docker image
+docker build -t $image -f packages/Dockerfile \
+ --build-arg vendor="$vendor" \
+ --build-arg release="$release" \
+ .
+
+docker_args="-v $source_dir:/source-ro:ro -v $empty_dir:/source-ro/_out:ro"
+docker_args="$docker_args -v $pkg_dir:/output:rw"
+docker_args="$docker_args -v $source_dir/packages/build-helper:/build-helper"
+docker_args="$docker_args --rm"
+
+docker run -it $docker_args $image /build-helper
diff --git a/packages/build-all b/packages/build-all
new file mode 100755
index 0000000..b680dba
--- /dev/null
+++ b/packages/build-all
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+vendors='alpine archlinux centos debian fedora opensuse ubuntu'
+
+alpine_versions='3.11 3.12'
+archlinux_versions='latest'
+centos_versions='7 8'
+debian_versions='bookworm bullseye buster strech'
+fedora_versions='32'
+opensuse_versions='15.0 15.1 15.2'
+ubuntu_versions='bionic focal groovy'
+
+source_dir=$(git rev-parse --show-toplevel)
+
+
+for v in $vendors; do
+ versions="${v}_versions"
+ for ver in ${!versions}; do
+ $source_dir/packages/build $v $ver
+ done
+done
+
diff --git a/packages/build-helper b/packages/build-helper
new file mode 100755
index 0000000..1c396c5
--- /dev/null
+++ b/packages/build-helper
@@ -0,0 +1,148 @@
+#!/bin/sh
+
+# This script builds squashfs-tools-ng packages inside a Docker
+# instance.
+#
+# It can build packages for:
+#
+# * alpine
+# * archlinux
+# * centos
+# * fedora
+# * debian
+# * ubuntu
+# * opensuse
+#
+# Currently it can only build package from a release (tag from github).
+#
+# TODO: Find a way to build packages from git checkout sources
+
+# Path to the source directory mounted in the Docker instance.
+ROOT_RO=/source-ro
+
+# Path to which packages will be copied after a successful build.
+OUTPUT=/output
+
+. /etc/os-release
+
+build_alpine() {
+ cp -r $ROOT_RO/packages/APKBUILD .
+
+ abuild-keygen -nai
+ abuild -r
+
+ cp ~/packages/*/x86_64/*.apk $OUTPUT
+}
+
+
+
+build_archlinux() {
+ cp -r $ROOT_RO/packages/PKGBUILD .
+ makepkg --noconfirm -Cfsir PKGBUILD
+
+ cp ~/*.tar.zst $OUTPUT
+}
+
+
+# This part is a ugly hack.
+# TODO: Find a better way to build deb packages.
+build_deb() {
+ # Fetch sources
+ wget \
+ https://github.com/AgentD/squashfs-tools-ng/archive/v$version/squashfs-tools-ng-$version.tar.gz \
+ -O squashfs-tools-ng_$version+$VERSION_CODENAME.orig.tar.gz
+
+ tar xfz squashfs-tools-ng_$version+$VERSION_CODENAME.orig.tar.gz
+ cd squashfs-tools-ng-$version
+ cp -r $ROOT_RO/packages/debian .
+
+ #ln -s packages/debian
+ DEBFULLNAME="$USER" DEBEMAIL="$USER@localhost" \
+ dch -v $version+$VERSION_CODENAME-1 \
+ -D $VERSION_CODENAME "Build $version for $VERSION_CODENAME."
+
+ # See https://packages.debian.org/search?searchon=sourcenames&keywords=debhelper
+ # https://packages.ubuntu.com/search?keywords=debhelper&searchon=names&suite=all&section=all
+ case "$VERSION_CODENAME" in
+ jessie|xenial) dhv=9 ;;
+ stretch) dhv=10 ;;
+ bionic) dhv=11 ;;
+ buster|focal) dhv=12 ;;
+ bookworm|bullseye|groovy) dhv=13 ;;
+ sid) dhv=13 ;;
+ esac
+
+ sed -i -e "s/@DEBHELPER_VERSION@/$dhv/" debian/control
+ echo $dhv > debian/compat
+
+ sudo mk-build-deps --install \
+ --tool='apt-get --no-install-recommends --yes' debian/control
+ sudo rm -f *-build-deps_*
+
+ debuild
+ debuild -- clean
+
+ cat /tmp/squashfs-tools-ng*
+ cp ../*.deb $OUTPUT
+}
+
+
+build_rpm() {
+ case "$ID" in
+ centos)
+ if test $VERSION_ID -ge 8; then
+ # install doxygen
+ sudo sed -i 's/^enabled=.*/enabled=1/' \
+ /etc/yum.repos.d/CentOS-PowerTools.repo
+ cat /etc/yum.repos.d/CentOS-PowerTools.repo
+ fi
+ ;;
+ esac
+
+ cp -r $ROOT_RO/packages/squashfs-tools-ng.spec .
+ rpmdev-setuptree
+ spectool -g -R squashfs-tools-ng.spec
+ rpmspec --parse squashfs-tools-ng.spec \
+ | grep BuildRequires | cut -d' ' -f2 \
+ | xargs sudo yum install -y
+ rpmbuild --clean -ba squashfs-tools-ng.spec
+ cp ~/rpmbuild/RPMS/x86_64/*.rpm $OUTPUT
+
+}
+
+
+build_opensuse() {
+ cp -r $ROOT_RO/packages/squashfs-tools-ng.spec .
+
+ # Fetch source
+ rpmspec --parse squashfs-tools-ng.spec | grep Source0 \
+ | awk '{print $2}' \
+ | xargs wget -N -P $(rpm --eval '%{_sourcedir}')
+
+ # Install build requirements
+ rpmspec --parse squashfs-tools-ng.spec | grep BuildRequires \
+ | cut -d' ' -f2 \
+ | xargs sudo zypper install -y
+
+ rpmbuild --clean -ba squashfs-tools-ng.spec
+ cp ~/rpmbuild/RPMS/x86_64/*.rpm $OUTPUT
+}
+
+
+
+
+
+
+
+case "$ID" in
+ alpine) build_alpine ;;
+ archlinux|arch) build_archlinux ;;
+ centos|fedora) build_rpm;;
+ debian|ubuntu) build_deb;;
+ opensuse|opensuse-leap) build_opensuse;;
+ *) cat <<EOF >&2
+Unsupported distro "$ID"
+EOF
+ exit 1
+ ;;
+esac
diff --git a/packages/debian/changelog b/packages/debian/changelog
new file mode 100644
index 0000000..be28a0e
--- /dev/null
+++ b/packages/debian/changelog
@@ -0,0 +1,63 @@
+squashfs-tools-ng (1.0.2-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Sat, 05 Sep 2020 18:55:05 +0200
+
+squashfs-tools-ng (1.0.1-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Wed, 05 Aug 2020 19:35:46 +0200
+
+squashfs-tools-ng (1.0.0-2) unstable; urgency=medium
+
+ * Correct package sections (closes: #963155).
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Sat, 20 Jun 2020 11:51:59 +0200
+
+squashfs-tools-ng (1.0.0-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Library transition from libsquashfs0 to libsquashfs1 .
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Sat, 13 Jun 2020 19:24:26 +0200
+
+squashfs-tools-ng (0.9.1-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Sat, 16 May 2020 08:35:00 +0000
+
+squashfs-tools-ng (0.9-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Build with LZO compression support.
+ * Backport upstream fix for missing header without LZO.
+ * Update Standards-Version to 4.5.0 .
+
+ [ Pino Toscano <pino@debian.org> ]
+ * Enable the build on Hurd (closes: #947830).
+ * Don't ship .la files (closes: #947831).
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Sat, 04 Apr 2020 15:45:30 +0000
+
+squashfs-tools-ng (0.8-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Update Standards-Version to 4.4.1 .
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Tue, 31 Dec 2019 08:31:34 +0000
+
+squashfs-tools-ng (0.7-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Backport upstream fix for fstree_init test.
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Tue, 22 Oct 2019 18:40:57 +0000
+
+squashfs-tools-ng (0.5-1) unstable; urgency=medium
+
+ * Initial release (closes: #932971).
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Tue, 30 Jul 2019 11:44:14 +0000
diff --git a/packages/debian/clean b/packages/debian/clean
new file mode 100644
index 0000000..5da17f8
--- /dev/null
+++ b/packages/debian/clean
@@ -0,0 +1 @@
+config.log
diff --git a/packages/debian/control b/packages/debian/control
new file mode 100644
index 0000000..fe8f213
--- /dev/null
+++ b/packages/debian/control
@@ -0,0 +1,87 @@
+Source: squashfs-tools-ng
+Section: kernel
+Priority: optional
+Maintainer: Laszlo Boszormenyi (GCS) <gcs@debian.org>
+Build-Depends: debhelper-compat (= 12), pkg-config, libselinux1-dev [linux-any], liblzma-dev, liblz4-dev, zlib1g-dev, libzstd-dev, liblzo2-dev, doxygen
+Standards-Version: 4.5.0
+Homepage: https://github.com/AgentD/squashfs-tools-ng
+
+Package: squashfs-tools-ng
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: New set of tools for working with SquashFS images
+ SquashFS is a highly compressed read-only filesystem for Linux, optimized
+ for small size and high packing density. It is widely used in embedded
+ systems and bootable live media.
+ .
+ SquashFS supports many different compression formats, such as zstd, xz,
+ zlib or lzo for both data and metadata compression. It has many features
+ expected from popular filesystems, such as extended attributes and support
+ for NFS export.
+ .
+ As the name suggests, this is not the original user space tooling for
+ SquashFS. Here are some of the features that primarily distinguish this
+ package from the original:
+ - reproducible SquashFS images, i.e. deterministic packing without
+ any local time stamps,
+ - Linux `gen_init_cpio` like file listing for micro managing the
+ file system contents, permissions, and ownership without having to
+ replicate the file system (and especially permissions) locally,
+ - support for SELinux contexts file (see selabel_file(5)) to generate
+ SELinux labels.
+
+Package: libsquashfs1
+Architecture: any
+Section: libs
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: New set of tools for working with SquashFS images - shared library
+ SquashFS is a highly compressed read-only filesystem for Linux, optimized
+ for small size and high packing density. It is widely used in embedded
+ systems and bootable live media.
+ .
+ SquashFS supports many different compression formats, such as zstd, xz,
+ zlib or lzo for both data and metadata compression. It has many features
+ expected from popular filesystems, such as extended attributes and support
+ for NFS export.
+ .
+ As the name suggests, this is not the original user space tooling for
+ SquashFS. Here are some of the features that primarily distinguish this
+ package from the original:
+ - reproducible SquashFS images, i.e. deterministic packing without
+ any local time stamps,
+ - Linux `gen_init_cpio` like file listing for micro managing the
+ file system contents, permissions, and ownership without having to
+ replicate the file system (and especially permissions) locally,
+ - support for SELinux contexts file (see selabel_file(5)) to generate
+ SELinux labels.
+ .
+ This package contains the C libraries needed to run executables that use
+ the squashfs-tools-ng library.
+
+Package: libsquashfs-dev
+Architecture: any
+Section: libdevel
+Depends: ${misc:Depends}, libsquashfs1 (= ${binary:Version}), libselinux1-dev [linux-any], liblzma-dev, liblz4-dev, zlib1g-dev, libzstd-dev, liblzo2-dev
+Description: New set of tools for working with SquashFS images - development
+ SquashFS is a highly compressed read-only filesystem for Linux, optimized
+ for small size and high packing density. It is widely used in embedded
+ systems and bootable live media.
+ .
+ SquashFS supports many different compression formats, such as zstd, xz,
+ zlib or lzo for both data and metadata compression. It has many features
+ expected from popular filesystems, such as extended attributes and support
+ for NFS export.
+ .
+ As the name suggests, this is not the original user space tooling for
+ SquashFS. Here are some of the features that primarily distinguish this
+ package from the original:
+ - reproducible SquashFS images, i.e. deterministic packing without
+ any local time stamps,
+ - Linux `gen_init_cpio` like file listing for micro managing the
+ file system contents, permissions, and ownership without having to
+ replicate the file system (and especially permissions) locally,
+ - support for SELinux contexts file (see selabel_file(5)) to generate
+ SELinux labels.
+ .
+ This package contains the C development headers and library files needed to
+ compile programs using the squashfs-tools-ng library.
diff --git a/packages/debian/copyright b/packages/debian/copyright
new file mode 100644
index 0000000..4989954
--- /dev/null
+++ b/packages/debian/copyright
@@ -0,0 +1,55 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: squashfs-tools-ng
+Upstream-Contact: David Oberhollenzer <goliath@infraroot.at>
+Source: https://github.com/AgentD/squashfs-tools-ng
+
+Files: *
+Copyright: 2019- David Oberhollenzer <goliath@infraroot.at>
+License: GPL-3+
+
+Files: include/sqfs/* include/util/* lib/sqfs/* lib/tar/write_retry.c lib/util/*
+Copyright: 2019 David Oberhollenzer <goliath@infraroot.at>
+License: LGPL-3.0+
+ This package 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; either
+ version 3 of the License, or (at your option) any later version.
+ .
+ This package 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
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public
+ License along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License can be found in `/usr/share/common-licenses/LGPL-3'.
+
+Files: lib/fstree/fstree_sort.c
+Copyright: 2019 David Oberhollenzer <goliath@infraroot.at>,
+ 2019 Zachary Dremann <dremann@gmail.com>
+License: GPL-3+
+
+Files: debian/*
+Copyright: 2019- Laszlo Boszormenyi (GCS) <gcs@debian.org>
+License: GPL-3+
+
+License: GPL-3+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package 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 package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-3'.
diff --git a/packages/debian/libsquashfs-dev.install b/packages/debian/libsquashfs-dev.install
new file mode 100644
index 0000000..54979e9
--- /dev/null
+++ b/packages/debian/libsquashfs-dev.install
@@ -0,0 +1,5 @@
+usr/include/
+usr/lib/*/libsquashfs.a
+usr/lib/*/libsquashfs.so
+usr/lib/*/pkgconfig/
+doxygen-doc/* usr/share/doc/libsquashfs-dev
diff --git a/packages/debian/libsquashfs1.install b/packages/debian/libsquashfs1.install
new file mode 100644
index 0000000..0144c8e
--- /dev/null
+++ b/packages/debian/libsquashfs1.install
@@ -0,0 +1 @@
+usr/lib/*/libsquashfs.so.*
diff --git a/packages/debian/rules b/packages/debian/rules
new file mode 100755
index 0000000..adedbc7
--- /dev/null
+++ b/packages/debian/rules
@@ -0,0 +1,19 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+override_dh_auto_install:
+ dh_auto_install
+ # remove libtool .la files
+ find $(CURDIR)/debian/tmp/ -name '*.la' -delete
+
+override_dh_auto_build:
+ dh_auto_build
+ $(MAKE) doxygen-doc
+
+%:
+ dh ${@}
+
+.PHONY: override_dh_auto_install
diff --git a/packages/debian/source/format b/packages/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/packages/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/packages/debian/squashfs-tools-ng.install b/packages/debian/squashfs-tools-ng.install
new file mode 100644
index 0000000..9b1d778
--- /dev/null
+++ b/packages/debian/squashfs-tools-ng.install
@@ -0,0 +1,2 @@
+usr/bin/
+usr/share/man/
diff --git a/packages/debian/watch b/packages/debian/watch
new file mode 100644
index 0000000..120e780
--- /dev/null
+++ b/packages/debian/watch
@@ -0,0 +1,2 @@
+version=4
+https://github.com/AgentD/squashfs-tools-ng/tags .*/v?(\d\S+)\.(?:tar\.xz|txz|tar\.bz2|tbz2|tar\.gz|tgz)
diff --git a/packages/squashfs-tools-ng.spec b/packages/squashfs-tools-ng.spec
index 6ba2d5e..81add75 100644
--- a/packages/squashfs-tools-ng.spec
+++ b/packages/squashfs-tools-ng.spec
@@ -1,19 +1,12 @@
## Spec file to build squashf-tools-ng RPM package.
-##
-## Install following packages:
-## - yum install -y rpm-build spectool
-## - spectool -g -R squashfs-tools-ng.spec
-## - rpmspec --parse squashfs-tools-ng.spec | grep BuildRequires | cut -d' ' -f2 | xargs sudo yum install -y
-##
-## Note: tools like yum-builddep does not seem to work when installing
-## build requirements.
-##
-## Run:
-## - rpmbuild --clean -ba squashfs-tools-ng.spec
-##
+
+# OpenSUSE has no dist macro
+%if 0%{?suse_version} > 0
+%global dist .sles%{suse_version}
+%endif
Name: squashfs-tools-ng
-Version: 1.0.1
+Version: 1.0.2
Release: 1%{?dist}
License: GPLv3+
URL: https://github.com/AgentD/squashfs-tools-ng
@@ -44,21 +37,32 @@ this package from the original:
SELinux labels.
-%if 0%{?el} > 7
+%if 0%{?centos} > 7 || 0%{?fedora} >= 32 || 0%{?suse_version} >= 1500
%global use_zstd 1
%endif
+
+
# rpm-build / rpmdevtools
BuildRequires: gcc
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: doxygen
+BuildRequires: libselinux-devel
BuildRequires: zlib-devel
BuildRequires: xz-devel
BuildRequires: lzo-devel
BuildRequires: libattr-devel
+# Need to be explicitly declared on Fedora
+BuildRequires: make
+
+# OpenSUSE has a different lz4 devel package name
+%if 0%{?suse_version} > 0
+BuildRequires: liblz4-devel
+%else
BuildRequires: lz4-devel
+%endif
%if 0%{?use_zstd}
BuildRequires: libzstd-devel
@@ -71,6 +75,7 @@ Requires: xz
Requires: lzo
Requires: libattr
Requires: lz4
+Requires: libselinux
#Recommends: squashfs-tools
@@ -136,6 +141,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Thu Oct 01 2020 Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org> - 1.0.2-1
+- Add Fedora support.
+- Add OpenSUSE support.
+- Bump to version 1.0.2.
* Thu Aug 20 2020 Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org> - 1.0.1-1
- First package release.
-