aboutsummaryrefslogtreecommitdiff
path: root/multimedia/vobsub2srt
diff options
context:
space:
mode:
authorLenard Spencer <lenardrspencer_at_gmail_dot_com>2020-03-21 00:24:56 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-03-21 00:24:56 +0700
commit44dd4b5bc3bb458b2c3aa40f8508f4b7effd42e9 (patch)
tree0be7b15c9b50f09d8525d85e26a682dab106607b /multimedia/vobsub2srt
parentc01bf486e3364be8124e00504bb8e0cf2db0336c (diff)
multimedia/vobsub2srt: Added (convert VOBSUB subtitles to SRT).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'multimedia/vobsub2srt')
-rw-r--r--multimedia/vobsub2srt/README13
-rw-r--r--multimedia/vobsub2srt/slack-desc19
-rw-r--r--multimedia/vobsub2srt/vobsub2srt-c++11.patch11
-rw-r--r--multimedia/vobsub2srt/vobsub2srt.SlackBuild106
-rw-r--r--multimedia/vobsub2srt/vobsub2srt.info10
5 files changed, 159 insertions, 0 deletions
diff --git a/multimedia/vobsub2srt/README b/multimedia/vobsub2srt/README
new file mode 100644
index 0000000000000..9c923197f078e
--- /dev/null
+++ b/multimedia/vobsub2srt/README
@@ -0,0 +1,13 @@
+vobsub2srt (convert VOBSUB subtitles to SRT)
+
+VobSub2SRT is a simple command line program to convert =.idx= / =.sub= subtitles
+into =.srt= text subtitles by using OCR. It is based on code from the
+MPlayer project. Some minor parts are copied from ffmpeg/avutil headers.
+Tesseract is used as OCR software.
+
+vobsub2srt is released under the GPL3+ license. The MPlayer code included is
+GPL2+ licensed.
+
+The quality of the OCR depends on the text in the subtitles. Currently the code
+does not use any preprocessing. But you can correct mistakes in the =.srt=
+files with a text editor or a special subtitle editor.
diff --git a/multimedia/vobsub2srt/slack-desc b/multimedia/vobsub2srt/slack-desc
new file mode 100644
index 0000000000000..85c7717e4b31d
--- /dev/null
+++ b/multimedia/vobsub2srt/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------------------------------------------------------|
+vobsub2srt: vobsub2srt (convert VOBSUB subtitles to SRT)
+vobsub2srt:
+vobsub2srt: Converts VobSub subtitles (.idx/.srt format) into .srt subtitles
+vobsub2srt:
+vobsub2srt:
+vobsub2srt: homepage: https://github.com/ruediger/VobSub2SRT
+vobsub2srt:
+vobsub2srt:
+vobsub2srt:
+vobsub2srt:
+vobsub2srt:
diff --git a/multimedia/vobsub2srt/vobsub2srt-c++11.patch b/multimedia/vobsub2srt/vobsub2srt-c++11.patch
new file mode 100644
index 0000000000000..3f2b6e44bb497
--- /dev/null
+++ b/multimedia/vobsub2srt/vobsub2srt-c++11.patch
@@ -0,0 +1,11 @@
+-- vobsub2srt/CMakeLists.txt.org 2018-12-29 09:08:18.308882020 +0100
++++ vobsub2srt/CMakeLists.txt 2018-12-29 09:08:01.435614925 +0100
+@@ -54,7 +54,7 @@
+ include(CheckCXXSourceRuns)
+
+ set(CMAKE_C_FLAGS "-std=gnu99")
+-set(CMAKE_CXX_FLAGS "-ansi -pedantic -Wall -Wextra -Wno-long-long")
++set(CMAKE_CXX_FLAGS "-ansi -pedantic -Wall -Wextra -Wno-long-long -std=gnu++11")
+
+ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mtune=native -march=native -DNDEBUG -fomit-frame-pointer -ffast-math") # TODO -Ofast GCC 4.6
+ set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
diff --git a/multimedia/vobsub2srt/vobsub2srt.SlackBuild b/multimedia/vobsub2srt/vobsub2srt.SlackBuild
new file mode 100644
index 0000000000000..9fd2f3b0c1338
--- /dev/null
+++ b/multimedia/vobsub2srt/vobsub2srt.SlackBuild
@@ -0,0 +1,106 @@
+#!/bin/sh
+
+# Slackware build script for vobsub2srt
+
+# Copyright 2020 Lenard Spencer
+# 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.
+
+PRGNAM=vobsub2srt
+SRCNAM=VobSub2SRT
+VERSION=${VERSION:-1.0pre7}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+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 $SRCNAM-$VERSION
+tar -xvf $CWD/$SRCNAM-$VERSION.tar.gz || tar -xvf $CWD/v$VERSION.tar.gz
+cd $SRCNAM-$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 {} \;
+
+# patch to build with latest tesseract:
+patch -p1 < $CWD/vobsub2srt-c++11.patch
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS="$SLKCFLAGS -std=c++11" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DINSTALL_DATA_DIR_BASE=/usr/share \
+ -DINSTALL_DOC_DIR_BASE=/usr/doc \
+ -DINSTALL_MAN_DIR=/usr/man \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make
+ make install DESTDIR=$PKG
+cd ..
+
+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/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ COPYING README* \
+ $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:-tgz}
diff --git a/multimedia/vobsub2srt/vobsub2srt.info b/multimedia/vobsub2srt/vobsub2srt.info
new file mode 100644
index 0000000000000..67c6159d8db88
--- /dev/null
+++ b/multimedia/vobsub2srt/vobsub2srt.info
@@ -0,0 +1,10 @@
+PRGNAM="vobsub2srt"
+VERSION="1.0pre7"
+HOMEPAGE="https://github.com/ruediger/VobSub2SRT"
+DOWNLOAD="https://github.com/ruediger/VobSub2SRT/archive/v1.0pre7/VobSub2SRT-1.0pre7.tar.gz"
+MD5SUM="3198d5c66c96b26a2c66d67d7b89cc4e"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="tesseract"
+MAINTAINER="Lenard Spencer"
+EMAIL="lenardrspencer_at_gmail_dot_com"