code:
Index: pm-utils-1.4.1/configure.ac
===================================================================
--- pm-utils-1.4.1.orig/configure.ac
+++ pm-utils-1.4.1/configure.ac
@@ -41,7 +41,6 @@ man/Makefile
 src/Makefile
 pm/Makefile
 pm/sleep.d/Makefile
-pm/power.d/Makefile
 pm/module.d/Makefile
 ])

Index: pm-utils-1.4.1/man/Makefile.am
===================================================================
--- pm-utils-1.4.1.orig/man/Makefile.am
+++ pm-utils-1.4.1/man/Makefile.am
@@ -2,7 +2,6 @@ pm_mans =			\
 	on_ac_power.1		\
 	pm-is-supported.1	\
 	pm-pmu.8		\
-	pm-powersave.8		\
 	pm-action.8

 if HAVE_XMLTO
@@ -13,7 +12,6 @@ EXTRA_DIST =			\
 	on_ac_power.xml		\
 	pm-pmu.xml		\
 	pm-is-supported.xml	\
-	pm-powersave.xml	\
 	pm-action.xml		\
 	$(pm_mans)

Index: pm-utils-1.4.1/pm/sleep.d/Makefile.am
===================================================================
--- pm-utils-1.4.1.orig/pm/sleep.d/Makefile.am
+++ pm-utils-1.4.1/pm/sleep.d/Makefile.am
@@ -2,8 +2,7 @@ sleepdir = $(libdir)/pm-utils/sleep.d

 sleep_SCRIPTS =			\
 	00logging		\
-	00powersave		\
-	01grub			\
+	01grub 			\
 	49bluetooth		\
 	55NetworkManager	\
 	75modules		\
Index: pm-utils-1.4.1/pm/Makefile.am
===================================================================
--- pm-utils-1.4.1.orig/pm/Makefile.am
+++ pm-utils-1.4.1/pm/Makefile.am
@@ -1,6 +1,5 @@
 SUBDIRS =		\
 	sleep.d 	\
-	power.d		\
 	module.d

 pm_libdir = $(libdir)/pm-utils
Index: pm-utils-1.4.1/pm/HOWTO.hooks
===================================================================
--- pm-utils-1.4.1.orig/pm/HOWTO.hooks
+++ pm-utils-1.4.1/pm/HOWTO.hooks
@@ -24,12 +24,6 @@ The actual sleep method being used will
 if your hook needs to handle suspend-hybrid (or any other platform-specific
 sleep method), it should examine the second parameter.

-For hooks in power.d, the potential values of that parameter are:
-true -- the hook MUST perform whatever action is appropriate when the system
-	transitions TO battery power.
-false -- The hook MUST perform whatever action is appropriate when the system
-	transitions FROM battery power.
-
 NAMING SCHEME

 All hooks are run in lexical sort order according to the C locale.
@@ -44,8 +38,7 @@ Any other return code is interpreted by
 from the hook that it should abort whatever it is doing. When running sleep.d
 hooks, that means that pm-utils stops running hooks, aborts the suspend/resume
 process, calls any hooks that ran successfully prior to this one with the
-appropriate wakeup options, and exits with a non-zero exit code. When running
-power.d hooks, any hooks after this one will be skipped.
+appropriate wakeup options, and exits with a non-zero exit code.

 SLEEP.D SPECIFIC NOTES

Index: pm-utils-1.4.1/src/Makefile.am
===================================================================
--- pm-utils-1.4.1.orig/src/Makefile.am
+++ pm-utils-1.4.1/src/Makefile.am
@@ -16,9 +16,7 @@ bin_SCRIPTS = pm-is-supported

 dist_bin_SCRIPTS = on_ac_power

-sbin_SCRIPTS = pm-powersave
-
-script_in_files = pm-action.in pm-is-supported.in pm-powersave.in service
+script_in_files = pm-action.in pm-is-supported.in service

 CLEANFILES =  $(script_in_files:.in=)


code:
# Config file for hd-apm-restore hook

# Devices, where the hd apm value should be restored, separated by space
#HD_APM_DEVICES="sda"

# Use this to overwrite a value for a device in case hdparm reports
# "unknown value" for the apm level. This is ignored when hdparm
# returns an other value.
#savestate sda 192
#savestate sdb 192
#savestate sdc 192
#savestate sdd 192

repo_name: ayhanyalcinsoy/main


code:
# This file configures the ability to wake from suspend or hibernate
# at a given time.  It is used in conjunction with the 02rtcwake hook.

# Whether to respect the user-passed-in num_seconds_to_sleep
# If off, then the system configuration (below) will be used even if
# the user passes in a num_seconds_to_sleep.
#USER_RTCWAKE_ALLOWED="no"
USER_RTCWAKE_ALLOWED="yes"

# Should we wake up from suspend on a given time?
# if those are set to "no", the configuration values below have no effect.
#SUSPEND_RTCWAKE_ENABLED="yes"
#HIBERNATE_RTCWAKE_ENABLED="yes"
SUSPEND_RTCWAKE_ENABLED="no"
HIBERNATE_RTCWAKE_ENABLED="no"

# Time to wake up in local, 24-hour time
#RTCWAKE_TIME="22:30"
#RTCWAKE_TIME="9:00"

# Days to wake up (1=monday, 7=sunday), in increasing order,
# with a single space between each day
#RTCWAKE_DAYS="1 2 3 4 5"
#RTCWAKE_DAYS="1 3 5"
#RTCWAKE_DAYS="1 2 3 4 5 6 7"


code:
#!/bin/bash
#
# Stefan Seyfried, SUSE Linux Products GmbH 2006, GPL v2
# mostly taken from the powersave project.

GRUBONCE="/usr/sbin/grubonce"
GRUBDEFAULT="/boot/grub/default"
GRUBDEFSAVE="/run/suspend.grubonce.default"

#####################################################################
# gets a list of available kernels from /boot/grub/menu.lst
# kernels are in the array $KERNELS, output to stdout to be eval-ed.
getkernels()
{
	# DEBUG "Running getkernels()" INFO
	local MENU_LST="/boot/grub/menu.lst"
	local I DUMMY MNT ROOTDEV
	declare -i I=0 J=-1

	# we need the root partition later to decide if this is the kernel to select
	while read ROOTDEV MNT DUMMY; do
		[ "$ROOTDEV" = "rootfs" ] && continue # not what we are searching for
		if [ "$MNT" = "/" ]; then
			break
		fi
	done < /proc/mounts

	# build an array KERNELS with all the kernels in /boot/grub/menu.lst
	# the array MENU_ENTRIES contains the corresponding menu entry numbers
	# DEFAULT_BOOT contains the default entry.
	while read LINE; do
		case $LINE in
		title*)
			let J++ # increase for every menu entry, even for non-linux
			# DEBUG "Found grub menu entry #${J}: '${LINE}'" INFO
			;;
		default*)
			DUMMY=($LINE)                   # "default 0 #maybe a comment"
			echo "DEFAULT_BOOT=${DUMMY[1]}" #  ^^[0]^^ 1 ^^[2]^ 3 ^^[4]^^
			# DEBUG "Default boot entry is '${DUMMY[1]}'" INFO
			;;
		kernel*noresume*)
			# we probably found the "failsafe" kernel that won't resume...
			echo "  Skipping grub entry #${J}, because it has the noresume option" >&2
			;;
		kernel*root=*)
			local ROOT
			ROOT=${LINE#*root=}
			DUMMY=($ROOT)
			ROOT=${DUMMY[0]}
			if [ "$(echo $ROOT | grep LABEL)" ]; then
				LABEL=`echo $ROOT | cut -d"=" -f2`
				ROOT=`readlink -f /dev/disk/by-label/$LABEL`
			elif [ "$(echo $ROOT | grep UUID)" ]; then
				UUID=`echo $ROOT | cut -d"=" -f2`
				ROOT=`readlink -f /dev/disk/by-uuid/$UUID`
			fi
			if [ "$(stat -Lc '%t:%T' $ROOT)" != "$(stat -Lc '%t:%T' $ROOTDEV)" ]; then
				echo "  Skipping grub entry #${J}, because its root= parameter ($ROOT)" >&2
				echo "    does not match the current root device ($ROOTDEV)." >&2
				continue
			fi
			DUMMY=($LINE) # kernel (hd0,1)/boot/latestkernel-ABC root=/dev/hda2
			echo "KERNELS[$I]='${DUMMY[1]##*/}'" # latestkernel-ABC
			echo "MENU_ENTRIES[$I]=$J"
			# DEBUG "Found kernel entry #${I}: '${DUMMY[1]##*/}'" INFO
			let I++
			;;
		kernel*)
			# a kernel without "root="? We better skip that one...
			echo "  Skipping grub entry #${J}, because it has no root= option" >&2
			;;
		*)  ;;
		esac
	done < $MENU_LST
}

#############################################################
# runs grubonce from the grub package to select which kernel
# to boot on next startup
grub-once()
{
	if [ -x "$GRUBONCE" ]; then
		rm -f "$GRUBDEFSAVE"
		if [ -e "$GRUBDEFAULT" ]; then
			echo "  saving original $GRUBDEFAULT"
			cp "$GRUBDEFAULT" "$GRUBDEFSAVE"
		fi
		echo "  running '$GRUBONCE $1'"
		$GRUBONCE $1
	else
		echo "WARNING: $GRUBONCE not found, not preparing bootloader"
	fi
}

#############################################################
# restore grub default after (eventually failed) resume
grub-once-restore()
{
	echo "INFO: running grub-once-restore"
	rm -f "$GRUBDEFAULT"
	if [ -e "$GRUBDEFSAVE" ]; then
		echo "  restoring original $GRUBDEFAULT"
		mv "$GRUBDEFSAVE" "$GRUBDEFAULT"
	fi
}

#############################################################################
# try to find a kernel image that matches the actually running kernel.
# We need this, if more than one kernel is installed. This works reasonably
# well with grub, if all kernels are named "kernel-`uname -r`" and are
# located in /boot. If they are not, good luck ;-)
find-kernel-entry()
{
	NEXT_BOOT=-1
	ARCH=`uname -m`
	declare -i I=0
	# DEBUG "running kernel: $RUNNING" DIAG
	while [ -n "${KERNELS[$I]}" ]; do
		BOOTING="${KERNELS[$I]}"
		if IMAGE=`readlink /boot/$BOOTING` && [ -e "/boot/${IMAGE##*/}" ]; then
			# DEBUG "Found kernel symlink $BOOTING => $IMAGE" INFO
			BOOTING=$IMAGE
		fi
		case $ARCH in
			ppc*)   BOOTING="${BOOTING#*vmlinux-}" ;;
			*)      BOOTING="${BOOTING#*kernel-}" ;;
		esac
		if [ "$RUNNING" == "$BOOTING" ]; then
			NEXT_BOOT=${MENU_ENTRIES[$I]}
			echo "  running kernel is grub menu entry $NEXT_BOOT (${KERNELS[$I]})"
			break
		fi
		let I++
	done
	# if we have not found a kernel, issue a warning.
	# if we have found a kernel, we'll do "grub-once" later, after
	# prepare_suspend finished.
	if [ $NEXT_BOOT -eq -1 ]; then
		echo "WARNING: no kernelfile matching the running kernel found"
	fi
}

