diff options
-rw-r--r-- | multimedia/ytdlp-gui/README | 2 | ||||
-rw-r--r-- | multimedia/ytdlp-gui/doinst.sh | 13 | ||||
-rw-r--r-- | multimedia/ytdlp-gui/slack-desc | 19 | ||||
-rw-r--r-- | multimedia/ytdlp-gui/ytdlp-gui.SlackBuild | 192 | ||||
-rw-r--r-- | multimedia/ytdlp-gui/ytdlp-gui.info | 10 |
5 files changed, 236 insertions, 0 deletions
diff --git a/multimedia/ytdlp-gui/README b/multimedia/ytdlp-gui/README new file mode 100644 index 0000000000..86973e4433 --- /dev/null +++ b/multimedia/ytdlp-gui/README @@ -0,0 +1,2 @@ +Repackage of deb. +It should work with yt-dlp-bin if not yt-dlp installed. diff --git a/multimedia/ytdlp-gui/doinst.sh b/multimedia/ytdlp-gui/doinst.sh new file mode 100644 index 0000000000..aea0f894eb --- /dev/null +++ b/multimedia/ytdlp-gui/doinst.sh @@ -0,0 +1,13 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -x /usr/bin/update-mime-database ]; then + /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/multimedia/ytdlp-gui/slack-desc b/multimedia/ytdlp-gui/slack-desc new file mode 100644 index 0000000000..ecfc6cbedd --- /dev/null +++ b/multimedia/ytdlp-gui/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +ytdlp-gui: ytdlp-gui (GUI for ytdlp written in Rust ) +ytdlp-gui: +ytdlp-gui: +ytdlp-gui: +ytdlp-gui: +ytdlp-gui: https://github.com/BKSalman/ytdlp-gui +ytdlp-gui: +ytdlp-gui: +ytdlp-gui: +ytdlp-gui: +ytdlp-gui: diff --git a/multimedia/ytdlp-gui/ytdlp-gui.SlackBuild b/multimedia/ytdlp-gui/ytdlp-gui.SlackBuild new file mode 100644 index 0000000000..b950cb4c3e --- /dev/null +++ b/multimedia/ytdlp-gui/ytdlp-gui.SlackBuild @@ -0,0 +1,192 @@ +#!/bin/bash + +# Slackware build script for ytdlp-gui + +# Copyright 2025 Ioannis Anagnostakis GR +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=ytdlp-gui +VERSION=${VERSION:-3.1.2} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +SRCNAM64=ytdlp-gui_3.1.2-1_amd64 +SRCNAM32= +COMPRESS=deb + +Disposition64="$SRCNAM64"_"$VERSION" +Disposition32= + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +if [ "$ARCH" = "i586" ]; then + SRCNAM="$SRCNAM32" + DISPO="$Disposition32" +elif [ "$ARCH" = "i686" ]; then + SRCNAM="$SRCNAM32" + DISPO="$Disposition32" +elif [ "$ARCH" = "x86_64" ]; then + SRCNAM="$SRCNAM64" + DISPO="$Disposition64" +else + SRCNAM= + DISPO= +fi + +if [ -z "$SRCNAM" ] || [ -z "$COMPRESS" ]; then + echo "SRCNAM and/or COMPRESS are empty, exiting." + exit 1 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT + + +if [[ $COMPRESS = "deb" ]]; then +# extract directly to $PKG/ + ar x "$CWD"/$SRCNAM.$COMPRESS 2>/dev/null || \ + ar x "$CWD"/"$DISPO"."$COMPRESS" 2>/dev/null || \ + { echo "No valid archive found!"; exit 1; } + rm debian-binary control.tar.* + tar -xJf data.tar.xz -C "$PKG" 2>/dev/null || \ + tar --use-compress-program=unzstd -xf data.tar.zst -C "$PKG" 2>/dev/null || \ + tar -xzf data.tar.gz -C "$PKG" 2>/dev/null || \ + { echo "No valid archive found!"; exit 1; } +cd "$PKG" +# Everything extracted in $PKG/ and you are in $PKG/ also. +elif +[[ $COMPRESS = "pkg.tar.zst" ]]; then +# extract directly to $PKG/ +tar --use-compress-program=unzstd -xf "$CWD"/*.$COMPRESS -C "$PKG" || tar -I unzstd -xf "$CWD"/*.$COMPRESS -C "$PKG" 2>/dev/null || \ + { echo "No valid archive found!"; exit 1; } +cd "$PKG" +# Everything extracted in $PKG/ and you are in $PKG/ also. +elif + [[ $COMPRESS == "AppImage" ]]; then + if [ -d "$TMP"/squashfs-root ]; then + rm -rf "$TMP"/squashfs-root + fi + if [ -d "$TMP"/"$PRGNAM-$VERSION" ]; then + rm -rf "$TMP"/"$PRGNAM-$VERSION" + fi + mv "$CWD"/"$SRCNAM"*."$COMPRESS" "$TMP"/"$SRCNAM-$VERSION"."$COMPRESS" + chmod +x "$TMP"/"$SRCNAM-$VERSION"."$COMPRESS" + pushd "$TMP" || exit 1 + ./"$SRCNAM-$VERSION"."$COMPRESS" --appimage-extract + popd || exit 1 + mv "$TMP"/squashfs-root "$TMP"/"$PRGNAM-$VERSION" + cd "$TMP"/"$PRGNAM-$VERSION" +elif +# extract to $TMP/ + [[ $COMPRESS == "snap" ]]; then + cd "$TMP" + unsquashfs -d "$CWD"/"$SRCNAM"."$COMPRESS" + mv squashfs-root "$PRGNAM-$VERSION" + cd "$PRGNAM-$VERSION" +elif + [[ $COMPRESS = "rpm" ]]; then +# extract to $PKG/ + rpm -Kv "$CWD"/"$SRCNAM.$COMPRESS" + rpm2cpio "$CWD"/"$SRCNAM"."$COMPRESS" > "$TMP"/"$SRCNAM"."$COMPRESS".cpio + cd "$PKG" + cpio -idv < "$TMP"/"$SRCNAM"."$COMPRESS".cpio +# Everything extracted in $PKG/ and you are in $PKG/ also. +else +# If you repackage other type of $COMPRESS here you can add commands to extract it... +# You are in $CWD/ +echo "COMPRESS is not deb or rpm or snap or AppImage or pkg.tar.zst file" +echo "Add here custom commands for $COMPRESS to proceed binary repackage..." +exit 1 +fi + +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 {} \; + +# Add additional commands here that needed: (for .deb and .rpm repackage most of times nothing needed) +pushd $PKG/usr/share/icons/hicolor +mkdir -p 128x128/apps +mv $PRGNAM.png 128x128/apps +popd + +sed -i 's/^Categories=/Categories=AudioVideo;/' "$PKG"/usr/share/applications/ytdlp-gui.desktop + + +# Strip binaries and libraries +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 +find "$PKG"/ -type f -name "*.so*" -exec chmod 755 {} \; + +mkdir -p "$PKG"/usr/doc/$PRGNAM-"$VERSION" +if [[ $COMPRESS != "rpm" && $COMPRESS != "deb" && $COMPRESS != "pkg.tar.zst" ]]; then +cp -a \ + documentation \ + $PKG/usr/doc/$PRGNAM-$VERSION +else +# If COMPRESS = rpm,deb or Arch pkg.tar.zst it fix docs and man pages following Slackware culture. +if [ -d "$PKG/usr/share/doc/$PRGNAM" ]; then + mv "$PKG/usr/share/doc/$PRGNAM" "$PKG/usr/doc/$PRGNAM-$VERSION/" + rm -rf "$PKG/usr/share/doc" +fi + +# Move man pages, if exists +if [ -d "$PKG/usr/share/man" ]; then + mv "$PKG/usr/share/man" "$PKG/usr/man/" +fi + +# Move licenses, if exists +if [ -d "$PKG/usr/share/licenses" ]; then + mv "$PKG/usr/share/licenses" "$PKG/usr/doc/$PRGNAM-$VERSION/" +elif [ -f "$PKG/usr/share/LICENSE" ]; then + mv "$PKG/usr/share/LICENSE" "$PKG/usr/doc/$PRGNAM-$VERSION/" +fi +find "$PKG"/usr/doc/"$PRGNAM"-"$VERSION" -type f -exec chmod 644 {} \; +fi + +cat "$CWD"/$PRGNAM.SlackBuild > $PKG/usr/doc/"$PRGNAM-$VERSION"/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg --remove-tmp-rpaths -l y -c n "$OUTPUT"/"$PRGNAM"-"$VERSION"-"$ARCH"-"$BUILD""$TAG"."$PKGTYPE" diff --git a/multimedia/ytdlp-gui/ytdlp-gui.info b/multimedia/ytdlp-gui/ytdlp-gui.info new file mode 100644 index 0000000000..63d5d906b3 --- /dev/null +++ b/multimedia/ytdlp-gui/ytdlp-gui.info @@ -0,0 +1,10 @@ +PRGNAM="ytdlp-gui" +VERSION="3.1.2" +HOMEPAGE="https://github.com/BKSalman/ytdlp-gui" +DOWNLOAD="UNSUPPORTED" +MD5SUM="" +DOWNLOAD_x86_64="https://github.com/BKSalman/ytdlp-gui/releases/download/v3.1.2/ytdlp-gui_3.1.2-1_amd64.deb" +MD5SUM_x86_64="fd1aa428d9ae3db6d57a6ddac6063642" +REQUIRES="yt-dlp" +MAINTAINER="Ioannis Anagnostakis" +EMAIL="rizitis@gmail.com" |