Skip to content

Instantly share code, notes, and snippets.

@ilya-fedin ilya-fedin/PKGBUILD
Created Apr 15, 2018

Embed
What would you like to do?
uswsusp-git
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: cantabile <cantabile dot desu at gmail dot com>
pkgname=uswsusp-git
pkgver=0.r501.g668c5f7
pkgrel=9
pkgdesc='Userspace software suspend - git checkout'
arch=('i686' 'x86_64')
url='http://suspend.sourceforge.net/'
license=('GPL')
depends=('libx86' 'lzo' 'pciutils')
makedepends=('git')
provides=('uswsusp')
conflicts=('uswsusp')
backup=('etc/suspend.conf')
install=uswsusp.install
source=('git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git'
'uresume-hook'
'uresume-install'
'sd-uresume'
'uresume.service'
'print-no-version.patch'
'load-checksum-mismatch.patch'
'no-deprecated-switch.patch'
'no-inline.patch')
sha256sums=('SKIP'
'2662d879ca7a2339233c8bdce123f0d686397093759ca54f162a3577603587b0'
'9fe3e38301014b4c8597aec2041ad3c6d85e6935004cbd3ac93659d391db3157'
'52b80b4ae49c1ada553c4e38a083992b28f0f43a423b8d814a5c81b39f683154'
'a23a3398bb6e863e969f245efd07f819ef31e99f40ee68786431fb0c8d03c3a6'
'cdf29e41f35469b134bb6421ba109e8398e1f3e88ec4e1d41b015920e420ee44'
'fe8d5c831302125fd92ba6e48cacaf0359925d41de5623be2b8525a0cdf1fcc6'
'd8a4f646d0785adf038830f14564f20ea307a27f225c17eb581a2e4d5e0c8519'
'fc303c78d3ae0794f8a267e9b8b9fec665b7413f396310d1a19efedcd2a1760d')
pkgver() {
cd suspend-utils/
if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
echo "$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG}).r$(git rev-list --count ${GITTAG}..).g$(git log -1 --format="%h")"
else
echo "0.r$(git rev-list --count master).g$(git log -1 --format="%h")"
fi
}
build() {
cd suspend-utils/
patch -Np1 < "${srcdir}/print-no-version.patch"
patch -Np1 < "${srcdir}/load-checksum-mismatch.patch"
patch -Np1 < "${srcdir}/no-deprecated-switch.patch"
patch -Np1 < "${srcdir}/no-inline.patch"
sed -i "s/^AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" configure.ac
mkdir m4
./autogen.sh
# This code includes references to deprecaded API in libgcrypt. Finally
# it has been removed from libgcrypt 1.6.0.
# For the time being encrypt support is disabled. To reenable add
# --enable-encrypt below and fix the code.
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--enable-compress \
--enable-threads \
--disable-resume-static \
--disable-static \
--sysconfdir=/etc
make
}
package() {
cd suspend-utils/
mkdir "${pkgdir}/etc"
make DESTDIR="${pkgdir}/" install
install -D -m0644 "${srcdir}/uresume-hook" "${pkgdir}/usr/lib/initcpio/hooks/uresume"
install -D -m0644 "${srcdir}/uresume-install" "${pkgdir}/usr/lib/initcpio/install/uresume"
install -D -m0644 "${srcdir}/sd-uresume" "${pkgdir}/usr/lib/initcpio/install/sd-uresume"
install -D -m0644 "${srcdir}/uresume.service" "${pkgdir}/usr/lib/systemd/system/uresume.service"
mkdir -p "${pkgdir}/usr/lib/systemd/sysinit.target.wants"
ln -s "../uresume.service" "${pkgdir}/usr/lib/systemd/sysinit.target.wants/uresume.service"
}
# vim:set ft=sh:
build () {
add_binary /usr/lib/suspend/resume
add_file /etc/suspend.conf
add_file /usr/lib/systemd/system/uresume.service
add_symlink /usr/lib/systemd/system/sysinit.target.wants/uresume.service
}
help () {
cat <<HELPEOF
This hook initializes support for resuming from Disk.
Supports uswsusp.
HELPEOF
}
[Unit]
Description=Userspace Software Suspend - Resume Service
DefaultDependencies=no
Wants=local-fs-pre.target
Before=local-fs-pre.target
[Service]
Type=oneshot
ExecStart=/usr/lib/suspend/resume
[Install]
WantedBy=sysinit.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.