#############################################################################
# if we did not find a kernel (or BOOT_LOADER is not GRUB) check,
# if the running kernel is still the one that will (probably) be booted for
# resume (default entry in menu.lst or, if there is none, the kernel file
# /boot/latestkernel points to.)
# This will only work, if you use "original" SUSE kernels.
# you can always override with the config variable set to "yes"
prepare-grub()
{
	echo "INFO: running prepare-grub"
	eval `getkernels`
	RUNNING=`uname -r`
	find-kernel-entry

	RET=0

	if [ $NEXT_BOOT -eq -1 ]; then
		# which kernel is booted with the default entry?
		BOOTING="${KERNELS[$DEFAULT_BOOT]}"
		# if there is no default entry (no menu.lst?) we fall back to
		# the default of /boot/latestkernel.
		[ -z "$BOOTING" ] && BOOTING="latestkernel"
		if IMAGE=`readlink /boot/$BOOTING` && [ -e "/boot/${IMAGE##*/}" ]; then
			BOOTING=$IMAGE
		fi
		BOOTING="${BOOTING#*kernel-}"
		echo  "running kernel: '$RUNNING', probably booting kernel: '$BOOTING'"
		if [ "$BOOTING" != "$RUNNING" ]; then
			echo "ERROR: kernel version mismatch, cannot suspend to disk"
			echo "running: $RUNNING booting: $BOOTING"  >> $INHIBIT
			RET=1
		fi
	else
		# set the bootloader to the running kernel
		echo "  preparing boot-loader: selecting entry $NEXT_BOOT, kernel /boot/$BOOTING"
		T1=`date +"%s%N"`
		sync; sync; sync # this is needed to speed up grub-once on reiserfs
		T2=`date +"%s%N"`
		echo "  grub-once: `grub-once $NEXT_BOOT`"
		T3=`date +"%s%N"`
		S=$(((T2-T1)/100000000)); S="$((S/10)).${S:0-1}"
		G=$(((T3-T2)/100000000)); G="$((G/10)).${G:0-1}"
		echo "    time needed for sync: $S seconds, time needed for grub: $G seconds."
	fi

	return $RET
}

###### main()

case $1 in
	hibernate)
		prepare-grub
		;;
	thaw)
		grub-once-restore
		;;
esac


code:
#!/bin/sh
#
# Written by Gabriel Burt <gburt@novell.com>
# Copyright 2008 Novell, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# Use rtcwake to wake the computer from sleep or hibernate
# as configured in /etc/pm/config.d/rtcwake.config

. "${PM_FUNCTIONS}"

rtcwake_cmd="/usr/sbin/rtcwake";

command_exists $rtcwake_cmd || exit $NA

rtcwake_config_file="/etc/pm/config.d/rtcwake.conf"

function start_of_day {
	echo `date -d "$1" "+%D"`
}

function since_epoch {
	echo `date -d "$1" "+%s"`
}

function day_of_week {
	echo `date -d "$1" "+%u"`
}

function isAlarmDow {
	is=0
	for dow in $RTCWAKE_DAYS; do
		if test "x$dow" = "x$1"; then
			is=1;
			break;
		fi
	done
	echo $is
}

function set_alarm
{
	# If USER_RTCWAKE_ALLOWED is yes and the user passed in a num_seconds_to_sleep variable, then
	# we will respect it (and ignore the system config)
	# Do require that the number of seconds is at least 30 though.
	if test "x$USER_RTCWAKE_ALLOWED" != "xno" && test "x$NUM_SECONDS_TO_SLEEP" != "x" && test $(($NUM_SECONDS_TO_SLEEP > 30)) == 1; then
		echo "Have NUM_SECONDS_TO_SLEEP: $NUM_SECONDS_TO_SLEEP";
		# Actually set/configure the rtcwake
		sh -c "$rtcwake_cmd -m on -s $NUM_SECONDS_TO_SLEEP &"
	elif test "x$1" = "xyes"; then
		echo "alarm enabled, configuring rtcwake...";
		echo "RTCWAKE time: $RTCWAKE_TIME";
		echo "RTCWAKE days: $RTCWAKE_DAYS";

		next_alarm=0
		now=$(since_epoch now);
		# The next alarm has to be at most 7 days from now
		for days_from_now in 0 1 2 3 4 5 6 7; do
			# Get the date N days from now
			alarm_day=$(start_of_day "$days_from_now day");

			# Check that this day is an alarm-enabled day of the week
			alarm_dow=$(day_of_week $alarm_day);
			is_alarm_dow=$(isAlarmDow $alarm_dow);
			if test "x$is_alarm_dow" = "x1"; then
				# Get the actual alarm time on that day
				alarm_time=$(since_epoch "$alarm_day $RTCWAKE_TIME");

				# Ensure the alarm time is more than 15 minutes from now
				#   - otherwise we set the alarm for the next slot
				# 900 seconds = 15 minutes * 60 seconds/minute
				is_enough_in_future=$(($alarm_time - $now > 900));
				if test "x$is_enough_in_future" = "x1"; then
					next_alarm=$alarm_time
					break;
				fi
			fi
		done

		if test "x$next_alarm" != "x0"; then
			# Recalculate now to be as accurate as possible
			now=$(since_epoch now);
			seconds_from_now=$(($next_alarm - $now));
			echo "Will set alarm for $seconds_from_now seconds from now, at $alarm_day $RTCWAKE_TIME ($next_alarm)"

			# Actually set/configure the rtcwake
			sh -c "$rtcwake_cmd -m on -s $seconds_from_now &"
		else
			echo "No acceptable time found to set the rtcwake alarm.  Review your configuration in $rtcwake_config_file"
			exit $NA
		fi
	else
		echo "rtcwake alarm not enabled in $rtcwake_config_file, doing nothing...";
		exit $NA
	fi
}

case "$1" in
	suspend) set_alarm $SUSPEND_RTCWAKE_ENABLED ;;
	hibernate) set_alarm $HIBERNATE_RTCWAKE_ENABLED ;;
	*) exit $NA ;;
esac


code:
#!/bin/bash
#
# Stefan Seyfried, SUSE Linux Products GmbH, 2006
# mostly taken from the powersave project

. "${PM_FUNCTIONS}"

# sanity check the environment if resume will be possible after hibernate
checkhibernate()
{
    echo "INFO: checking for suspend-to-disk prerequisites..."
    if [ -z "$IMAGE_SIZE" ]; then
        IMAGE_SIZE="`awk '/^MemTotal:/ { print int($2*1024*.45) }' /proc/meminfo`"
    fi
    # Default to partition style hibernation
    SWAP_TYPE=partition

    read CMDLINE < /proc/cmdline
    for CMD in $CMDLINE; do
        case $CMD in
            resume=*)
                RESUME=${CMD#*=}
                ;;
            resume_offset=*)
                # Swap type is file as resume_offset is given
                SWAP_TYPE=file
                ;;
        esac
    done

    if [ -z "$RESUME" ]; then
        # No resume= given in /proc/cmdline, failing.
        echo "ERROR: no resume parameter on kernel commandline, can not suspend"
        echo "no resume parameter on kernel commandline" >> $INHIBIT
        return 1
    fi
    if [ "$SWAP_TYPE" = file ] && [ "$SLEEP_MODULE" = "uswsusp" ]; then
        # File-style hibernating is not supported by uswsusp
        echo "ERROR: You must use the kernel hibernate method or tuxonice when suspending to swapfile, not uswsusp"
        echo "suspend to swapfile with uswsusp method not kernel" >> $INHIBIT
        return 1
    fi

    # the resume device can be a symlink, e.g. with LVM/EVMS or with
    # /dev/disk/by-id/foo
    RESUME=$(readlink -f $RESUME)

    OK=
    while read DEV TYPE SIZE USED PRI; do
        if [ "$TYPE" = "file" ] && [ "$SWAP_TYPE" = "file" ] && [ "$RESUME" = "$(df "$DEV" | tail -n +2 | cut -d ' ' -f 1)" ]; then
            OK=1
            break
        fi
        [ "$TYPE" != "partition" ] && continue
        [ "$DEV" != "$RESUME" ] && continue
        FREE=$[($SIZE-$USED)*1024]  # get free space on DEV
        if [ $FREE -lt $IMAGE_SIZE ]; then
            IMAGE_SIZE=$[$FREE-10*1024*1024]
        fi
        OK=1
        break   # we found the partition, no need to look further
    done < /proc/swaps

    if [ -z "$OK" ]; then
        if [ "$SWAP_TYPE" = "file" ]; then
            MSG_TYPE="swap file"
        else
            MSG_TYPE="resume partition"
        fi
        echo "ERROR: $MSG_TYPE '$RESUME' not active, can not suspend"
        echo "$MSG_TYPE '$RESUME' not active" >> $INHIBIT
        return 1
    fi

    if [ "$SLEEP_MODULE" = "kernel" ]; then
        echo "  using kernel suspend method"
        read DEV < /sys/power/resume
        if [ "$DEV" = "0:0" ]; then
            echo "ERROR: no resume partition set up in /sys/power/resume"
            # maybe "resume=..." was given, but initrd did not set up
            # /sys/power/resume correctly.
            echo "resume device not correctly setup in /sys/power/resume" >> \
                $INHIBIT
            return 1
        fi

        X=$(stat -Lc '$((0x%t)):$((0x%T))' $RESUME)
        RDEV=$(eval echo $X)
        if [ "$DEV" != "$RDEV" ]; then
            echo "ERROR: /sys/power/resume ($DEV) disagrees with resume= parameter ($RDEV)"
            echo "       can not suspend."
            echo "/sys/power/resume disagrees with resume= parameter" >> \
                $INHIBIT
            return 1
        fi
        if [ -n "$IMAGE_SIZE" -a -w /sys/power/image_size ]; then
            echo "  setting image size to $IMAGE_SIZE"
            echo "$IMAGE_SIZE" > /sys/power/image_size 2>/dev/null
        fi
    fi

    if [ "$SLEEP_MODULE" = "uswsusp" ]; then
        echo "  using userspace suspend method, temp. config file $S2DISK_CONF"
        if [ "$S2DISK_CONF" != "/etc/suspend.conf" ]; then
            rm -f $S2DISK_CONF
            # Generate S2DISK_CONF
            echo "  setting resume device to $RESUME"
            echo "resume device = $RESUME" >> $S2DISK_CONF
            if [ -n "$IMAGE_SIZE" ]; then
                echo "  setting image size to $IMAGE_SIZE"
                echo "image size = $IMAGE_SIZE" >> $S2DISK_CONF
            fi
            # add the parameters from /etc/suspend.conf to /var/lib/s2disk.conf
            if [ -e /etc/suspend.conf ]; then
                echo "# parameters taken from /etc/suspend.conf:" >> $S2DISK_CONF
                sed '/^[[:space:]]*\(#\|$\)/d;' /etc/suspend.conf >> $S2DISK_CONF
                echo "  adding these parameters from /etc/suspend.conf:"
                sed '/^[[:space:]]*\(#\|$\)/d;s/^/    /;' /etc/suspend.conf
            fi
        else
            # don't overwrite the user's config file, but warn about the issue
            echo "WARNING: S2DISK_CONF is set to /etc/suspend.conf"
            echo "    Disabling automatic generation of config file."
            echo "    This is most likely a configuration error and will cause problems"
            echo "    unless you configure /etc/suspend.conf completely on your own!"
        fi
    fi
    return 0
}

# this only makes sense on hibernate or on suspend-hybrid
case $1 in
    hibernate)
        ;;
    suspend)
        if [ "$2" != suspend_hybrid ]; then
            exit 0
        fi
        ;;
    *)
        exit $NA
        ;;
esac

[ -e /etc/pm/config.d/$1 ] && . /etc/pm/config.d/$1

if [ -z "$SLEEP_MODULE" ]; then
    # Decide the SLEEP_MODULE if not given
    if [ -x /usr/sbin/s2disk -a -c /dev/snapshot ]; then
        SLEEP_MODULE="uswsusp"
    else
        SLEEP_MODULE="kernel"
    fi
fi

if ! checkhibernate; then
    echo "WARNING: $INHIBIT will be created to prevent suspending!"
    touch $INHIBIT
    exit 1
fi

exit 0


code:
#!/bin/bash

. "${PM_FUNCTIONS}"

command_exists /sbin/pccardctl || exit $NA

case "$1" in
    hibernate|suspend)
        echo "ejecting PCMCIA cards..."
        /sbin/pccardctl eject
        ;;
    thaw|resume)
        echo "inserting PCMCIA cards..."
        /sbin/pccardctl insert
        ;;
    *) exit $NA
        ;;
esac

exit 0


code:
#!/bin/bash
# The ndiswrapper hook - relead the ndiswrapper module

. "${PM_FUNCTIONS}"

command_exists /usr/sbin/ndiswrapper || return $NA

case "$1" in
    resume|thaw)
        modprobe -r ndiswrapper
        modprobe ndiswrapper
        ;;
    *) exit $NA
        ;;
esac


