Update build scripts

This commit is contained in:
Andrea Mazzoleni 2026-02-13 11:37:07 +01:00
parent 195f493558
commit ecb32f8c03
14 changed files with 237 additions and 187 deletions

13
pkg/control.in Normal file
View file

@ -0,0 +1,13 @@
Package: @PACKAGE@
Version: @PACKAGE_VERSION@-1
Section: utils
Priority: optional
Architecture: amd64
Maintainer: Andrea Mazzoleni <amadvance@gmail.com>
Description: Disk array backup for many large rarely-changed files
SnapRAID is a backup program for disk arrays. It stores parity
information of your data and it's able to recover from up to six disk
failures. SnapRAID is mainly targeted for a home media center, with a
lot of big files that rarely change.
Homepage: https://www.snapraid.it/
License: GPL-3.0-or-later

11
pkg/slack-desc Normal file
View file

@ -0,0 +1,11 @@
snapraid: snapraid (Disk array backup for many large rarely-changed files)
snapraid:
snapraid: SnapRAID is a backup program for disk arrays. It stores parity
snapraid: information of your data and it's able to recover from up to six disk
snapraid: failures. SnapRAID is mainly targeted for a home media center, with a
snapraid: lot of big files that rarely change.
snapraid:
snapraid:
snapraid:
snapraid:
snapraid:

View file

@ -0,0 +1,82 @@
#!/bin/bash
# SlackBuild script for @PACKAGE_NAME@
# Written for personal use / inspired by SlackBuilds.org templates
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=@PACKAGE@
VERSION=@PACKAGE_VERSION@
BUILD=${BUILD:-1}
TAG=${TAG:-_am}
PKGNAM=${PRGNAM}-${VERSION}
if [ -z "$ARCH" ]; then
case "$(uname -m)" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$(uname -m) ;;
esac
fi
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/@PACKAGE@-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
make -j4
make install DESTDIR=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
gzip -9 $PKG/usr/man/man?/*.?
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING AUTHORS HISTORY README snapraid.conf.example $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

10
pkg/snapraid.info.in Normal file
View file

@ -0,0 +1,10 @@
PRGNAM="@PACKAGE@"
VERSION="@PACKAGE_VERSION@"
HOMEPAGE="https://www.snapraid.it/"
DOWNLOAD="https://github.com/amadvance/snapraid/releases/download/v${VERSION}/@PACKAGE@-${VERSION}.tar.gz"
MD5SUM="UNSUPPORTED" # Optional; compute manually if needed
DOWNLOAD_x86_64="$DOWNLOAD"
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Andrea Mazzoleni"
EMAIL="amadvance@gmail.com"

52
pkg/snapraid.spec.in Normal file
View file

@ -0,0 +1,52 @@
Name: @PACKAGE@
Summary: Disk array backup for many large rarely-changed files
Version: @PACKAGE_VERSION_UNDERSCORE@
Release: 1%{?dist}
License: GPL-3.0-or-later
Group: Applications/System
URL: https://www.snapraid.it/
Source0: https://github.com/amadvance/@PACKAGE@/releases/download/v%{version}/@PACKAGE@-%{version}.tar.gz
BuildRequires: gcc
%description
SnapRAID is a backup program for disk arrays. It stores parity
information of your data and it's able to recover from up to six disk
failures. SnapRAID is mainly targeted for a home media center, with a
lot of big files that rarely change.
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%check
make check
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
%files
%license COPYING
%doc AUTHORS HISTORY README @PACKAGE@.conf.example
%{_bindir}/@PACKAGE@
%{_mandir}/man1/@PACKAGE@.1*
%{_mandir}/man1/snapraid_log.1*
%lang(de) %{_mandir}/de/man1/@PACKAGE@.1*
%lang(es) %{_mandir}/es/man1/@PACKAGE@.1*
%lang(fr) %{_mandir}/fr/man1/@PACKAGE@.1*
%lang(it) %{_mandir}/it/man1/@PACKAGE@.1*
%lang(ja) %{_mandir}/ja/man1/@PACKAGE@.1*
%lang(ko) %{_mandir}/ko/man1/@PACKAGE@.1*
%lang(pl) %{_mandir}/pl/man1/@PACKAGE@.1*
%lang(pt) %{_mandir}/pt/man1/@PACKAGE@.1*
%lang(ro) %{_mandir}/ro/man1/@PACKAGE@.1*
%lang(ru) %{_mandir}/ru/man1/@PACKAGE@.1*
%lang(sv) %{_mandir}/sv/man1/@PACKAGE@.1*
%lang(uk) %{_mandir}/uk/man1/@PACKAGE@.1*
%lang(zh) %{_mandir}/zh/man1/@PACKAGE@.1*
%changelog
# Add your changelog entries here