-
-
Save felipe19930/ccffeff49b961073632a37107cee30e3 to your computer and use it in GitHub Desktop.
wallpaperdownloader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Eloy Garcia Almaden <eloy.garcia.pca@gmail.com> | |
# Contributor: gbr <gbr@protonmail.com> | |
pkgname=wallpaperdownloader | |
pkgver=4.2 | |
pkgrel=1 | |
pkgdesc='Download, manage and change automatically your favorite wallpapers from the Internet' | |
arch=('any') | |
url='https://bitbucket.org/eloy_garcia_pca/wallpaperdownloader' | |
license=('GPL2') | |
depends=('java-runtime>=8' 'xdg-utils') | |
makedepends=('java-environment>=8' 'maven') | |
source=("$pkgname-$pkgver.tar.gz::$url/get/v$pkgver.tar.gz" | |
wallpaperdownloader.{desktop,sh}) | |
noextract=("${source[@]%%::*}") | |
sha256sums=('76e8d523f6127032d08f33167e9182ae52d5900d98c314a85c7f7aba73592a12' | |
'SKIP' 'SKIP') | |
prepare() { | |
mkdir -p "$pkgname-$pkgver" | |
bsdtar -C "$pkgname-$pkgver" -x -f "$pkgname-$pkgver.tar.gz" --strip-components 1 | |
} | |
build() { | |
cd "$pkgname-$pkgver" | |
mvn clean package -DpackagingPhase=none | |
} | |
package() { | |
cd "$pkgname-$pkgver" | |
install -Dm644 "target/$pkgname.jar" "$pkgdir/usr/share/java/$pkgname/$pkgname.jar" | |
install -Dm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/$pkgname" | |
install -Dm644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop" | |
install -Dm644 "aur/$pkgname.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Name=WallpaperDownloader | |
GenericName=Wallpaper Downloader | |
Comment=Download, manage and change your wallpapers automatically from the Internet | |
Keywords=wallpaper;gallery;internet;download;downloader;changer;picture;desktop | |
Exec=/usr/bin/wallpaperdownloader | |
Icon=wallpaperdownloader | |
Terminal=false | |
Type=Application | |
Categories=Utility; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if /usr/bin/java -version 2>&1 | grep 'version "1.7' >/dev/null | |
then | |
echo "WallpaperDownloader requires Java 8 or higher" >&2 | |
exit 1 | |
fi | |
# Memory usage is limited to 256 MBytes of RAM | |
exec /usr/bin/java -Xmx256m -Xms128m -jar '/usr/share/java/wallpaperdownloader/wallpaperdownloader.jar' "$@" |
Hi @felipe19930 and no worries at all. Thank you very much for answering and thanks for the explanation. Now, everything is much clearer for me. I think this final version would suit all the requirements when I include modified wallpaperdownloader.desktop and wallpaperdownloader.sh files upstream in the aur directory of my project:
# Maintainer: Eloy Garcia Almaden <eloy.garcia.pca@gmail.com>
# Contributor: gbr <gbr@protonmail.com>
pkgname=wallpaperdownloader
pkgver=4.3
pkgrel=1
pkgdesc='Download, manage and change automatically your favorite wallpapers from the Internet'
arch=('any')
url='https://bitbucket.org/eloy_garcia_pca/wallpaperdownloader'
license=('GPL3')
depends=('java-runtime>=8' 'xdg-utils')
makedepends=('java-environment>=8' 'maven')
source=("$pkgname-$pkgver.tar.gz::$url/get/v$pkgver.tar.gz")
noextract=("${source[@]%%::*}")
sha256sums=('TODO:CALCULATETHISVALUE')
prepare() {
mkdir -p "$pkgname-$pkgver"
bsdtar -C "$pkgname-$pkgver" -x -f "$pkgname-$pkgver.tar.gz" --strip-components 1
}
build() {
cd "$pkgname-$pkgver"
mvn clean package -DpackagingPhase=none
}
package() {
cd "$pkgname-$pkgver"
# Complete jar
install -Dm644 "target/$pkgname.jar" "$pkgdir/usr/share/java/$pkgname/$pkgname.jar"
# Launching script
install -Dm755 "aur/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
# .desktop file and icon
install -Dm644 "aur/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
install -Dm644 "aur/$pkgname.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg"
}
If you give me your OK I update those files in my devel branch to get them ready for my next release.
Best,
Eloy
Everything seems fine now. :)
You have my blessing 😄
Great, thanks!!! 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @egara, sorry I took too long to respond you.
Unfortunately, your modifications won't work as-is. Specifically, the
prepare()
function I originally added, is actually necessary to extract the tarball to the "right" directory. Let me try to explain a bit better.When you download a versioned tarball from BitBucket, the root directory inside the tarball is named like this:
$PROJECT_OWNER-$PROJECT_NAME-$COMMIT
, i.e.:/eloy_garcia_pca-wallpaperdownloader-7d8fd7a68b34/<source_code_here>
So, by removing the
prepare()
function and thenoextract
variable,makepkg
will automatically extract the tarball, but we won't be able to easilycd
into the right directory to build Wallpaper Downloader, unless we also store the commit of the version each time there's an update.My original approach, however, prevents
makepkg
from extracting the tarball, and then we manually extract it usingbsdtar
inprepare()
, but onto a more "standardized" directory name, i.e. "wallpaperdownloader-$VERSION".Aside from that, I agree with you that there's no need to also upload the
.desktop
and.sh
files to the AUR, so I was hoping you could upstream them to your repository, eventually.Cheers.