code:
Index: pm-utils-1.4.1/pm/sleep.d/55NetworkManager
===================================================================
--- pm-utils-1.4.1.orig/pm/sleep.d/55NetworkManager	2010-09-20 11:12:23.750155840 +0200
+++ pm-utils-1.4.1/pm/sleep.d/55NetworkManager	2010-09-20 11:12:25.610155850 +0200
@@ -13,6 +13,7 @@
 	# Tell NetworkManager to shut down networking
         printf "Having NetworkManager put all interaces to sleep..."
 	dbus_send --system                         \
+                --print-reply --reply-timeout=200      \
 		--dest=org.freedesktop.NetworkManager  \
 		/org/freedesktop/NetworkManager        \
 		org.freedesktop.NetworkManager.sleep && \
@@ -25,6 +26,7 @@
 	printf "Having NetworkManager wake interfaces back up..."
         dbus_send --system                        \
 		--dest=org.freedesktop.NetworkManager \
+                --print-reply --reply-timeout=200      \
 		/org/freedesktop/NetworkManager       \
 		org.freedesktop.NetworkManager.wake && \
 	    echo Done. || echo Failed.


code:
---
 pm/defaults         |   20 +++++++++++++++-
 pm/module.d/uswsusp |   64 +++++++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 78 insertions(+), 6 deletions(-)

Index: pm-utils-1.3.0/pm/defaults
===================================================================
--- pm-utils-1.3.0.orig/pm/defaults	2009-06-14 03:56:08.000000000 +0200
+++ pm-utils-1.3.0/pm/defaults	2010-05-06 09:27:09.228673127 +0200
@@ -27,8 +27,26 @@
 #   tuxonice  If your system has support for tuxonice, use this.
 #
 # The system defaults to "kernel" if this is commented out.
-# SLEEP_MODULE="kernel"
+SLEEP_MODULE="uswsusp"

+#######################################################################
+# the variables below here are specific to the SUSE package right now
+# and are used only if SLEEP_MODULE is uswsusp
+
+# what options should be passed to s2ram?
+# see http://en.opensuse.org/S2ram for more information
+# If this option is set, it overrides S2RAM_QUIRKS_SOURCE below
+S2RAM_OPTS=""
+
+# where should pm-utils get the s2ram quirks from?
+# s2ram - use the whitelist in s2ram, if the machine is known.
+# hal   - ignored, exists only for comparibility purposes pm-utils 1.3.0+ has
+#         HAL quirks built-in
+# everything else: try to be smart in figuring out the correct quirks.
+# if S2RAM_OPTS is set, it overrides S2RAM_QUIRKS_SOURCE!
+S2RAM_QUIRKS_SOURCE=""
+
+#######################################################################
 # These variables will be handled specially when we load files in
 # /etc/pm/config.d.
 # Multiple declarations of these environment variables will result in
Index: pm-utils-1.3.0/pm/module.d/uswsusp
===================================================================
--- pm-utils-1.3.0.orig/pm/module.d/uswsusp	2009-12-11 05:36:38.000000000 +0100
+++ pm-utils-1.3.0/pm/module.d/uswsusp	2010-05-06 09:27:37.540671614 +0200
@@ -5,6 +5,7 @@
 uswsusp_hooks()
 {
 	disablehook 99video "disabled by uswsusp"
+	disablehook 90chvt "disabled by uswsusp"
 }

 # Since we disabled 99video, we need to take responsibility for proper
@@ -35,8 +36,52 @@
 	# if we were told to ignore quirks, do so.
 	# This is arguably not the best way to do things, but...
 	[ "$QUIRK_NONE" = "true" ] && OPTS=""
+        S2RAM_OPTS="$S2RAM_OPTS $OPTS"
+        echo "INFO: S2RAM_OPTS from HAL quirks: '$S2RAM_OPTS'."
 }

+# this function tries to assemble the best s2ram options from various sources, falling back
+# to other methods...
+get_s2ram_opts()
+{
+    # if S2RAM_OPTS is set - then use it. The user told us so. Obey his wish.
+    if [ -n "$S2RAM_OPTS" ]; then
+        echo "INFO: using user-supplied options: S2RAM_OPTS='$S2RAM_OPTS' for suspending."
+        return
+    fi
+
+    # ... try to use s2ram as a source
+    if [ "$S2RAM_QUIRKS_SOURCE" = "s2ram" ]; then
+        if  /usr/sbin/s2ram -n >/dev/null; then
+            echo "INFO: using s2ram built-in database, machine is supported."
+            return
+        else
+            echo "WARN: S2RAM_QUIRKS_SOURCE=s2ram, but machine is unknown, continuing..."
+        fi
+    fi
+
+    # ... if is not known or not set as a source, use the built-in database
+    echo "INFO: using built-in quirks database from HAL."
+    uswsusp_get_quirks
+    if [ -n "$S2RAM_OPTS" ]; then
+        S2RAM_OPTS="--force "$S2RAM_OPTS
+    fi
+
+    # ... in a case we still don't have any quirk, try s2ram for sure
+    if [ -z "$S2RAM_OPTS" ]; then
+        # ... machine could be in s2ram whitelist
+        if /usr/sbin/s2ram -n >/dev/null; then
+            echo "INFO: machine is in s2ram database, using it."
+            return;
+        else
+            # if we came here and S2RAM_OPTS is empty, suspend won't work :-(
+            echo "WARNING: smart uswsusp did not found any appropriate option, suspend probably don't work"
+        fi
+    fi
+
+}
+
+
 # Since we disabled 99video, we also need to handle displaying
 # help info for the quirks we handle.
 uswsusp_help()
@@ -70,8 +115,8 @@
 	SUSPEND_MODULE="uswsusp"
 	do_suspend()
 	{
-		uswsusp_get_quirks
-		s2ram --force $OPTS
+		get_s2ram_opts
+		s2ram $S2RAM_OPTS
 	}
 	if [ "$METHOD" = "suspend" ]; then
 		add_before_hooks uswsusp_hooks
@@ -87,7 +132,12 @@
 	HIBERNATE_MODULE="uswsusp"
 	do_hibernate()
 	{
-		s2disk
+		get_s2ram_opts
+		if [ -z "${S2DISK_CONF}" ]; then
+			s2disk
+		else
+			s2disk --config $S2DISK_CONF
+		fi
 	}
 fi

@@ -98,8 +148,12 @@
 	SUSPEND_HYBRID_MODULE="uswsusp"
 	do_suspend_hybrid()
 	{
-		uswsusp_get_quirks
-		s2both --force $OPTS
+		get_s2ram_opts
+		if [ -z "${S2DISK_CONF}" ]; then
+			s2both --force $S2RAM_OPTS
+		else
+			s2both --config $S2DISK_CONF $S2RAM_OPTS
+		fi
 	}
 	if [ "$METHOD" = "suspend_hybrid" ]; then
 		add_before_hooks uswsusp_hooks


code:
---
 pm/defaults |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Index: pm-utils-1.4.1/pm/defaults
===================================================================
--- pm-utils-1.4.1.orig/pm/defaults	2010-09-20 11:42:59.214155594 +0200
+++ pm-utils-1.4.1/pm/defaults	2010-09-20 13:35:52.974279436 +0200
@@ -30,7 +30,7 @@
 SLEEP_MODULE="uswsusp"

 #######################################################################
-# the variables below here are specific to the SUSE package right now
+# those variables below SUSE pm-utils specific right now
 # and are used only if SLEEP_MODULE is uswsusp

 # what options should be passed to s2ram?
@@ -46,6 +46,9 @@
 # if S2RAM_OPTS is set, it overrides S2RAM_QUIRKS_SOURCE!
 S2RAM_QUIRKS_SOURCE=""

+# the location of the autogenerated s2disk (s2both) config file
+S2DISK_CONF="/var/lib/s2disk.conf"
+
 #######################################################################
 # These variables will be handled specially when we load files in
 # /etc/pm/config.d.


code:
d /run/pm-utils/locks 0755 root root
d /run/pm-utils/storage 0755 root root


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>pm-utils</Name>
        <Homepage>http://pm-utils.freedesktop.org/wiki/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        <Summary>A toolset to suspend and hibernate computers</Summary>
        <Description>pm-utils provides simple shell command line tools to suspend and hibernate computers, and it that can be used to run vendor, distribution, or user supplied scripts on suspend and resume.</Description>
        <Archive sha1sum="9aacb9b4a5f11f751d94f5257c6c54460f106197" type="targz">http://pm-utils.freedesktop.org/releases/pm-utils-1.4.1.tar.gz</Archive>
        <Archive sha1sum="01aab63e2bb8c0f8d81d325ffce1fa49af0e2f3a" type="targz" target="video-quirks">http://pm-utils.freedesktop.org/releases/pm-quirks-20100619.tar.gz</Archive>
        <AdditionalFiles>
            <!--AdditionalFile target="pm/sleep.d/01grub">suse/hooks/sleep.d/01grub</AdditionalFile-->
        </AdditionalFiles>
        <BuildDependencies>
            <Dependency>xmlto</Dependency>
            <Dependency>libxslt</Dependency>
            <Dependency>util-linux</Dependency>
        </BuildDependencies>
        <Patches>
            <!-- Attempt to fix #15147 eventhough the fix is not fine-grained at all -->
            <Patch level="1">pisilinux/check-for-swap-partition.patch</Patch>

            <!-- Disable powersave stuff completely -->
            <Patch level="1">pisilinux/disable-powersave.patch</Patch>

            <!-- https://bugzilla.redhat.com/show_bug.cgi?id=552506#c4 -->
            <Patch level="1">suse/pm-utils-1.2.6.1-fix-broken-dbus-send.diff</Patch>
            <Patch level="1">suse/pm-utils-1.3.0-suse-smart-uswsusp.patch</Patch>
            <Patch level="1">suse/pm-utils-1.4.1-suse-config.patch</Patch>

            <!-- Gentoo patches -->
            <Patch level="1">gentoo/1.4.1-bluetooth-sync.patch</Patch>
            <Patch level="1">gentoo/1.4.1-disable-sata-alpm.patch</Patch>
            <Patch level="1">gentoo/1.4.1-fix-intel-audio-powersave-hook.patch</Patch>
            <Patch level="1">gentoo/1.4.1-logging-append.patch</Patch>
        </Patches>
    </Source>

    <Package>
        <Name>pm-utils</Name>
        <RuntimeDependencies>
            <Dependency>hdparm</Dependency>
            <Dependency>vbetool</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="config">/etc/pm</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="data">/run/pm-utils</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="library">/usr/lib/pkgconfig</Path>
            <Path fileType="data">/usr/lib/pm-utils/video-quirks</Path>
            <Path fileType="config">/usr/lib/tmpfiles.d/pm-utils.conf</Path>
        </Files>
        <AdditionalFiles>
            <AdditionalFile owner="root" permission="0644" target="/usr/lib/tmpfiles.d/pm-utils.conf">tmpfiles.conf</AdditionalFile>
            <!-- not implemented in our kernel yet
            <AdditionalFile owner="root" permission="0755" target="/usr/lib/pm-utils/sleep.d/000kernel-change">000kernel-change</AdditionalFile>
            FIXME: Should be enabled after enabling plymouth in suspend package and testing a lot
            <AdditionalFile owner="root" permission="0755" target="/usr/lib/pm-utils/sleep.d/00plymouthd">pisilinux/00plymouthd</AdditionalFile>
            <AdditionalFile owner="root" permission="0755" target="/usr/lib/pm-utils/sleep.d/75ndiswrapper">suse/hooks/sleep.d/75ndiswrapper</AdditionalFile>

            <AdditionalFile owner="root" permission="0755" target="/usr/lib/pm-utils/sleep.d/99hd-apm-restore">pisilinux/99hd-apm-restore</AdditionalFile>
            <AdditionalFile owner="root" permission="0644" target="/etc/pm/config.d/hd-apm-restore.conf">pisilinux/hd-apm-restore.conf</AdditionalFile>
            -->

            <AdditionalFile owner="root" permission="0644" target="/etc/pm/config.d/rtcwake.conf">suse/hooks/config.d/rtcwake.config</AdditionalFile>
            <AdditionalFile owner="root" permission="0755" target="/usr/lib/pm-utils/sleep.d/30s2disk-check">suse/hooks/sleep.d/30s2disk-check</AdditionalFile>
            <AdditionalFile owner="root" permission="0755" target="/usr/lib/pm-utils/sleep.d/45pcmcia">suse/hooks/sleep.d/45pcmcia</AdditionalFile>
        </AdditionalFiles>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-09-20</Date>
            <Version>1.4.1</Version>
            <Comment>Rebuild.</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.4.1</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2015-07-31</Date>
            <Version>1.4.1</Version>
            <Comment>First release</Comment>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>pm-utils</Name>
        <Summary xml:lang="tr">Askıya alma işlemleri için gerekli araçlar</Summary>
        <Description xml:lang="tr">pm-utils, bilgisayarı bellek veya disk kullanarak uyku kipine geçirmek ve devam ettirmek için gerekli kabuk betiklerini sunar.</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

