wok-6.x rev 18985
Add: Backgrounds created by the community. See: https://github.com/hackdorte/slitaz-community-backgrounds
author | Leonardo Laporte <hackdorte@sapo.pt> |
---|---|
date | Thu Mar 17 00:11:28 2016 -0300 (2016-03-17) |
parents | 8ea64ddbb51e |
children | 98906245f829 |
files | get-community-backgrounds/receipt get-community-backgrounds/stuff/get-community-backgrounds |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-community-backgrounds/receipt Thu Mar 17 00:11:28 2016 -0300 1.3 @@ -0,0 +1,23 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-community-backgrounds" 1.7 +VERSION="001" 1.8 +CATEGORY="x-window" 1.9 +SHORT_DESC="Beautiful wallpapers created by the Slitaz Community." 1.10 +MAINTAINER="hackdorte@sapo.pt" 1.11 +LICENSE="BSD" 1.12 +WEB_SITE="https://github.com/hackdorte/slitaz-community-backgrounds" 1.13 +TAGS="artwork background wallpaper" 1.14 + 1.15 +DEPENDS="unzip" 1.16 + 1.17 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.18 +genpkg_rules() 1.19 +{ 1.20 + mkdir -p $fs/usr/bin 1.21 + cp stuff/* $fs/usr/bin 1.22 +} 1.23 +post_install() 1.24 +{ 1.25 + get-community-backgrounds 1.26 +} 1.27 \ No newline at end of file
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-community-backgrounds/stuff/get-community-backgrounds Thu Mar 17 00:11:28 2016 -0300 2.3 @@ -0,0 +1,80 @@ 2.4 +#!/bin/sh -e 2.5 + 2.6 +[ -f '/etc/slitaz/slitaz.conf' ] && . /etc/slitaz/slitaz.conf 2.7 +[ -z "$INSTALLED" ] && INSTALLED='/var/lib/tazpkg/installed' 2.8 + 2.9 +PACKAGE="get-community-backgrounds" 2.10 +PKGNAME="slitaz-community-backgrounds" 2.11 +VERSION="001" 2.12 +CATEGORY="x-window" 2.13 +SHORT_DESC="Beautiful wallpapers created by the Slitaz Community." 2.14 +MAINTAINER="hackdorte@sapo.pt" 2.15 +LICENSE="BSD" 2.16 +WEB_SITE="https://github.com/hackdorte/slitaz-community-backgrounds" 2.17 +TAGS="artwork background wallpaper" 2.18 +DEPENDS="unzip" 2.19 + 2.20 +ROOT="$1" 2.21 +[ -d "$ROOT" ] || ROOT="" 2.22 + 2.23 +if [ $(id -u) -ne 0 ]; then 2.24 + echo -e "\nYou must be root to run `basename $0`." 2.25 + echo -e "Please type 'su' and root password to become super-user.\n" 2.26 + exit 0 2.27 +fi 2.28 + 2.29 +if [ -d $ROOT$INSTALLED/$PKGNAME ]; then 2.30 + [ -n "$ROOT" ] && exit 1 2.31 + tazpkg remove $PKGNAME 2.32 + [ -d $INSTALLED/$PKGNAME ] && exit 1 2.33 +fi 2.34 + 2.35 +# Source Download 2.36 +TARBALL="master.zip" 2.37 +URL="${WEB_SITE}/archive/$TARBALL" 2.38 +TMP_DIR="$(mktemp -d)" 2.39 +CUR_DIR=$(pwd) 2.40 +cd $TMP_DIR 2.41 +busybox wget -O $TARBALL $URL 2.42 + 2.43 +if [ ! -f $TARBALL ]; then 2.44 + echo "Could not download $TARBALL. Exiting." 2.45 + exit 1 2.46 +fi 2.47 + 2.48 +# Unzip Package 2.49 +unzip $TARBALL 2.50 + 2.51 +# Building Base 2.52 +mkdir -p $PKGNAME-$VERSION/fs/usr/share/images 2.53 +mv $PKGNAME-master/* $PKGNAME-$VERSION/fs/usr/share/images 2.54 +rm -irf $PKGNAME-$VERSION/fs/usr/share/images/README.md 2.55 +rm -irf $PKGNAME-master 2.56 +rm -irf $TARBALL 2.57 + 2.58 + 2.59 +# Writing The Receipt 2.60 +cat > $PKGNAME-$VERSION/receipt <<EOT 2.61 +PACKAGE="$PKGNAME" 2.62 +VERSION="$VERSION" 2.63 +CATEGORY="x-window" 2.64 +SHORT_DESC="$SHORT_DESC" 2.65 +WEB_SITE="$WEB_SITE" 2.66 +MAINTAINER="$MAINTAINER" 2.67 +TAGS="$TAGS" 2.68 +DEPENDS="$DEPENDS" 2.69 + 2.70 +EOT 2.71 + 2.72 +# Creating The Tazpkg Package 2.73 +tazpkg pack $PKGNAME-$VERSION 2.74 + 2.75 +# Install Package 2.76 +tazpkg -i $PKGNAME-$VERSION.tazpkg --root=$ROOT 2.77 +case " $@ " in 2.78 +*\ --k*) mv $PKGNAME-$VERSION.tazpkg $CUR_DIR ;; 2.79 +esac 2.80 + 2.81 +# Clean 2.82 +cd $CUR_DIR 2.83 +rm -rf "$TMP_DIR"