From 440bdefc8a4fa381e940ffa3cac1e8b503ed33d5 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Wed, 15 Jul 2026 08:42:39 +0300 Subject: [PATCH] Initial commit --- .gitignore | 3 +++ check-version.sh | 14 ++++++++++++ info.yml | 22 +++++++++++++++++++ post_install.sh | 5 +++++ recipe.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 101 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 info.yml create mode 100644 post_install.sh create mode 100644 recipe.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d96df7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore BPM archives and signatures +*.bpm +*.bpm.sig diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..d64b51a --- /dev/null +++ b/check-version.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +URL="https://sourceforge.net/projects/cdrtools/files/alpha" + +# Get version number from tag name +VERSION=$(curl -s -L "$URL" | grep -o -P 'cdrtools-(\d+\.\d+[ab]\d+)\.tar\.gz' | sort -V | tail -n1) + +# Trim prefix +VERSION=${VERSION//cdrtools-} + +# Trim suffix +VERSION=${VERSION//.tar.gz} + +echo "$VERSION" diff --git a/info.yml b/info.yml new file mode 100644 index 0000000..843304c --- /dev/null +++ b/info.yml @@ -0,0 +1,22 @@ +name: cdrtools +description: Highly portable CD/DVD/BluRay command line recording software +version: 3.02a09 +revision: 1 +url: https://sourceforge.net/projects/cdrtools/ +license: CDDL-1.0,GPL-2.0-or-later,LGPL-2.1-or-later +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +depends: + - acl + - glibc + - libcap +downloads: + - url: https://downloads.sourceforge.net/project/cdrtools/alpha/cdrtools-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: c7e4f732fb299e9b5d836629dadf5512aa5e6a5624ff438ceb1d056f4dcb07c2 +keep: + - etc/default/cdrecord + - etc/default/rscsi diff --git a/post_install.sh b/post_install.sh new file mode 100644 index 0000000..3e05f45 --- /dev/null +++ b/post_install.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +setcap cap_sys_resource,cap_dac_override,cap_sys_admin,cap_sys_nice,cap_net_bind_service,cap_ipc_lock,cap_sys_rawio+ep /usr/bin/cdrecord +setcap cap_dac_override,cap_sys_admin,cap_sys_nice,cap_net_bind_service,cap_sys_rawio+ep /usr/bin/cdda2wav +setcap cap_dac_override,cap_sys_admin,cap_net_bind_service,cap_sys_rawio+ep /usr/bin/readcd diff --git a/recipe.sh b/recipe.sh new file mode 100644 index 0000000..4cd848e --- /dev/null +++ b/recipe.sh @@ -0,0 +1,57 @@ +# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + + sed -i 's|/opt/schily|/usr|g' DEFAULTS/Defaults.linux + sed -i 's|DEFINSGRP=.*|DEFINSGRP=root|' DEFAULTS/Defaults.linux + sed -i 's|INSDIR=\s*sbin|INSDIR=bin|' rscsi/Makefile +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + export GMAKE_NOWARN=true + export CFLAGS="$CFLAGS -std=gnu89 -fno-strict-aliasing" + make -j1 INS_BASE=/usr INS_RBASE=/ VERSION_OS="TideLinux" LDOPTX="$LDFLAGS" +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + make tests +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make DESTDIR="$BPM_OUTPUT" install + + export GMAKE_NOWARN=true + make INS_BASE=/usr INS_RBASE=/ DESTDIR="$BPM_OUTPUT" install + + # Remove static libraries, headers & conflicting man pages + rm "$BPM_OUTPUT"/usr/lib/*.a + rm -r "$BPM_OUTPUT"/usr/lib/profiled + rm -r "$BPM_OUTPUT"/usr/include + rm -r "$BPM_OUTPUT"/usr/share/man/man3 + + # Autoload 'sg' module needed by cdrecord + echo sg | install -vDm644 /dev/stdin "$BPM_OUTPUT"/usr/lib/modules-load.d/cdrecord.conf + + # Patch binary permissions, by default it's swx--x--x + chmod a+rx "$BPM_OUTPUT"/usr/bin/* + + # Create symlinks for cdrkit compatibility + ln -s /usr/bin/cdrecord "$BPM_OUTPUT"/usr/bin/wodim + ln -s /usr/bin/readcd "$BPM_OUTPUT"/usr/bin/readom + ln -s /usr/bin/mkisofs "$BPM_OUTPUT"/usr/bin/genisoimage + ln -s /usr/bin/cdda2wav "$BPM_OUTPUT"/usr/bin/icedax + + # Install package license + install -Dm644 "$BPM_SOURCE"/{COPYING,CDDL.Schily.txt,GPL-2.0.txt,LGPL-2.1.txt} -t "$BPM_OUTPUT"/usr/share/licenses/cdrtools +}