def setup():
    autotools.configure()

def build():
    autotools.make()

def install():
    autotools.rawInstall('DESTDIR=%s' % get.installDIR())

    pisitools.dodoc('COPYING', 'TODO', 'README')


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>powertop</Name>
        <Homepage>http://www.lesswatts.org/projects/powertop/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        <Summary>Power consumption monitor</Summary>
        <Description>PowerTOP is a Linux tool that finds the software component(s) that make your computer use more power than necessary while it is idle.</Description>
        <Archive sha1sum="60da464a0c5d39c64b5d4a0e854bc6c480f8927a" type="targz">https://01.org/sites/default/files/downloads/powertop/powertop-2.8.tar.gz</Archive>
        <BuildDependencies>
            <Dependency>libnl-devel</Dependency>
            <Dependency>ncurses-devel</Dependency>
            <Dependency>pciutils-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>powertop</Name>
        <RuntimeDependencies>
            <Dependency>libnl</Dependency>
            <Dependency>ncurses</Dependency>
            <Dependency>libgcc</Dependency>
            <Dependency>pciutils</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="data">/var/cache/powertop</Path>
            <Path fileType="localedata">/usr/share/locale</Path>
        </Files>
    </Package>

    <History>
        <Update release="2">
            <Date>2017-04-05</Date>
            <Version>2.8</Version>
            <Comment>Rebuild.</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="1">
            <Date>2016-07-02</Date>
            <Version>2.8</Version>
            <Comment>First release</Comment>
            <Name>Kamil Atlı</Name>
            <Email>suvari@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>powertop</Name>
        <Summary xml:lang="tr">Güç tüketim izleme aracı</Summary>
        <Description xml:lang="tr">PowerTOP, bilgisayarınız atıl durumdayken ihtiyacından fazla güç tüketmesine neden olan yazılım bileşenlerini bulmak için kullanılan bir Linux aracıdır.</Description>
    </Source>
</PISI>


code:
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import shelltools
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

def setup():
    #autotools.autoreconf("-vif")
    shelltools.system("sh autogen.sh")
    autotools.configure("--enable-threads \
                         --enable-compress \
                         --disable-encrypt \
                         --disable-resume-static \
                         --with-initramfsdir=/usr/sbin")

def build():
    autotools.make()

def install():
    pisitools.dodir("/etc")
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    #pisitools.removeDir("/dev")

    shelltools.touch("%s/etc/suspend.key" % get.installDIR())


