Commit e451bfc1 authored by Phil's avatar Phil

add splashy

parent e4c750e4
#
# Platform Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=splashy
pkgver=0.3.13
pkgrel=1
pkgdesc="A next-generation user-space boot splashing system for Linux systems without depending on initscripts-splashy"
arch=('i686' 'x86_64')
url="http://splashy.alioth.debian.org/"
license=('GPL')
makedepends=('pkg-config')
depends=('file' 'glib2' 'directfb' 'initscripts')
options=('!libtool' '!distcc' '!makeflags')
install=splashy.install
source=(https://alioth.debian.org/frs/download.php/2691/splashy-0.3.13.tar.gz
splashy.initcpio_install
splashy.initcpio_hook
splashy.install
splashy-functions
splash-initscripts
splash.conf
splashy_video.c.patch)
md5sums=('03b7ee4f31c56ee61463772f74bad8a0'
'd2b7123d410e8bb62964f514a889c401'
'f2d1b7ca4560a2888b08c5580dc8afae'
'0a9c7e9a3c0dd0f6fa7443d55eb71b3e'
'91972fc154635806923befe3a70a1299'
'efb94b087c588540c8c50b1c5a00f706'
'fe6da7a9242aca91779e165979bb7e3d'
'2c827c217d6f30d5e7e982fa40c5564e')
build() {
cd splashy-${pkgver}
patch -Np1 -i ${srcdir}/splashy_video.c.patch
./configure --prefix=/usr --libdir=/usr/lib --sysconfdir=/etc --sbindir=/sbin --datarootdir=/usr/share --mandir=/usr/share/man --includedir=/usr/include
make
}
package() {
cd splashy-${pkgver}
make DESTDIR=${pkgdir} install
# Remove unnecessary files
rm -rf ${pkgdir}/etc/{console-tools,default,init.d,lsb-base-logging.sh}
rm -rf ${pkgdir}/usr/share/initramfs-tools
install -D -m644 ${srcdir}/splashy.initcpio_install ${pkgdir}/lib/initcpio/install/splashy
install -D -m644 ${srcdir}/splashy.initcpio_hook ${pkgdir}/lib/initcpio/hooks/splashy
install -D -m644 ${srcdir}/splashy-functions ${pkgdir}/etc/rc.d/splashy-functions
install -D -m644 ${srcdir}/splash-initscripts ${pkgdir}/etc/rc.d/functions.d/splash
install -D -m644 ${srcdir}/splash.conf ${pkgdir}/etc/splash.conf
sed -e 's|>/etc/splashy/themes<|>/usr/share/splashy/themes<|' -i ${pkgdir}/etc/splashy/config.xml
}
\ No newline at end of file
#
# initscripts-splash functions
#
. /etc/splash.conf
if [ "$SPLASH_DEBUG" = "true" ]; then
if ! [ -d /var/log/splash ]; then
mkdir -p /var/log/splash
fi
if ! [ -f /var/log/splash/splash.log ]; then
mount -ns -t tmpfs -o size=1M tmpfs /var/log/splash
echo "Hello damned debugger" > /var/log/splash/splash.log
fi
fi
debug_log() {
[ "$SPLASH_DEBUG" = "true" ] || return 1
echo "$1" >> /var/log/splash/splash.log
}
splash_enabled_cmdline() { debug_log "$0 ${FUNCNAME}"
local ENABLE=false
local SINGLE=false
for x in $CMDLINE; do
case $x in
single)
SINGLE=true
;;
splash)
ENABLE=true
;;
nosplash)
ENABLE=false
;;
esac
done
[ "${SINGLE}" = "false" ] || return 1
[ "${ENABLE}" = "true" ] || return 1
return 0
}
splash_enabled_config() { debug_log "$0 ${FUNCNAME}"
if [[ -n ${SPLASH} && -f /etc/rc.d/${SPLASH}-functions ]]; then
return 0
else
if [[ -f /etc/rc.d/splashy-functions ]]; then
SPLASH="splashy"
return 0
else
return 1
fi
fi
}
if [ -z "$RUNLEVEL" ]; then
return 0
fi
if ! splash_enabled_cmdline; then
return 0
fi
if ! splash_enabled_config; then
return 0
fi
count_daemons() {
local COUNT=0
for daemon in "${DAEMONS[@]}"; do
if [ "$daemon" = "${daemon#!}" ]; then
((COUNT++))
fi
done
echo ${COUNT}
}
count_stats() {
local COUNT=$(grep -e status -e stat_busy /etc/${1} | grep -c -v \#)
if ! [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then
((COUNT--))
fi
if ! [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)" ]; then
((COUNT--))
fi
echo ${COUNT}
}
set_sysinit() { debug_log "$0 ${FUNCNAME}"
SPLASH_PROGRESS_STATS=$(count_stats rc.sysinit)
SPLASH_PROGRESS_DAEMONS=$(count_daemons)
SPLASH_PROGRESS_TOTAL=$(($SPLASH_PROGRESS_STATS+$SPLASH_PROGRESS_DAEMONS))
SPLASH_PROGRESS_COUNT=0
SPLASH_AUTORUN_COMMAND="splash_sysinit"
debug_log "SPLASH_PROGRESS_TOTAL=$SPLASH_PROGRESS_TOTAL SPLASH_AUTORUN_COMMAND=$SPLASH_AUTORUN_COMMAND"
}
set_multi() { debug_log "$0 ${FUNCNAME}"
SPLASH_PROGRESS_STATS=$(count_stats rc.sysinit)
SPLASH_PROGRESS_DAEMONS=$(count_daemons)
SPLASH_PROGRESS_TOTAL=$(($SPLASH_PROGRESS_STATS+$SPLASH_PROGRESS_DAEMONS))
SPLASH_PROGRESS_COUNT=$(($SPLASH_PROGRESS_STATS-1))
SPLASH_AUTORUN_COMMAND="splash_multi"
debug_log "SPLASH_PROGRESS_TOTAL=$SPLASH_PROGRESS_TOTAL SPLASH_AUTORUN_COMMAND=$SPLASH_AUTORUN_COMMAND"
}
set_shutdown() { debug_log "$0 ${FUNCNAME}"
SPLASH_PROGRESS_STATS=$(count_stats rc.shutdown)
SPLASH_RUNNING_DAEMONS=(`/bin/ls /var/run/daemons`)
SPLASH_PROGRESS_DAEMONS=${#SPLASH_RUNNING_DAEMONS[*]}
SPLASH_PROGRESS_TOTAL=$(($SPLASH_PROGRESS_STATS+$SPLASH_PROGRESS_DAEMONS))
SPLASH_PROGRESS_COUNT=0
SPLASH_AUTORUN_COMMAND="splash_shutdown"
debug_log "SPLASH_PROGRESS_TOTAL=$SPLASH_PROGRESS_TOTAL SPLASH_AUTORUN_COMMAND=$SPLASH_AUTORUN_COMMAND"
}
if [ -z "${SPLASH_INIT_DONE}" ]; then
export SPLASH_INIT_DONE="true"
debug_log "$0 Running initscript..."
case "$RUNLEVEL" in
S)
set_sysinit
SPLASH_STATUS_MESSAGE="Booting Chakra GNU/Linux..."
;;
3)
set_multi
SPLASH_STATUS_MESSAGE="Loading daemons..."
;;
5)
set_multi
SPLASH_STATUS_MESSAGE="Loading daemons..."
;;
6)
set_shutdown
SPLASH_STATUS_MESSAGE="Rebooting Chakra GNU/Linux..."
;;
0)
set_shutdown
SPLASH_STATUS_MESSAGE="Shutting down Chakra GNU/Linux..."
;;
esac
fi
. /etc/rc.d/${SPLASH}-functions
# splash functions:
splash_progress() { debug_log "$0 ${FUNCNAME}"
if [ -n "$SPLASH_PROGRESS_COUNT" ]; then
${SPLASH}_progress $SPLASH_PROGRESS_COUNT $SPLASH_PROGRESS_TOTAL
((SPLASH_PROGRESS_COUNT++))
fi
}
splash_print() { debug_log "$0 ${FUNCNAME}"
${SPLASH}_print "${1}"
debug_log "$1"
}
splash_exit() { debug_log "$0 ${FUNCNAME}"
${SPLASH}_exit ${DEFAULT_TTY} ${SWITCH_TTY}
}
splash_sysinit() { debug_log "$0 ${FUNCNAME}"
${SPLASH}_sysinit ${DEFAULT_TTY}
}
splash_multi() { debug_log "$0 ${FUNCNAME}"
${SPLASH}_multi
trap splash_exit 0
splash_progress
}
splash_shutdown() { debug_log "$0 ${FUNCNAME}"
${SPLASH}_shutdown ${DEFAULT_TTY}
if [ -n "`pidof $SPLASH`" ]; then
export KILLALL5_OPTS="-o `pidof $SPLASH`"
fi
}
if [ -n "${SPLASH_AUTORUN_COMMAND}" ]; then
$SPLASH_AUTORUN_COMMAND
splash_print "${SPLASH_STATUS_MESSAGE}"
sleep 0.5
fi
# functions:
deltext() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
printf "${DEL_TEXT}"
else
return 0
fi
}
printhl() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
printf "${C_OTHER}${PREFIX_HL} ${C_H1}${1}${C_CLEAR} \n"
else
return 0
fi
}
printsep() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
printf "\n${C_SEPARATOR} ------------------------------\n"
else
return 0
fi
}
stat_bkgd() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} "
deltext
printf " ${C_OTHER}[${C_BKGD}BKGD${C_OTHER}]${C_CLEAR} "
fi
}
stat_busy() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} "
printf "${SAVE_POSITION}"
deltext
printf " ${C_OTHER}[${C_BUSY}BUSY${C_OTHER}]${C_CLEAR} "
fi
splash_print "${1}"
}
stat_append() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
printf "${RESTORE_POSITION}"
printf "${C_MAIN}${1}${C_CLEAR}"
printf "${SAVE_POSITION}"
else
return 0
fi
}
stat_done() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
deltext
printf " ${C_OTHER}[${C_DONE}DONE${C_OTHER}]${C_CLEAR} \n"
fi
splash_progress
}
stat_fail() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
printf " ${C_OTHER}[${C_FAIL}FAIL${C_OTHER}]${C_CLEAR} \n"
fi
splash_print "Something failed, killing splash..."
sleep 2
splash_exit
}
#daemons:
log_daemon() { debug_log "$0 ${FUNCNAME}"
case $1 in
?dm|slim)
splash_exit
;;
esac
}
start_daemon() { debug_log "$0 ${FUNCNAME}"
log_daemon $1
splash_progress
/etc/rc.d/$1 start
}
start_daemon_bkgd() { debug_log "$0 ${FUNCNAME}"
if [ "$CONSOLE_PRINT" == "true" ]; then
stat_bkgd "Starting $1"
fi
log_daemon $1
(/etc/rc.d/$1 start) &>/dev/null &
splash_progress
}
stop_daemon() { debug_log "$0 ${FUNCNAME}"
/etc/rc.d/$1 stop
for daemon in ${SPLASH_RUNNING_DAEMONS[@]}; do
if [ "$daemon" = "$1" ]; then
splash_progress
break
fi
done
}
# End of file
# vim: set ts=2 noet:
DEFAULT_TTY=8
SWITCH_TTY=1
CONSOLE_PRINT=true
SPLASH_DEBUG=false
#
# splashy functions
#
# functions:
splashy_wait_till_ready() { debug_log "$0 ${FUNCNAME}"
local tries=50
/sbin/splashy_update "print" 2> /dev/null
while [ $? -ne 0 ]; do
[ $tries -ne 0 ] || return 1
((tries--))
sleep 0.1
/sbin/splashy_update "print" 2> /dev/null
done
debug_log "tries=$((50-$tries))"
}
splashy_print() { debug_log "$0 ${FUNCNAME}"
/sbin/splashy_update "print ${1}" 2> /dev/null
}
splashy_sysinit() { debug_log "$0 ${FUNCNAME}"
splashy_wait_till_ready
}
splashy_multi() { debug_log "$0 ${FUNCNAME}"
return 0
}
splashy_shutdown() { debug_log "$0 ${FUNCNAME}"
clear > /dev/tty${1}
/sbin/splashy_chvt ${1}
splashy shutdown 2> /dev/null
splashy_wait_till_ready
}
splashy_kill() { debug_log "$0 ${FUNCNAME}"
local tries=50
while pidof splashy > /dev/null; do
[ $tries -ne 0 ] || return 1
((tries--))
kill -15 `pidof splashy`
sleep 0.2
pidof splashy > /dev/null || break
kill -9 `pidof splashy`
sleep 0.2
done
debug_log "tries=$((50-$tries))"
}
splashy_exit() { debug_log "$0 ${FUNCNAME}"
pidof splashy > /dev/null || return 1
/usr/bin/setterm -cursor off > /dev/tty8
/sbin/splashy_update "progress 100" 2> /dev/null
sleep 0.3
/sbin/splashy_update "exit" 2> /dev/null
sleep 0.3
splashy_kill
if [ "$(fgconsole 2>/dev/null)" = "${1}" ]; then
clear > /dev/tty${1} || true
fi
/usr/bin/setterm -cursor off > /dev/tty7
if [ -n "${2}" ]; then
if [ "$(fgconsole 2>/dev/null)" != "${2}" ]; then
/sbin/splashy_chvt ${2} || true
else
# fall back to tty1
/sbin/splashy_chvt 1 || true
fi
fi
}
splashy_progress() { debug_log "$0 ${FUNCNAME}"
PROGRESS=$(((${1}*100)/${2}))
/sbin/splashy_update "progress ${PROGRESS}" 2> /dev/null
}
# End of file
# vim: set ts=2 noet:
# vim: set ft=sh:
run_hook() {
[ -x /sbin/splashy ] || return
SPLASH=false
SINGLE=false
for x in $(cat /proc/cmdline); do
case $x in
single)
SINGLE=true
;;
splash)
SPLASH=true
;;
nosplash)
SPLASH=false
;;
esac
done
[ "${SINGLE}" = "false" ] || return
[ "${SPLASH}" = "true" ] || return
#if [ -s /proc/fb ]; then
# while read fbno desc; do
# mknod /dev/fb${fbno} c 29 ${fbno}
# done < /proc/fb
#else
# mknod /dev/fb0 c 29 0
#fi
#for i in 0 1 2 3 4 5 6 7 8; do
# test -c /dev/tty${i} || \
# mknod /dev/tty${i} c 4 ${i}
#done
msg -n ":: Loading Splashy..."
if [ -x /sbin/splashy_chvt ]; then
/sbin/splashy_chvt 8
fi
/sbin/splashy boot
sleep 1 #we need a better solution
msg "done."
}
# vim: set ft=sh:
install() {
[ -x /sbin/splashy ] || return 1
THEMES_DIR="$(splashy_config --get-key /splashy/themes 2> /dev/null)"
CURRENT_THEME="$(splashy_config --get-key /splashy/current_theme 2> /dev/null)"
add_binary "/sbin/splashy"
add_file "/sbin/splashy_chvt"
add_file "/etc/splashy/config.xml"
add_full_dir "${THEMES_DIR}/${CURRENT_THEME}"
#shared libraries needed by splashy
add_file "/usr/lib/libsplashycnf.so.1"
add_file "/usr/lib/libsplashy.so.1"
add_file "/usr/lib/libglib-2.0.so.0"
add_file "/usr/lib/libdirectfb-1.4.so.5"
add_file "/usr/lib/libfusion-1.4.so.5"
add_file "/usr/lib/libdirect-1.4.so.5"
add_file "/usr/lib/libpng14.so.14"
add_file "/usr/lib/libjpeg.so"
add_file "/usr/lib/libfreetype.so.6"
add_file "/lib/libm.so.6"
add_file "/lib/libpthread.so.0"
add_file "/usr/lib/libz.so.1"
add_file "/lib/libdl.so.2"
add_file "/lib/libc.so.6"
add_file "/lib/libpcre.so.0"
add_file "/lib/libsysfs.so.2"
add_file "/usr/lib/directfb-1.4-5/wm/libdirectfbwm_default.so"
add_file "/usr/lib/directfb-1.4-5/systems/libdirectfb_fbdev.so"
add_file "/usr/lib/directfb-1.4-5/inputdrivers/libdirectfb_keyboard.so"
add_file "/usr/lib/directfb-1.4-5/interfaces/IDirectFBFont/libidirectfbfont_ft2.so"
# add_file "/usr/lib/directfb-1.4-5/interfaces/IDirectFBFont/libidirectfbfont_default.so"
add_file "/usr/lib/directfb-1.4-5/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.so"
add_file "/usr/lib/directfb-1.4-5/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_jpeg.so"
if [ $(arch) = "x86_64" ]; then
add_file "/lib/ld-linux-x86-64.so.2"
else
add_file "/lib/ld-linux.so.2"
fi
SCRIPT="splashy"
}
help() {
echo "This hook includes Splashy in the initramfs image."
}
#EOF
pkgname=splashy
post_install() {
cat << _EOF
==> You'll probably want to see the page on the wiki
==> to do final configuration and install of splashy:
==> http://chakra-project.org/wiki/index.php/How_to_configure_Splashy
_EOF
}
post_upgrade() {
post_install $1
}
--- splashy-0.3.13/src/splashy_video.c 2008-12-24 17:14:55.000000000 +0100
+++ splashy-0.3.13-new/src/splashy_video.c 2010-09-02 20:11:13.000000000 +0200
@@ -884,7 +884,8 @@
video.fontdesc.flags = DFDESC_HEIGHT;
- fontface = g_build_filename (splashy_get_config_string (SPL_THEMES_DIR), splashy_get_config_string ("/splashy/textbox/text/font/file"), NULL);
+ /*fontface = g_build_filename (splashy_get_config_string (SPL_THEMES_DIR), splashy_get_config_string ("/splashy/textbox/text/font/file"), NULL);*/
+ fontface = g_build_filename (splashy_get_theme_dir(), splashy_get_config_string ("/splashy/textbox/text/font/file"), NULL);
temp = splashy_get_config_int ("/splashy/textbox/text/font/height",
10);
#
# Platform Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname="uswsusp-splashy"
pkgver=20110221
pkgrel=1
pkgdesc="Allows suspending with new userspace suspend and Splashy."
arch=('i686' 'x86_64')
url="http://suspend.sourceforge.net"
license=('GPL')
depends=('lzo2' 'libx86' 'libgcrypt' 'splashy')
makedepends=('libgcrypt' 'gcc' 'make' 'git')
conflicts=('suspend' 'uswsusp')
provides=('uswsusp')
options=('docs' 'zipman')
backup=('etc/suspend.conf')
install=uswsusp.install
source=(http://chakra-project.org/sources/${pkgname}/${pkgname}-${pkgver}-${pkgrel}.tar.xz
uresume-hook
uresume-install
s2ram-chvt63.patch)
md5sums=('99d15a0e80e44f2a0b755d888ca36d19'
'a2dfd5ad0d1875a572fdfc134dcd049f'
'e6939703649eba3536f836f99f49b7fd'
'320f94e40e1a931f4a17cba0aec69e30')
# create tarball: source PKGBUILD && mksource
mksource() {
rm -vRf tribe
git clone git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git ${pkgname}
rm -vRf ${pkgname}/.git
pushd ${pkgname}
popd
tar -cvJf ${pkgname}-${pkgver}-${pkgrel}.tar.xz ${pkgname}/*
md5sum ${pkgname}-${pkgver}-${pkgrel}.tar.xz
}
build() {
cd ${srcdir}/${pkgname}