diff options
author | tatsumoto | 2024-01-30 19:16:08 +0300 |
---|---|---|
committer | tatsumoto | 2024-01-30 19:16:08 +0300 |
commit | a0d329fa96928deaa88dcf59ebf898d7bdcb21a7 (patch) | |
tree | 46aa03e27ead02f5615af9d0e68a9d2c4aa53edb | |
parent | 3fbc92cb6634abd35bb7b0a60b46ce4d1a53ffce (diff) | |
download | aur-a0d329fa96928deaa88dcf59ebf898d7bdcb21a7.tar.gz |
move inline files
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | 90-avoid-microsoft-sans-serif.conf | 10 | ||||
-rw-r--r-- | PKGBUILD | 85 | ||||
-rw-r--r-- | subs2srs.desktop | 11 | ||||
-rwxr-xr-x | subs2srs.sh | 14 | ||||
-rw-r--r-- | subsretimer.desktop | 11 |
6 files changed, 83 insertions, 59 deletions
@@ -1,7 +1,7 @@ pkgbase = subs2srs pkgdesc = A small utility that allows you to create Anki (flash card software) import files based on your favorite foreign language movies and TV shows to aid in the language learning process. pkgver = 29.7 - pkgrel = 5 + pkgrel = 6 url = http://subs2srs.sourceforge.net/ arch = any license = GPL @@ -14,7 +14,14 @@ pkgbase = subs2srs optdepends = anki optdepends = noto-fonts-cjk: display japanese characters source = subs2srs_v29.7.zip::https://sourceforge.net/projects/subs2srs/files/subs2srs/subs2srs_v29.7/subs2srs_v29.7.zip/download + source = subs2srs.sh + source = subs2srs.desktop + source = subsretimer.desktop + source = 90-avoid-microsoft-sans-serif.conf sha256sums = b6731c6c02b63315669f1ad28587052af39dff3e7aba9dd6bcb49a9667b075d1 + sha256sums = 8283d2835de5fb67908b654524a131cf61f46195eb8cd17f5b866422ff4c676b + sha256sums = 3b66602d3be448b2305f3bb8908f2f8ee814fd40e1594c74520a383d79d69175 + sha256sums = 9fb5d61ad017cecd536b6d1ab76ad8e4488f82a34b28306aadce9ff0ccb9735c + sha256sums = 763763709426ae8a0969616f06c7fda557b9324883a3c84c42d9d9431d8569f9 pkgname = subs2srs - diff --git a/90-avoid-microsoft-sans-serif.conf b/90-avoid-microsoft-sans-serif.conf new file mode 100644 index 000000000000..916a22b0e50f --- /dev/null +++ b/90-avoid-microsoft-sans-serif.conf @@ -0,0 +1,10 @@ +<?xml version='1.0'?> +<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> +<fontconfig> + <match> + <test name="family"><string>Microsoft Sans Serif</string></test> + <edit name="family" mode="assign" binding="strong"> + <string>Noto Sans CJK JP</string> + </edit> + </match> +</fontconfig> @@ -2,7 +2,7 @@ # Contributor: darkgrin <darkgrin at yahoo dot com> pkgname=subs2srs pkgver=29.7 -pkgrel=5 +pkgrel=6 pkgdesc="A small utility that allows you to create Anki (flash card software) import files based on your favorite foreign language movies and TV shows to aid in the language learning process." arch=('any') url="http://subs2srs.sourceforge.net/" @@ -10,64 +10,44 @@ license=('GPL') depends=('mono' 'ffmpeg' 'mp3gain' 'mkvtoolnix-cli') optdepends=('anki' 'noto-fonts-cjk: display japanese characters') makedepends=('p7zip' 'icoutils') -source=("${pkgname}_v${pkgver}.zip::https://sourceforge.net/projects/${pkgname}/files/${pkgname}/${pkgname}_v${pkgver}/${pkgname}_v${pkgver}.zip/download") -sha256sums=('b6731c6c02b63315669f1ad28587052af39dff3e7aba9dd6bcb49a9667b075d1') +source=("${pkgname}_v${pkgver}.zip::https://sourceforge.net/projects/${pkgname}/files/${pkgname}/${pkgname}_v${pkgver}/${pkgname}_v${pkgver}.zip/download" + "${pkgname}.sh" + "${pkgname}.desktop" + "subsretimer.desktop" + "90-avoid-microsoft-sans-serif.conf") +sha256sums=('b6731c6c02b63315669f1ad28587052af39dff3e7aba9dd6bcb49a9667b075d1' + '8283d2835de5fb67908b654524a131cf61f46195eb8cd17f5b866422ff4c676b' + '3b66602d3be448b2305f3bb8908f2f8ee814fd40e1594c74520a383d79d69175' + '9fb5d61ad017cecd536b6d1ab76ad8e4488f82a34b28306aadce9ff0ccb9735c' + '763763709426ae8a0969616f06c7fda557b9324883a3c84c42d9d9431d8569f9') package() { - cd "$srcdir/$pkgname" + cd -- "$srcdir/$pkgname" + + # create directories mkdir -p "$pkgdir/opt" \ "$pkgdir/usr/bin" \ "$pkgdir/usr/share/applications" \ "$pkgdir/usr/share/licenses/$pkgname" \ "$pkgdir/etc/fonts/conf."{avail,d} - cp -r "$srcdir/$pkgname" "$pkgdir/opt/" - - cat <<-END > "$pkgdir/usr/bin/$pkgname" - #!/bin/bash - conf_dir="\$HOME/.config/$pkgname" - - [ ! -d "\$conf_dir" ] && mkdir -p "\$conf_dir" - [ ! -f "\$conf_dir/preferences.txt" ] && cp "/opt/subs2srs/preferences.txt" "\$conf_dir/" - - cd "\$conf_dir" - exec mono /opt/subs2srs/subs2srs.exe - END - chmod 755 "$pkgdir/usr/bin/$pkgname" + # install the bulk of the app to /opt. + cp -r -- "$srcdir/$pkgname" "$pkgdir/opt/" - cat <<-END > "$pkgdir/usr/share/applications/$pkgname.desktop" - [Desktop Entry] - Name=$pkgname - Comment=Convert movies and TV shows to flashcards - GenericName=$pkgname - Exec=$pkgname - Icon=$pkgname - Categories=Education;Languages;AudioVideo;Audio;Video; - Terminal=false - Type=Application - StartupNotify=true - Version=1.0 - END + # create a shortcut in /bin + install -Dm755 "$srcdir/${pkgname}.sh" "$pkgdir/usr/bin/$pkgname" - cat <<-END > "$pkgdir/usr/share/applications/subsretimer.desktop" - [Desktop Entry] - Name=Subs Re-Timer - Comment=Re-time a subtitle file based on the timings of another subtitle file - GenericName=Subs Re-Timer - Exec=mono /opt/subs2srs/Utils/SubsReTimer/SubsReTimer.exe - Icon=subsretimer - Categories=Education;Languages;AudioVideo;Audio;Video; - Terminal=false - Type=Application - StartupNotify=true - Version=1.0 - END + # create .desktop files + install -Dm644 "$srcdir/${pkgname}.desktop" "$pkgdir/usr/share/applications/${pkgname}.desktop" + install -Dm644 "$srcdir/subsretimer.desktop" "$pkgdir/usr/share/applications/subsretimer.desktop" + # link to the correct system executables ln -sf /usr/bin/ffmpeg "$pkgdir/opt/subs2srs/Utils/ffmpeg/ffmpeg.exe" ln -sf /usr/bin/mp3gain "$pkgdir/opt/subs2srs/Utils/mp3gain/mp3gain.exe" ln -sf /usr/bin/mkvextract "$pkgdir/opt/subs2srs/Utils/mkvtoolnix/mkvextract.exe" ln -sf /usr/bin/mkvinfo "$pkgdir/opt/subs2srs/Utils/mkvtoolnix/mkvinfo.exe" + # install app icons 7z -y e "$pkgname.exe" '3.ico' '4.ico' -r 1>/dev/null icotool -x '3.ico' '4.ico' for size in 16 32; do @@ -84,21 +64,12 @@ package() { "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/subsretimer.png" done - rm ./*.ico ./*.png + rm -- ./*.ico ./*.png - mv "$pkgdir/opt/subs2srs/gpl.txt" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE" + # install the license file + mv -- "$pkgdir/opt/subs2srs/gpl.txt" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE" - cat <<END > "$pkgdir/etc/fonts/conf.avail/90-avoid-microsoft-sans-serif.conf" -<?xml version='1.0'?> -<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> -<fontconfig> - <match> - <test name="family"><string>Microsoft Sans Serif</string></test> - <edit name="family" mode="assign" binding="strong"> - <string>Noto Sans CJK JP</string> - </edit> - </match> -</fontconfig> -END + # fix fonts + install -Dm644 "$srcdir/90-avoid-microsoft-sans-serif.conf" "$pkgdir/etc/fonts/conf.avail/90-avoid-microsoft-sans-serif.conf" ln -sr "$pkgdir/etc/fonts/conf."{avail,d}"/90-avoid-microsoft-sans-serif.conf" } diff --git a/subs2srs.desktop b/subs2srs.desktop new file mode 100644 index 000000000000..d926ed365a15 --- /dev/null +++ b/subs2srs.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=subs2srs +Comment=Convert movies and TV shows to flashcards +GenericName=subs2srs +Exec=subs2srs +Icon=subs2srs +Categories=Education;Languages;AudioVideo;Audio;Video; +Terminal=false +Type=Application +StartupNotify=true +Version=1.0 diff --git a/subs2srs.sh b/subs2srs.sh new file mode 100755 index 000000000000..2e2ed889fca1 --- /dev/null +++ b/subs2srs.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +conf_dir="$HOME/.config/subs2srs" + +if [[ ! -d $conf_dir ]]; then + mkdir -p "$conf_dir" +fi + +if [[ ! -f $conf_dir/preferences.txt ]]; then + cp -- "/opt/subs2srs/preferences.txt" "$conf_dir/" +fi + +cd -- "$conf_dir" || exit 1 +exec mono /opt/subs2srs/subs2srs.exe diff --git a/subsretimer.desktop b/subsretimer.desktop new file mode 100644 index 000000000000..acc601ae7cd6 --- /dev/null +++ b/subsretimer.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Subs Re-Timer +Comment=Re-time a subtitle file based on the timings of another subtitle file +GenericName=Subs Re-Timer +Exec=mono /opt/subs2srs/Utils/SubsReTimer/SubsReTimer.exe +Icon=subsretimer +Categories=Education;Languages;AudioVideo;Audio;Video; +Terminal=false +Type=Application +StartupNotify=true +Version=1.0 |