code:
--- suspend-0.8.20080612/bootsplash.c.printf_format	2009-02-04 09:45:15.000000000 +0100
+++ suspend-0.8.20080612/bootsplash.c	2009-02-04 10:03:01.000000000 +0100
@@ -118,7 +118,7 @@ int bootsplash_dialog(const char *prompt
 {
 	int ret;
 	bootsplash_to_verbose();
-	printf(prompt);
+	printf("%s", prompt);
 	ret = getchar();
 	bootsplash_to_silent();

--- suspend-0.8.20080612/splash.c.printf_format	2009-02-04 09:45:15.000000000 +0100
+++ suspend-0.8.20080612/splash.c	2009-02-04 09:56:30.000000000 +0100
@@ -53,7 +53,7 @@ static void splash_dummy_readpass(char *

 static int splash_dialog(const char *prompt)
 {
-	printf(prompt);
+	printf("%s", prompt);
 	return getchar();
 }


code:
Index: suspend-0.8_20100831/resume.c
===================================================================
--- suspend-0.8_20100831.orig/resume.c
+++ suspend-0.8_20100831/resume.c
@@ -471,19 +471,9 @@ int main(int argc, char *argv[])

 	while (stat(resume_dev_name, &stat_buf)) {
 		fprintf(stderr,
-			"%s: Could not stat the resume device file '%s'\n"
-			"\tPlease type in the full path name to try again\n"
-			"\tor press ENTER to boot the system: ", my_name,
-			resume_dev_name);
-		fgets(resume_dev_name, MAX_STR_LEN - 1, stdin);
-		n = strlen(resume_dev_name) - 1;
-		if (n <= 0) {
-			error = EINVAL;
-			goto Free;
-		}
-
-		if (resume_dev_name[n] == '\n')
-			resume_dev_name[n] = '\0';
+			"%s: Could not stat the resume device file '%s'\n", my_name, resume_dev_name);
+		error = EINVAL;
+		goto Free;
 	}

 	setvbuf(stdout, NULL, _IONBF, 0);


code:
Index: suspend-0.8_20100831/splash.c
===================================================================
--- suspend-0.8_20100831.orig/splash.c
+++ suspend-0.8_20100831/splash.c
@@ -206,7 +206,7 @@ void splash_prepare(struct splash *splas
 	if (!mode)
 		return;

-	printf("Looking for splash system... ");
+	/*printf("Looking for splash system... ");*/

 	if (!bootsplash_open()) {
 		splash->finish      = bootsplash_finish;
@@ -246,12 +246,12 @@ void splash_prepare(struct splash *splas
 	} else if (0) {
 		/* add another splash system here */
 	} else {
-		printf("none\n");
+		/*printf("none\n");*/
 		if (!open_input_fd())
 			splash->key_pressed = key_pressed;
 		return;
 	}
-	printf("found\n");
+	/*printf("found\n");*/

 	splash->progress(0);
 }
Index: suspend-0.8_20100831/suspend.c
===================================================================
--- suspend-0.8_20100831.orig/suspend.c
+++ suspend-0.8_20100831/suspend.c
@@ -1733,7 +1733,7 @@ int suspend_system(int snapshot_fd, int
 	}

 	sprintf(message, "Snapshotting system");
-	printf("%s: %s\n", my_name, message);
+	/*printf("%s: %s\n", my_name, message);*/
 	splash.set_caption(message);
 	attempts = 2;
 	do {
@@ -1748,7 +1748,7 @@ int suspend_system(int snapshot_fd, int
 		if (!in_suspend) {
 			/* first unblank the console, see console_codes(4) */
 			printf("\e[13]");
-			printf("%s: returned to userspace\n", my_name);
+			/*printf("%s: returned to userspace\n", my_name);*/
 			free_snapshot(snapshot_fd);
 			break;
 		}


code:
#!/bin/bash
#
# configuration script for encrypted suspend
#
# (C) 2008 Stefan Seyfried <seife@suse.de> SUSE Linux Products GmbH
#     released under the GPL V2

CONF=/etc/suspend.conf

if [ $UID != 0 ]; then
	echo "Sorry, this configuration script needs root privileges."
	echo "Exiting now..."
	echo
	exit 1
fi

cat <<EOF
We are going to create the key for encrypted suspend now. There are some
questions we need to ask for:
- Key size.
  The longer the key, the harder it will be to break the encryption.
  On the other hand, the longer the key, the more computational power is
  needed, which means that the suspend and resume will be slightly slower.
  Nowadays, 1024 bits of key length might be too insecure for some users,
  the default of 2048 bits should be fine.
- Your passphrase. This passphrase protects the generated key. It should
  be sufficiently long and not easy to guess.
  This is the password you need to enter to resume from encrypted suspend.
  To make sure that you did not mistype the passphrase, you need to confirm
  it by entering it a second time.

The program will create the key and copy it to /etc/suspend.key, then it
will modify /etc/suspend.conf that from now on your suspend to disk image
will be encrypted. Note that creating the key might take some time,
depending on your machine. You can probably speed it up by using the mouse
and generating I/O, e.g. by starting other programs.

If you do not want to continue, press CTRL-C now.

EOF
# -q suppresses asking for the key file and makes it default
# to /etc/suspend.key
suspend-keygen -q

if [ $? != 0 ]; then
	echo
	echo "Something went wrong. Please check above for error messages."
	echo "/etc/suspend.conf is not modified."
	echo
	exit 1
fi

echo "We successfully generated /etc/suspend.key. Modifying suspend.conf now."

# backup...
cp -a $CONF ${CONF}.backup
# remove the encrypt and keyfile entries from the config file.
# the key file will default to /etc/suspend.key anyway
sed -i '/^encrypt /d;/^RSA key file /d;' $CONF
echo "encrypt = y" >> $CONF

# if we have more than one CPU / core, enabling threads will speed up
# suspend.
NUMCPU=$(grep -c ^processor /proc/cpuinfo)
if [ $NUMCPU -gt 1 ]; then
	# remove the threads setting...
	sed -i '/^threads /d; ' $CONF
	# ..and add it back.
	echo "threads = y" >> $CONF
fi

echo
echo "/etc/suspend.conf written, you can find the original file as /etc/suspend.conf.backup"
echo


code:
Index: b/suspend.c
===================================================================
--- a/suspend.c
+++ b/suspend.c
@@ -1261,6 +1261,11 @@ Shutdown:

 Unfreeze:
 	unfreeze(snapshot_fd);
+	/* ugly hack, because "user aborted suspend" is not really
+	 * an error.
+	 */
+	if (error == EINTR)
+		return 0;
 	return error;
 }


code:
Index: b/suspend.c
===================================================================
--- a/suspend.c
+++ b/suspend.c
@@ -1772,11 +1772,10 @@ int suspend_system(int snapshot_fd, int
 				if (error)
 					goto Shutdown;
 				reset_signature(resume_fd);
 				free_swap_pages(snapshot_fd);
 				free_snapshot(snapshot_fd);
-				s2ram_resume();
 				goto Unfreeze;
 			}
 Shutdown:
 #endif
 			close(resume_fd);
@@ -2268,11 +2267,11 @@ int main(int argc, char *argv[])
 	struct stat stat_buf;
 	int resume_fd, snapshot_fd, vt_fd, orig_vc = -1, suspend_vc = -1;
 	int test_fd = -1;
 	dev_t resume_dev;
 	int orig_loglevel, orig_swappiness, ret;
-	struct rlimit rlim;
+	struct rlimit rlim, rlim_saved;
 	static char chroot_path[MAX_STR_LEN];

 	my_name = basename(argv[0]);

 	/* Make sure the 0, 1, 2 descriptors are open before opening the
@@ -2500,19 +2499,19 @@ int main(int argc, char *argv[])
 		goto Restore_console;
 	}

 	splash.progress(5);

+#ifdef CONFIG_ENCRYPT
+        if (do_encrypt && ! use_RSA)
+                splash.read_password(password, 1);
+#endif
 #ifdef CONFIG_BOTH
 	/* If s2ram_hacks returns != 0, better not try to suspend to RAM */
 	if (s2ram)
 		s2ram = !s2ram_hacks();
 #endif
-#ifdef CONFIG_ENCRYPT
-        if (do_encrypt && ! use_RSA)
-                splash.read_password(password, 1);
-#endif

 	open_printk();
 	orig_loglevel = get_kernel_console_loglevel();
 	set_kernel_console_loglevel(suspend_loglevel);

@@ -2522,18 +2521,25 @@ int main(int argc, char *argv[])

 	sync();

 	splash.progress(10);

+	getrlimit(RLIMIT_NOFILE, &rlim_saved);
 	rlim.rlim_cur = 0;
 	rlim.rlim_max = 0;
 	setrlimit(RLIMIT_NOFILE, &rlim);
 	setrlimit(RLIMIT_NPROC, &rlim);
 	setrlimit(RLIMIT_CORE, &rlim);

 	ret = suspend_system(snapshot_fd, resume_fd, test_fd);

+	setrlimit(RLIMIT_NOFILE, &rlim_saved);
+#ifdef CONFIG_BOTH
+	if (s2ram)
+		s2ram_resume();
+#endif
+
 	if (orig_loglevel >= 0)
 		set_kernel_console_loglevel(orig_loglevel);

 	close_printk();


code:
Index: b/keygen.c
===================================================================
--- a/keygen.c
+++ b/keygen.c
@@ -25,11 +25,11 @@

 #define MIN_KEY_BITS	1024
 #define MAX_KEY_BITS	4096
 #define MAX_OUT_SIZE	(sizeof(struct RSA_data))
 #define MAX_STR_LEN	256
-#define DEFAULT_FILE	"suspend.key"
+#define DEFAULT_FILE	"/etc/suspend.key"

 static char in_buffer[MAX_STR_LEN];
 static char pass_buf[MAX_STR_LEN];
 static struct RSA_data rsa;
 static unsigned char encrypt_buffer[RSA_DATA_SIZE];
@@ -40,11 +40,11 @@ int main(int argc, char *argv[])
 	gcry_ac_handle_t rsa_hd;
 	gcry_ac_key_t rsa_priv;
 	gcry_ac_key_pair_t rsa_key_pair;
 	gcry_mpi_t mpi;
 	size_t offset;
-	int len = MIN_KEY_BITS, ret = EXIT_SUCCESS;
+	int len = 2048, ret = EXIT_SUCCESS;
 	struct termios termios;
 	char *vrfy_buf;
 	struct md5_ctx ctx;
 	unsigned char key_buf[PK_KEY_SIZE];
 	gcry_cipher_hd_t sym_hd;
@@ -197,12 +197,15 @@ Retry:
 		gcry_free(str);
 	}

 	size = offset + sizeof(struct RSA_data) - RSA_DATA_SIZE;

-	printf("File name [%s]: ", DEFAULT_FILE);
-	fgets(in_buffer, MAX_STR_LEN, stdin);
+	*in_buffer = 0;
+	if (!((argc > 1) && (strcmp(argv[1], "-q") == 0))) {
+		printf("File name [%s]: ", DEFAULT_FILE);
+		fgets(in_buffer, MAX_STR_LEN, stdin);
+	}
 	if (!strlen(in_buffer) || *in_buffer == '\n')
 		strcpy(in_buffer, DEFAULT_FILE);
 	else if (in_buffer[strlen(in_buffer)-1] == '\n')
 		in_buffer[strlen(in_buffer)-1] = '\0';
 	fd = open(in_buffer, O_RDWR | O_CREAT | O_TRUNC, 00600);


code:
Index: s2ram-x86.c
===================================================================
--- s2ram-x86.c.orig
+++ s2ram-x86.c
@@ -321,6 +321,7 @@ int s2ram_do(void)

 void s2ram_resume(void)
 {
+	int i = 0;
 	if (flags & PCI_SAVE) {
 		printf("restoring PCI config of device %02x:%02x.%d\n",
 			vga_dev.bus, vga_dev.dev, vga_dev.func);
@@ -330,19 +331,36 @@ void s2ram_resume(void)
 	}
 	// FIXME: can we call vbetool_init() multiple times without cleaning up?
 	if (flags & VBE_POST) {
-		vbetool_init();
-		printf("Calling do_post\n");
-		do_post();
+		while (i++ < 5) {
+			vbetool_init();
+			printf("Calling do_post\n");
+			if (!do_post())
+				break;
+			printf("do_post failed, sleeping 100ms and retrying...\n");
+			usleep(100000);
+		}
+		i = 0;
 	}
 	if (vbe_buffer) {
-		vbetool_init();
-		printf("Calling restore_state_from\n");
-		restore_state_from(vbe_buffer);
+		while (i++ < 5) {
+			vbetool_init();
+			printf("Calling restore_state_from\n");
+			if (!restore_state_from(vbe_buffer))
+				break;
+			printf("restore_state_from failed, sleeping 100ms and retrying...\n");
+			usleep(100000);
+		}
+		i = 0;
 	}
 	if (vbe_mode >= 0) {
-		vbetool_init();
-		printf("Calling set_vbe_mode\n");
-		do_set_mode(vbe_mode, 0);
+		while (i++ < 5) {
+			vbetool_init();
+			printf("Calling set_vbe_mode\n");
+			if (!do_set_mode(vbe_mode, 0))
+				break;
+			printf("set_vbe_mode failed, sleeping 100ms and retrying...\n");
+			usleep(100000);
+		}
 	}
 	if (!fb_nosuspend)
 		resume_fbcon();
Index: vbetool/vbetool.c
===================================================================
--- vbetool/vbetool.c.orig
+++ vbetool/vbetool.c
@@ -231,9 +231,10 @@ int do_post(void)
 	return 0;
 }

-void restore_state_from(char *data)
+int restore_state_from(char *data)
 {
 	struct LRMI_regs r;
+	int ret = 1;

 	/* VGA BIOS mode 3 is text mode */
 	do_set_mode(3,1);
@@ -252,12 +253,16 @@ void restore_state_from(char *data)
 			"Can't restore video state (vm86 failure)\n");
 	} else if ((r.eax & 0xffff) != 0x4f) {
 		fprintf(stderr, "Restore video state failed\n");
+	} else {
+		/* everything ok */
+		ret = 0;
 	}

 	LRMI_free_real(data);

 	ioctl(0, KDSETMODE, KD_TEXT);

+	return ret;
 }

 #ifndef S2RAM
Index: vbetool/vbetool.h
===================================================================
--- vbetool/vbetool.h.orig
+++ vbetool/vbetool.h
@@ -18,5 +18,5 @@ int disable_vga(void);
 int do_get_panel_id();
 void vbetool_init(void);
 char *__save_state(int *);
-void restore_state_from(char *);
+int restore_state_from(char *);
 int __get_mode(void);


code:
Index: b/conf/suspend.conf
===================================================================
--- a/conf/suspend.conf
+++ b/conf/suspend.conf
@@ -1,9 +1,62 @@
-snapshot device = /dev/snapshot
-resume device = <path_to_resume_device_file>
+#############################################################################
+##
+## note:
+## using pm-utils or powersaved, this file (/etc/suspend.conf) only serves as
+## a template, image_size and resume_device are filled in dynamically
+## and the generated /var/lib/s2disk.conf is used to suspend.
+## _If_ you enter stuff here, it will be copied to that file unchanged,
+## but this might skip some features and sanity checks.
+##
+#############################################################################
+##
+## your snapshot device. You should not need to change this.
+# snapshot device = /dev/snapshot
+#
+## enter your swap device here. Read the warning on pm-utils above, please!
+#resume device = <path_to_resume_device_file>
+#
+## image size will also be filled in by pm-utils
 #image size = 350000000
+#
 #suspend loglevel = 2
+#max loglevel =
+#
+## compute checksum will slow down suspend and resume.
+## Debugging option, default n
 #compute checksum = y
-#compress = y
+#
+## compression will often speed up suspend and resume (default n)
+#compress = n
+#
+## encryption support is rather basic right now - e.g. USB keyboards will not
+## work to enter the key in the standard initrd, also beware of
+## non-US keyboard layouts. Only use this if you know what you are doing.
 #encrypt = y
-#early writeout = y
+#
+## RSA key file that is used for encryption
+#RSA key file = /etc/suspend.key
+#
+## start writing out the image early, before buffers are full.
+## will most of the time speed up overall writing time (default y)
+#early writeout = n
+#
+## use splash picture? (default n)
 #splash = y
+#
+## shutdown method:
+## platform - go through ACPI BIOS to power off the machine (default on
+##            machines that support it)
+## shutdown - just power off like after a shutdown
+## reboot   - reboot instead of powering off. For debugging only.
+#shutdown method = platform
+#
+## resume offset: for use with swapfiles, use "swap-offset" to find out.
+#resume offset = 12345
+#
+## pause after resume for n seconds, so that the timing information can
+## actually be read (default 0 => don't pause)
+#resume pause = 2
+#
+## use threads for suspend? (default n)
+## this hugely speeds up encryption and also compression on mulitcore machines
+#threads = y


code:
Index: suspend.c
===================================================================
--- suspend.c.orig
+++ suspend.c
@@ -1768,13 +1768,15 @@ int main(int argc, char *argv[])
 	if (compute_checksum != 'y' && compute_checksum != 'Y')
 		compute_checksum = 0;
 #ifdef CONFIG_COMPRESS
-	if (do_compress != 'y' && do_compress != 'Y') {
+	if (do_compress != 'n' && do_compress != 'N') {
+		do_compress = 1;
+		if (lzo_init() != LZO_E_OK) {
+			suspend_error("Failed to initialize LZO. "
+					"Compression disabled.\n");
+			do_compress = 0;
+		}
+	} else
 		do_compress = 0;
-	} else if (lzo_init() != LZO_E_OK) {
-		suspend_error("Failed to initialize LZO. "
-				"Compression disabled.\n");
-		do_compress = 0;
-	}
 #endif
 #ifdef CONFIG_ENCRYPT
 	if (do_encrypt != 'y' && do_encrypt != 'Y')
Index: conf/suspend.conf
===================================================================
--- conf/suspend.conf.orig
+++ conf/suspend.conf
@@ -25,7 +25,7 @@
 ## Debugging option, default n
 #compute checksum = y
 #
-## compression will often speed up suspend and resume (default n)
+## compression will often speed up suspend and resume (default y)
 #compress = n
 #
 ## encryption support is rather basic right now - e.g. USB keyboards will not


code:
Index: resume.c
===================================================================
--- resume.c.orig
+++ resume.c
@@ -421,10 +421,10 @@ int main(int argc, char *argv[])
 	if (error)
 		return -error;

-	if (splash_param != 'y' && splash_param != 'Y')
-		splash_param = 0;
-	else
+	if (splash_param != 'n' && splash_param != 'N')
 		splash_param = SPL_RESUME;
+	else
+		splash_param = 0;

 	get_page_and_buffer_sizes();

Index: suspend.c
===================================================================
--- suspend.c.orig
+++ suspend.c
@@ -1782,10 +1782,10 @@ int main(int argc, char *argv[])
 	if (do_encrypt != 'y' && do_encrypt != 'Y')
 		do_encrypt = 0;
 #endif
-	if (splash_param != 'y' && splash_param != 'Y')
-		splash_param = 0;
-	else
+	if (splash_param != 'n' && splash_param != 'N')
 		splash_param = SPL_SUSPEND;
+	else
+		splash_param = 0;

 	if (early_writeout != 'n' && early_writeout != 'N')
 		early_writeout = 1;
Index: conf/suspend.conf
===================================================================
--- conf/suspend.conf.orig
+++ conf/suspend.conf
@@ -40,7 +40,7 @@
 ## will most of the time speed up overall writing time (default y)
 #early writeout = n
 #
-## use splash picture? (default n)
+## use splash picture? (default y)
 #splash = y
 #
 ## shutdown method:


code:
�7zXZ�ִF!�X��[��]2I	��}P�
OG��S��	�N�%���7�O	���<��b�����������fpr�0Gh��xs��/�\���P�(�|�W�;��!��3¼V^d��8?�z
��?l`7B��Ton�p�m�V|�4eL=?E_fٕ�Noe��\Ԑ���=m:�;팦�h��7ף��bf�>�ʄ�H��:��e����`s̓�MM��,`0��bۆ6�j�����ɿ��]p(�-��� .ĝ@U��~����6,h~�us����B����ުaz#eհ�Z��zz+�?�|��ş���E�>l���$r�`au�蝲��ӥP�� 4�g f�͊5���ۀ�_Pŗ���1p�>����
K)�\��kg�����g\��6�W�����e�S�l�����'L�M"����&����7༚G�>����{�^�r�Q���{'s�gy
+�g�7l~�#o�
Z��8�����Qf�KN��y��h��
5F��F�KR��y�kR7���=����Ҋ�3B���$��o�y��y���y+�<��F�7���W~ʘo؈UD��V!�����g�G�-o.�ρcM��v��jI[Nkn?�B��+�Η���\+���lQ�+��(���.�[����Z]�,6�������\I�H�pz�c��ǧ���>���T���ͮ��h�|L(@w�����kTݛ�H4p���L&��~O�SU)E��'�Wh��J����Qr��ɕ���n�1�����/X/�k~��L-�8���V|�~�l�H��+��M�t[M��EÒ:�
f���=�ɣtj����jՊY�ن���9��5ˠ���Aۢ���C�%��
�W^z�n�x7�U���!ͮ0��)�s�&���d�/�c���#Կ�:rk�הZ��9nP�:�!�3��۱��qm���"�ae�Tޓ��L�$3-��w͘oHsˑ�k78)0�$y��-P��,⎛2�M�0	s�������S@���?^M����)ʝ
�fB�1%E�
5�2wt�S�u("�c��d�A��i�W~�x7�\�u���3���9�3�ǝ�sQ
U�*tn�"9���M
&�]�hJQ�qP��*��{�6�Q�*&nvR�6]x���"SP�g_鈆��
f�	xh����C�W�
�r���
���Yy�Q'/?+*�74Nh�:Z���t8�{�>3',��Q�*���
Y�+5;��V��FC�m��P}H� �[
�����2,i�&.}ؽ��ճKP�B6]b&�Vm���y�1Xt��G4��U���j(hV�v"�G�|@ZL��ZrI�8�N��Bh`vF+}�Ű�ȆF{��z����,ܗp4�	V5Ytw;�Y�c�
�9@��V��teN�����E~#+$=�Q�
z����L�ȍ7qg��ǔ���o�^�_�����տٞ��
n���b��H��%7E�Y��_k�9(�q�nf";�qN1�o]�-uo>�n�K��S}����࡞O�p�/�RCY�pd��:d�^3�@���u��,��#1?��
��TB���@�
��v=(�q��I+�U�;1!�Hm�������e��n�dC�S����Y��BJ�C21cȑ?j�F��MQ �e�pM5$>�a�����^p�cq����*Q'�73�e��A�:����,��SDT���,R�/jC,q�����Wn,(��1���
Jr�wu�&"�@���%���_=�ޓ-�J໕9RB���0\��K]���ƃʌ��H�$F�oc�x��:p�Q�Di�3B�X�aH�+]ZY�|�SL(g��zG�����m;����t[�P��� �b��p�����F�T�W�^}v�Nt�a5�ȗl���d7JG�$A$V��E�.1Ϛ�GL�2��
˹��:��\p��:#R���]���W$��ն�m�m7A+W�W)����,5]�t����Ο��fp<�O�PF&]G>���yܪĈ�!!�w:��X��i��S}B�{U�X`W�>��MzK��Z�2�8�����N��w����҆jm��E|���ڧ�a�>��t/ޱ���u�,�hJӟ8�l2`
о���V\;#�jMߤ��_#�����!b��n!Yl��	�^���u#�'�ʡ|�n��.#�C�0��	/���S,��"/
�lM���v��c��z���0U:���o�I�����w��z{��U�*��j�?A��,��N�.t<�]lk#��et��X��*`���ir�s����/��d�����,�+��b�VR
�>�ɡ}�bU�j�5u�~�/őkބ2u�ڷ$Z6ɵ�������\>#�N�/h0<Tm���+�\�/���җv�c)��ۿl�
)_I.�+f�B��D�?�Ǟ�r�u���k�Ɔ}`}AxY ߑ)�z�?U�����H�dY�f$�]7FEB�X;HF�����P+M�@W�w�{�#{���g�`�E`�7yiJLl��d�fᔟЫY��S������|%���:(�ì�lS��es��|SAတ�2N������T�xQ�����̳Y���U$~T��o���h�B-�ͳ����b���X�}�4z6rO���z'L�����
[ĕ�:�U(&jT5�&���sJ,����
f��rD�MHnW�?�ל�JS
�����p�$8�V���F\/�bq�)�8-^�q�ZBh�5;\k�_舼>�0�".vr�B��t�h"�i��B��D�����4Fʂ�ۜ!�i1�q���u�W�x/p��7v�M��13�@")�T�pi��ϲ�.����`~&��I�2>#}�2��8�L��kE_V��ԫ%��H�umxVi�S��؏�슲`�u�ٌ�>]VZ��U6qt�9�t)�*@�2�$�"̧�ɐߺK���&��߈v��;SlD _���(����҆��WT*�I��4tw?�܉!���pZ��t���ݢQ�E�-�0��)����O�m��=8���܇�B�X�M����cXQr��_�͉\m
�읙�z=h����Ii���A��X���2�v���Q�{�׍<,��Nd\�D�8���xn]�pE�B���s�������h|s��wh��*��mi���'��nJߥV�;�-���
�l��=
1�f�cOr!��%�c��O�E���ډ�)�5�H�t�lO�-2�,�#�OȴC���2���F�R����.5�g]:_6�\��WE=sC�����|�9���t�����K��͎򕗳�=xx���5���~�k�bl���qr&khݾ��.SZ��y�87�O
v��Z�>�O�N�x�r��~�ra�5�VvG=赑��/o
/~�Z���{?)C}ƀ���x���c�����Vj�.U���'L��Zi��Q���*��B,��}��Æ'Z/�O���QÖ�B�������S���ް���4G�qs�2��x�e�'x��/��	�-8�9�Jp�!h�>�� �
N�3S�,�O%@8"�vB)�����U��tUVK
�q���@�d�54�G�)�c?��`;���x�h�f��3\��Ǹ���ʌo��A�-ʱ�!y�*D���I�%�S^��[�+��yN�,����Xs��?�M�5��b���J�B�4ܶ�T�;�
�b���0��W�-dk�Gl��.:�sD!(��w*���J"��S*%2S��0�/N7s��S	|r*F3����/6�-t�ң=������ b�N���L6X��F�6M�^��e����C_�Q���?f����g
K`��w2���d#Q;�1��妊^�����/n3�²	�e���7�;��u/�]�N���nh5LKK
��"
��x��*����B���d婐H
��c��
�0�+�b��}�A�g���+l\�Aڕ�_zN��"A�t7$+�ζ�
c/�eߚ���8�<�}�W��c�,!�gk}���X>�S�r�c��b
�e���`4 ��=Q�Cz�7qڔ��K>P��[ˋ��w9g�{����@�ؤT�ޖ��2����t��e��9�zjфh����P1�%T6\� �WVpB�w�c?:���ޞ"D�;�;e�[ȣ�y��"7	�h�|�C���k\c�F�M�d��I��>��~�3Fo���/u��W���?<H*�OPJ�����Pȭ�ZvV�?�l;�F^o+�Q�1��N{���&$2P����� �R&��L�;��٘sy���N��I���HSb��������Q:+�|Y��V�2��2>�Mq�V�Z8�S�7�"���4#m��
_���>���4{e�
K�>D�`P�~�����O�q	��_مs�J�=Y�a����	���A,�S�o�븶?��f|��@�ǿ���1��,%7��\Ð��s�ʙ�N9�f�)~T��nZ#�'(�y��>�W�(�QuW�@��aa��[�T3�OSiՉI���ԫ`7��.ۯ��1A$T��k^�p�|���� � �A4sg�Bø�ҁ=Ub ����T�m⸄��#A(5��M:	9q��Nm핤�K�P��Ŧ/^�G�\
}~��$��#4��t2�]
�Q؄_�(<�o	LP�z��X�}��L�"�:�x@�yѯ����c�B�\���F/W+�Md �9�J�v���c�~x�>�JTG�!
��7~��������/(&
��
�sH[���]ba�b#l
3	"�eUJ��[�ڵ���-�\��T��I�'W�_?�e�M{]��\�-�ܽ[x�v>�}&���ˋ�.a#�5?�]�"$��
!��jZ�QO��h%��RQ������ܥ��	|h�B�2K�A��##��Q�
J�u�4�{ʳJ�$Bz�=#���Z}��;�y�.�"��u���i2����X'�{Ԉ/G���=�޻֩�T�;r�`aM���F�g}!���s��&4�p(��9��"�9 �Ȧҥ�z�0����Zp#�Д��qX�����:	RD}Zβ����&���f�W��񡜣���(*_)�%e�Ԛ1�J31+��H��cB�x�_��Dۭ;#��v�΂�Z�k泔���IF����A�gl껄��n�}���q&BM�����YMĶ�	c�
m2I���Ws��b��m�7��m��y��H�5l8�IY1�AǎAC�c8�JvJ�i>���b$�ܪ�a�VR�4������P�+z��&ի]g��l��Ca���Ɏ�/�WHq���.&�j8h�:�ãԶ�|���ڶ�B��2=�PҤWtR:t>����}�Ĳ"�7�A�a�����ao�ʿ;��4?z%���z,�ޮ8��W� �(oZ%E��uͺ����+��z����,���o.l-)�.-<�Qՠ<U/��I���g�9h=�5����=X�v]c�G}�&p�
L:`i1,�BhОֆA���B��I����~Bzt��w�U�
q��GPx5R��ی�F
H;�H���4���z��2-	�%���&���w#A��i�v�t�F[My�ܐ���D���ŀ<#G��A�)VnXK����p)�Ke��d����2�/��:ȀLմ��I�O�oVA�^��z���	���Y_�4�J<yt�Ѡ�0~����ב�H���f'_�[����p�(}�E,w��:M��tV���@�Vm��}!��!/�4�����T:"=������J�?��� �-���?�Xa�
N�H�nW�/���f�	#��?��I�*,�L�{O�ӱ3�EDY�NY�ͼ�O	;�����Z
t��6J�%8�_��Ĝy:(Bb=k寡������Nj`!a��-u�9u���RT�,��W9@��5����qp������FR�iH���Q���mQ��L\���%�$[bu�қ���k���
f����|�"�sX L��Psd�X���l��+]�FJd�U�n��AC�˰q�OY_����8��C�P� ,v�x#U	e�G>��{q"Mx�d@�C7��!�w3���
Fέ��/����Ա�g�YZ


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>suspend</Name>
        <Homepage>http://suspend.sourceforge.net/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        <Summary>A set of tools to support sleep modes</Summary>
        <Description>suspend package allows users to suspend-to-ram, suspend-to-disk, and suspend-to-both.</Description>
        <Archive sha1sum="77d9ae2af73f5faffcec351910fcd9b015a9501c" type="tarxz">http://dev.gentoo.org/~bircoph/distfiles/suspend-1.0_p20120915.tar.xz</Archive>
        <BuildDependencies>
            <Dependency>lzo-devel</Dependency>
            <Dependency>pciutils-devel</Dependency>
            <Dependency>libx86-devel</Dependency>
            <Dependency>libgcrypt-devel</Dependency>
        </BuildDependencies>
        <Patches>
            <Patch level="1" compressionType="xz">suspend-1.0_p20150810.patch.xz</Patch>
        </Patches>
    </Source>

    <Package>
        <Name>suspend</Name>
        <RuntimeDependencies>
            <Dependency>lzo</Dependency>
            <Dependency>libx86</Dependency>
            <Dependency>pciutils</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="config">/etc/suspend.conf</Path>
            <Path fileType="config">/etc/suspend.key</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="doc">/usr/share/man</Path>
        </Files>
        <AdditionalFiles>
            <AdditionalFile owner="root" permission="0755" target="/usr/sbin/configure-suspend-encryption">suse/configure-suspend-encryption.sh</AdditionalFile>
        </AdditionalFiles>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-03-01</Date>
            <Version>1.0_p20120915</Version>
            <Comment>Rebuild for new toolchain.</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.0_p20120915</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-04-02</Date>
            <Version>1.0_p20120915</Version>
            <Comment>First release</Comment>
            <Name>Varol Maksutoğlu</Name>
            <Email>waroi@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>suspend</Name>
        <Summary xml:lang="tr">Uyku kiplerini destekleme araçları</Summary>
        <Description xml:lang="tr">suspend, kullanıcıların bellek, disk veya her ikisini de kullanarak sistemlerini askıya almalarını sağlayan araçları içerir.</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools

def setup():
    pisitools.dosed("configure", "DISABLE_DEPRECATED", deleteLine=True)

    autotools.configure("--disable-static \
                         --disable-gtk-doc \
                         --enable-deprecated \
                         --enable-introspection")

    pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc("ChangeLog", "COPYING", "README")


code:
--- upower-0.9.4.orig/po/LINGUAS
+++ upower-0.9.4/po/LINGUAS
@@ -3,4 +3,4 @@
 it
 sv
 pl
-
+tr


code:
From b9cff29978113aefe3ad18521f383f12ab099a34 Mon Sep 17 00:00:00 2001
From: Cosimo Cecchi <cosimo@endlessm.com>
Date: Tue, 25 Feb 2014 09:43:04 +0000
Subject: Create the history directory at runtime

In addition to build time - this increases compatibilty with OSTree,
which starts out with an empty /var.

Signed-off-by: Richard Hughes <richard@hughsie.com>
---
diff --git a/src/up-history.c b/src/up-history.c
index f9d0fdf..795b093 100644
--- a/src/up-history.c
+++ b/src/up-history.c
@@ -414,6 +414,7 @@ up_history_set_directory (UpHistory *history, const gchar *dir)
 {
 	g_free (history->priv->dir);
 	history->priv->dir = g_strdup (dir);
+	g_mkdir_with_parents (dir, 0755);
 }

 /**
@@ -887,7 +888,8 @@ up_history_init (UpHistory *history)
 	history->priv->data_time_full = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
 	history->priv->data_time_empty = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
 	history->priv->max_data_age = UP_HISTORY_DEFAULT_MAX_DATA_AGE;
-	history->priv->dir = g_build_filename (HISTORY_DIR, NULL);
+
+	up_history_set_directory (history, HISTORY_DIR);
 }

 /**
--
cgit v0.9.0.2-2-gbebe


code:
From 0d64bbddaa0078ef148d609a3cfad854cf00d7de Mon Sep 17 00:00:00 2001
From: Martin Pitt <martinpitt@gnome.org>
Date: Fri, 08 Nov 2013 13:59:50 +0000
Subject: lib: Fix segfault on getting property when daemon is not running

This fixes "upower --version" when the daemon is not running, and thus the
client proxy is NULL.
---
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
index 35d7b5d..17fb02d 100644
--- a/libupower-glib/up-client.c
+++ b/libupower-glib/up-client.c
@@ -322,6 +322,9 @@ up_client_get_property (GObject *object,
 	UpClient *client;
 	client = UP_CLIENT (object);

+	if (client->priv->proxy == NULL)
+                return;
+
 	switch (prop_id) {
 	case PROP_DAEMON_VERSION:
 		g_value_set_string (value, up_client_glue_get_daemon_version (client->priv->proxy));
--
cgit v0.9.0.2-2-gbebe


code:
# Turkish translation for devicekit-power.
# This file is distributed under the same license as the devicekit-power package.
# Ozan Çağlayan <ozan@pardus.org.tr>
#
msgid ""
msgstr ""
"Project-Id-Version: upower\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-06 09:41+0200\n"
"PO-Revision-Date: 2010-06-08 10:13+0100\n"
"Last-Translator: Ozan Çağlayan <ozan@pardus.org.tr>\n"
"Language-Team: Turkish <tr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../policy/org.freedesktop.devicekit.power.policy.in.h:1
msgid "Authentication is required to hibernate the system"
msgstr "Sistemi disk kullanarak askıya almak için yetki gerekiyor"

#: ../policy/org.freedesktop.devicekit.power.policy.in.h:2
msgid "Authentication is required to suspend the system"
msgstr "Sistemi bellek kullanarak askıya almak için yetki gerekiyor"

#: ../policy/org.freedesktop.devicekit.power.policy.in.h:3
msgid "Hibernate the system"
msgstr "Disk kullanarak askıya al"

#: ../policy/org.freedesktop.devicekit.power.policy.in.h:4
msgid "Suspend the system"
msgstr "Bellek kullanarak askıya al"

#: ../policy/org.freedesktop.devicekit.power.qos.policy.in.h:1
msgid "Authentication is required to cancel a latency request"
msgstr "Gecikme isteğinin iptali için yetki gerekiyor"

#: ../policy/org.freedesktop.devicekit.power.qos.policy.in.h:2
msgid "Authentication is required to set a persistent latency setting"
msgstr "Gecikmenin kalıcı olarak ayarlanması için yetki gerekiyor"

#: ../policy/org.freedesktop.devicekit.power.qos.policy.in.h:3
msgid "Authentication is required to set administrator settings for latency control"
msgstr "Gecikme denetimi için yönetimsel ayarların yapılması yetki gerektiriyor"

#: ../policy/org.freedesktop.devicekit.power.qos.policy.in.h:4
msgid "Authentication is required to set the required latency of an application"
msgstr "Uygulamanın gecikmesinin ayarlanması yetki gerektiriyor"

#: ../policy/org.freedesktop.devicekit.power.qos.policy.in.h:5
msgid "Cancel a latency request"
msgstr "Gecikme isteğini iptal et"

#: ../policy/org.freedesktop.devicekit.power.qos.policy.in.h:6
msgid "Set a persistent latency setting"
msgstr "Gecikmeyi kalıcı olarak ayarla"

#: ../policy/org.freedesktop.devicekit.power.qos.policy.in.h:7
msgid "Set administrator settings for latency control"
msgstr "Gecikme denetimi için yönetimsel ayarları yap"

#: ../policy/org.freedesktop.devicekit.power.qos.policy.in.h:8
msgid "Set the required latency of an application"
msgstr "Bir uygulamanın gecikmesini ayarla"

#: ../src/dkp-main.c:134
#: ../tools/dkp-tool.c:213
msgid "Show extra debugging information"
msgstr "Ek hata ayıklama bilgileri göster"

#: ../tools/dkp-tool.c:214
msgid "Enumerate objects paths for devices"
msgstr "Aygıtlar için nesne yollarını sırala"

#: ../tools/dkp-tool.c:215
msgid "Dump all parameters for all objects"
msgstr "Tüm nesneler için parametreleri göster"

#: ../tools/dkp-tool.c:216
msgid "Get the wakeup data"
msgstr "Uyanma verisini al"

#: ../tools/dkp-tool.c:217
msgid "Monitor activity from the power daemon"
msgstr "Güç hizmeti etkinliklerini izle"

#: ../tools/dkp-tool.c:218
msgid "Monitor with detail"
msgstr "Detaylı izleme"

#: ../tools/dkp-tool.c:219
msgid "Show information about object path"
msgstr "Nesne yoluyla ilgili bilgi göster"


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>upower</Name>
        <Homepage>http://upower.freedesktop.org</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2+</License>
        <IsA>library</IsA>
        <IsA>app:console</IsA>
        Power Management Service
        <Description>upower provides a daemon, API and command line tools for managing power devices attached to the system.</Description>
        <Archive sha1sum="70beb18c218e758586fb5d98d79b5121cc4a47b1" type="tarxz">http://upower.freedesktop.org/releases/upower-0.99.4.tar.xz</Archive>
        <AdditionalFiles>
            <AdditionalFile target="po/tr.po">tr.po</AdditionalFile>
        </AdditionalFiles>
        <BuildDependencies>
            <Dependency>dbus-devel</Dependency>
            <Dependency>glib2-devel</Dependency>
            <Dependency>polkit-devel</Dependency>
            <Dependency>dbus-glib-devel</Dependency>
            <Dependency>libgudev-devel</Dependency>
            <Dependency>libusb-devel</Dependency>
            <Dependency>libplist-devel</Dependency>
            <Dependency>libimobiledevice-devel</Dependency>
            <Dependency>gobject-introspection-devel</Dependency>
            <Dependency>docbook-xsl</Dependency>
            <Dependency>intltool</Dependency>
        </BuildDependencies>
        <Patches>
            <Patch level="1">add-tr.patch</Patch>

        </Patches>
    </Source>

    <Package>
        <Name>upower</Name>
        <RuntimeDependencies>
            <Dependency>dbus</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency>polkit</Dependency>
            <Dependency>dbus-glib</Dependency>
            <Dependency>libgudev</Dependency>
            <Dependency>libplist</Dependency>
            <Dependency>libimobiledevice</Dependency>
            <Dependency versionFrom="1.4.1">pm-utils</Dependency>
            <Dependency>libusb</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="data">/lib</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="data">/etc/dbus-1</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="config">/etc/UPower</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="data">/var/lib/upower</Path>
            <Path fileType="data">/usr/share/gir-1.0</Path>
            <Path fileType="data">/usr/share/dbus-1</Path>
            <Path fileType="executable">/usr/libexec</Path>
            <Path fileType="data">/usr/share/polkit-1</Path>
            <Path fileType="localedata">/usr/share/locale</Path>
            <Path fileType="data">/usr/share/dbus-1/interfaces/*.xml</Path>
            <Path fileType="data">/usr/lib/girepository-1.0/*.typelib</Path>
        </Files>
    </Package>

    <Package>
        <Name>upower-devel</Name>
        Development files for upower
        <RuntimeDependencies>
            <Dependency release="current">upower</Dependency>
            <Dependency>dbus-devel</Dependency>
            <Dependency>glib2-devel</Dependency>
            <Dependency>polkit-devel</Dependency>
            <Dependency>dbus-glib-devel</Dependency>
            <Dependency>libgudev-devel</Dependency>
            <Dependency>libplist-devel</Dependency>
            <Dependency>libimobiledevice-devel</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="data">/usr/lib/pkgconfig</Path>
        </Files>
    </Package>

    <History>
        <Update release="4">
            <Date>2017-03-05</Date>
            <Version>0.99.4</Version>
            <Comment>Rebuild.</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="3">
            <Date>2017-03-02</Date>
            <Version>0.99.4</Version>
            <Comment>Rebuild for new toolchain.</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="3">
            <Date>2016-06-09</Date>
            <Version>0.99.4</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-05-18</Date>
            <Version>0.99.4</Version>
            <Comment>Version bump</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-26</Date>
            <Version>0.9.23</Version>
            <Comment>First release</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>upower</Name>
        Güç Yönetim Hizmeti
        <Description xml:lang="tr">upower, sisteme bağlı güç cihazlarını yönetmek için gerekli kitaplıkları ve sistem hizmetini sunar.</Description>
    </Source>

    <Package>
        <Name>upower-devel</Name>
        upower için geliştirme dosyaları
    </Package>
</PISI>


code:
<PISI>
    <Name>hardware.printer</Name>
</PISI>


code:
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools

def setup():
    pisitools.dosed("configure", "localstatedir/run/cups", "localstatedir/cups")
    #shelltools.system("./autogen.sh")
    autotools.configure("--sbindir=/usr/bin \
                         --localstatedir=/var \
                         --enable-dbus \
                         --with-rcdir=no \
                         --disable-static \
                         --with-gs-path=/usr/bin/gs \
                         --with-pdftops-path=/usr/bin/gs \
                         --docdir=/usr/share/doc/cups-filters-1.0.76 \
                         --with-browseremoteprotocols=DNSSD,CUPS ")
                         #--with-test-font-path=/usr/share/fonts/TTF/DejaVuSans.ttf")

    #pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")

def build():
    autotools.make("check")

#def check():
    #autotools.make("check")

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING", "README")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pardus.org.tr/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>cups-filters</Name>
        <Homepage>http://www.openprinting.org</Homepage>
        <Packager>
            <Name>Marcin Bojara</Name>
            <Email>marcin@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <License>GPLv3</License>
        <License>GPLv2+</License>
        <License>GPLv3+</License>
        <License>LGPLv2+</License>
        <License>MIT</License>
        <IsA>data</IsA>
        <IsA>library</IsA>
        <IsA>app:console</IsA>
        OpenPrinting CUPS filters and backends
        <Description>Contains backends, filters, and other software that was once part of the core CUPS distribution but is no longer maintained by Apple Inc. In addition it contains additional filters developed independently of Apple, especially filters for the PDF-centric printing workflow introduced by OpenPrinting.</Description>
       <Archive type="tarxz" sha1sum="352a16072f9f01057e1ea2a2ba119dc518082e1e">https://www.openprinting.org/download/cups-filters/cups-filters-1.17.9.tar.xz</Archive>
        <BuildDependencies>
            <Dependency>cups-devel</Dependency>
            <Dependency>glib2-devel</Dependency>
            <Dependency>tiff-devel</Dependency>
            <Dependency>lcms2-devel</Dependency>
            <Dependency>dbus-devel</Dependency>
            <Dependency>python-devel</Dependency>
            <Dependency>libpng-devel</Dependency>
            <Dependency>freetype-devel</Dependency>
            <Dependency>fontconfig-devel</Dependency>
            <Dependency>libjpeg-turbo-devel</Dependency>
            <Dependency>dejavu-fonts</Dependency>
            <Dependency>poppler-utils</Dependency>
            <Dependency>poppler-cpp-devel</Dependency>
            <Dependency>zlib-devel</Dependency>
            <Dependency>openldap-client</Dependency>
            <Dependency>avahi-devel</Dependency>
            <Dependency>avahi-glib-devel</Dependency>
            <Dependency versionFrom="5.1.3">qpdf-devel</Dependency>
            <Dependency versionFrom="9.15">ghostscript-devel</Dependency>
            <Dependency versionFrom="0.34.0">poppler-devel</Dependency>
            <Dependency>mupdf-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>cups-filters</Name>
        <RuntimeDependencies>
            <Dependency>cups</Dependency>
            <Dependency>dbus</Dependency>
            <Dependency>tiff</Dependency>
            <Dependency>zlib</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency>lcms2</Dependency>
            <Dependency>libgcc</Dependency>
            <Dependency>libpng</Dependency>
            <Dependency>fontconfig</Dependency>
            <Dependency>mit-kerberos</Dependency>
            <Dependency>libjpeg-turbo</Dependency>
            <Dependency versionFrom="5.1.3">qpdf</Dependency>
            <Dependency versionFrom="9.15">ghostscript</Dependency>
            <Dependency versionFrom="0.34.0">poppler</Dependency>
            <Dependency>e2fsprogs</Dependency>
            <Dependency>avahi-glib</Dependency>
            <Dependency>avahi-libs</Dependency>
            <Dependency>mupdf</Dependency>
            <Dependency>openldap-client</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="data">/usr/share/ppd</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="data">/usr/share/cups</Path>
            <Path fileType="config">/etc/cups/cups-browsed.conf</Path>
            <Path fileType="config">/etc/fonts/conf.d/99pdftoopvp.conf</Path>
        </Files>
    </Package>

    <Package>
        <Name>cups-filters-devel</Name>
        Cups-filters için geliştirme dosyaları
        <RuntimeDependencies>
            <Dependency release="current">cups-filters</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="library">/usr/lib/pkgconfig</Path>
        </Files>
    </Package>

    <History>
        <Update release="5">
            <Date>2017-12-13</Date>
            <Version>1.17.9</Version>
            <Comment>version bump.</Comment>
            <Name>Ayhan Yalçınsoy</Name>
            <Email>ayhanyalcinsoy@pisilinux.org</Email>
        </Update>
        <Update release="4">
            <Date>2017-07-13</Date>
            <Version>1.14.1</Version>
            <Comment>Version Bump</Comment>
            <Name>Kamil Atlı</Name>
            <Email>suvari@pisilinux.org</Email>
        </Update>
        <Update release="3">
            <Date>2017-03-21</Date>
            <Version>1.5.0</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.5.0</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-04-23</Date>
            <Version>1.5.0</Version>
            <Comment>First release</Comment>
            <Name>Alihan Öztürk</Name>
            <Email>alihan@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>cups-filters</Name>
        OpenPrinting CUPS filters and backends
        <Description xml:lang="en">Contains backends, filters, and other software that was once part of the core CUPS distribution but is no longer maintained by Apple Inc. In addition it contains additional filters developed independently of Apple, especially filters for the PDF-centric printing workflow introduced by OpenPrinting.</Description>
    </Source>

    <Package>
        <Name>cups-filters-devel</Name>
        Cups-filters için geliştirme dosyaları
        Development files for cups-filters
    </Package>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools

def setup():
    #pisitools.flags.add("-fstack-protector-all", "-DLDAP_DEPRECATED=1")
    pisitools.dosed("config-scripts/cups-sharedlibs.m4", "( -shared )", " -Wl,--as-needed\\1")

    # For --enable-avahi
    autotools.aclocal("-I config-scripts")
    autotools.autoconf("-I config-scripts")

    options = '--with-cups-user=daemon \
               --with-cups-group=lp \
               --with-system-groups=lpadmin \
               --with-docdir=/usr/share/cups/html \
               --with-dbusdir=/etc/dbus-1 \
               --with-optim="%s" \
               --with-php=/usr/bin/php-cgi \
               --with-cupsd-file-perm=0755 \
               --with-log-file-perm=0600 \
               --without-java \
               --enable-acl \
               --enable-ssl=yes \
               --enable-libpaper \
               --enable-debug \
               --enable-gssapi \
               --enable-dbus \
               --enable-pam=yes \
               --enable-relro \
               --enable-dnssd \
               --enable-browsing \
               --enable-threads \
               --enable-raw-printing \
               --enable-avahi \
               --disable-gnutls \
               --disable-launchd \
               --disable-libusb \
               --without-rcdir \
               --libdir=/usr/lib \
               --without-perl \
               --with-logdir=/var/log/cups \
               KRB5CONFIG=/usr/bin/krb5-config \
               --localstatedir=/var \
               --with-rundir=/run/cups \
               --with-xinetd=/etc/xinetd.d \
              ' % get.CFLAGS()

    if get.buildTYPE() == "emul32":
        options += '  \
                     --enable-libusb=no \
                     --disable-avahi \
                     --disable-dnssd \
                     --disable-gssapi \
                     --disable-dbus \
                     --bindir=/usr/bin32 \
                     --sbindir=/usr/sbin32 \
                     --libdir=/usr/lib32'

    autotools.configure(options)

def build():
    autotools.make()

#def check():
    #autotools.make("check")

def install():
    if get.buildTYPE() == "emul32":
        # SERVERBIN is hardcoded to /usr/lib/cups, thus it overwrites 64 bit libraries
        autotools.rawInstall("BUILDROOT=%s SERVERBIN=%s/usr/serverbin32 install-libs" % (get.installDIR(), get.installDIR()))
        pisitools.domove("/usr/bin32/cups-config", "/usr/bin", "cups-config-32bit")
        pisitools.removeDir("/usr/bin32")
        pisitools.removeDir("/usr/sbin32")
        pisitools.removeDir("/usr/serverbin32")

        # remove files now part of cups-filters
        #pisitools.remove("/usr/share/cups/data/testprint")
        pisitools.removeDir("/usr/share/cups/banners")
        pisitools.dodir("/usr/share/cups/banners")
        return

    autotools.rawInstall("BUILDROOT=%s install-headers install-libs install-data install-exec" % get.installDIR())
    shelltools.chmod("%s/run/cups/certs" % get.installDIR(), 0755)

    pisitools.dodir("/usr/share/cups/profiles")

    # Serial backend needs to run as root
    #shelltools.chmod("%s/usr/lib/cups/backend/serial" % get.installDIR(), 0700)

    pisitools.dodoc("LICENSE.txt")


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import re

ownerships = {
        "/run/cups"             : "root:lp",
        "/var/log/cups"         : "root:lp",
    }

CUPSD_CONFIG_FILE = "/etc/cups/cupsd.conf"

def postInstall(fromVersion, fromRelease, toVersion, toRelease):
    for directory,owners in ownerships.items():
        if os.path.exists(directory):
            os.system("chown %s %s" % (owners, directory))

    # Replace possible pnpadmin leftover from cupsd.conf
    if os.path.exists(CUPSD_CONFIG_FILE):
        cupsd = open(CUPSD_CONFIG_FILE, "r").read()
        open(CUPSD_CONFIG_FILE, "w").write(re.sub("pnpadmin", "lpadmin", cupsd))


code:
from comar.service import *
import os

serviceType = "server"
serviceDefault = "on"
serviceDesc = _({"en": "CUPS Printer Server",
                 "tr": "CUPS Yazıcı Sunucusu"})
serviceConf = "cups"

PIDFILE = "/run/cups/cupsd.pid"

@synchronized
def start():
    # FIXME: After avahi before hal
    # startDependencies("avahi")

    # Load ppdev and lp drivers if wanted
    if config.get("LOAD_LP_MODULE") == "yes":
        os.system("/sbin/modprobe -q lp")
        os.system("/sbin/modprobe -q ppdev")

    startService(command="/usr/sbin/cupsd",
                 donotify=True)
    os.system("pidof -o %PPID /usr/sbin/cupsd > " + PIDFILE)

    # Tell udevd to replay printer events
    # One for low-level usb
    os.system("udevadm trigger --subsystem-match=usb \
                               --attr-match=bInterfaceClass=07 \
                               --attr-match=bInterfaceSubClass=01 \
                               --action=add")
    # One for usblp backend
    os.system("udevadm trigger --subsystem-match=usb \
                               --property-match=DEVNAME=\"/dev/usb/lp*\" \
                               --action=add")

@synchronized
def reload():
    if os.path.exists(PIDFILE):
        # 1 is SIGHUP
        os.kill(int(open(PIDFILE, "r").read().strip()), 1)

@synchronized
def stop():
    stopService(pidfile=PIDFILE, donotify=True)
    if os.path.isfile(PIDFILE): os.unlink(PIDFILE)

def status():
    return isServiceRunning(pidfile=PIDFILE)


code:
diff -up cups-1.5b1/config-scripts/cups-ssl.m4.no-export-ssllibs cups-1.5b1/config-scripts/cups-ssl.m4
--- cups-1.6.2/config-scripts/cups-ssl.m4.no-export-ssllibs	2011-05-11 02:52:08.000000000 +0200
+++ cups-1.6.2/config-scripts/cups-ssl.m4	2011-05-23 17:47:27.000000000 +0200
@@ -180,7 +180,7 @@
 AC_SUBST(SSLFLAGS)
 AC_SUBST(SSLLIBS)

-EXPORT_SSLLIBS="$SSLLIBS"
+EXPORT_SSLLIBS=""
 AC_SUBST(EXPORT_SSLLIBS)

 dnl


code:
diff -up cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man cups-1.5b1/config-scripts/cups-manpages.m4
--- cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man	2011-05-12 07:21:56.000000000 +0200
+++ cups-1.5b1/config-scripts/cups-manpages.m4	2011-05-23 17:25:50.000000000 +0200
@@ -69,10 +69,10 @@ case "$uname" in
 		;;
 	Linux* | GNU* | Darwin*)
 		# Linux, GNU Hurd, and macOS
-		MAN1EXT=1.gz
-		MAN5EXT=5.gz
-		MAN7EXT=7.gz
-		MAN8EXT=8.gz
+		MAN1EXT=1
+		MAN5EXT=5
+		MAN7EXT=7
+		MAN8EXT=8
 		MAN8DIR=8
 		;;
 	*)


code:
/var/log/cups/*_log {
    missingok
    notifempty
    sharedscripts
}


code:
Description: Applications could not get the PPD file for
 statically-configured IPP-shared print queues
Author: Till Kamppeter <till.kamppeter@gmail.com>
Bug-Upstream: http://cups.org/str.php?L4178
Last-Updated: 2012-09-19

--- a/cups/util.c
+++ b/cups/util.c
@@ -1731,6 +1731,22 @@

       return (1);
     }
+    else if (device_uri &&
+	     (!strncmp(device_uri, "ipp:", 4) != NULL ||
+	      !strncmp(device_uri, "ipps:", 5) != NULL))
+    {
+     /*
+      * Statically-configured IPP shared printer.
+      */
+
+      httpSeparateURI(HTTP_URI_CODING_ALL,
+                      device_uri,
+                      scheme, sizeof(scheme), username, sizeof(username),
+		      host, hostsize, port, resource, resourcesize);
+      ippDelete(response);
+
+      return (1);
+    }
     else if ((attr = ippFindAttribute(response, "member-uris",
                                       IPP_TAG_URI)) != NULL)
     {