aboutsummaryrefslogtreecommitdiff
path: root/base/power/power.build
blob: f8a82157908fe0614d5190ac5970bc802d181890 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
#
# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd>

source /usr/src/ports/Build/build.sh

NAME=power
VERSION=0.9.19
BUILD=2
DEPENDS=('glib >= 2.34.3-1' 'dbus_glib >= 0.100.2-1' 'udev >= 173-1' 'polkit >= 0.105-1' 'usb >= 1.0.14-1')

# Description

cat > ${PKG}/install/slack-desc <<EOF
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.

$(padd)|-----handy-ruler------------------------------------------------------|
${NAME}: upower
${NAME}:
${NAME}: An abstraction for enumerating power devices, listening to device
${NAME}: events and querying history and statistics. Any application or
${NAME}: service on the system can access the org.freedesktop.UPower service
${NAME}: via the system message bus. Some operations (such as suspending the
${NAME}: system) are restricted using polkit. UPower is also useful to control
${NAME}: the latency of different operations on your computer, which enables
${NAME}: you to save significant amounts of power.
${NAME}:
${NAME}: Homepage: http://upower.freedesktop.org
EOF

cat >> ${PKG}/install/doinst.sh <<EOF
#!/bin/sh

config() {
  NEW="\$1"
  OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r \$OLD ]; then
    mv \$NEW \$OLD
  elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
    # toss the redundant copy
    rm \$NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/UPower/UPower.conf.new
EOF

# Sources

SRCNAME[0]=upower
SRCVERS[0]=${VERSION}
SRCPACK[0]=http://upower.freedesktop.org/releases/${SRCNAME[0]}-${SRCVERS[0]}.tar.xz
SRCCOPY[0]="GPL2"

build0()
{
sed -i 's|$(libdir)/pkgconfig|$(datarootdir)/pkgconfig|g' Makefile.in
sed -i 's|$(slashlibdir)/udev/rules.d|$(datarootdir)/udev/rules|g' rules/Makefile.in
CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \
./configure \
 --build="${ARCH}-slackware-linux" \
 --disable-dependency-tracking \
 --disable-silent-rules \
 --disable-rpath \
 --enable-static=no \
 --enable-shared=yes \
 --enable-introspection=no \
 --enable-man-pages=no \
 --prefix="${SYS_DIR[usr]}" \
 --mandir="${SYS_DIR[man]}" \
 --sysconfdir="${SYS_DIR[etc]}" \
 --libdir="${SYS_DIR[lib]}" \
 --libexecdir="${SYS_DIR[lib]}/exec" \
 --localstatedir="${SYS_DIR[var]}" \
 --with-html-dir="${SYS_DIR[html]}" \
 --with-systemdsystemunitdir="${SYS_DIR[systemdsystemunitdir]}" \
 --with-backend=linux
#FIXME: systemd
make ${JOBS} V=1
make install DESTDIR="${PKG}"
doc AUTHORS
changelog NEWS
config ${PKG}${SYS_DIR[etc]}/UPower/UPower.conf
}

SRCNAME[1]=cpufrequtils
SRCVERS[1]=008
SRCPACK[1]=http://www.kernel.org/pub/linux/utils/kernel/cpufreq/${SRCNAME[1]}-${SRCVERS[1]}.tar.bz2
SRCCOPY[1]="GPL2"

build1()
{
make ${JOBS} \
 V="true" \
 PROC="false" \
 OPTIMIZATION="${FLAGS}"
make install DESTDIR="${PKG}" libdir="${SYS_DIR[lib]}"
doc AUTHORS
rm -f ${PKG}${SYS_DIR[lib]}/*.a
}

SRCNAME[2]=pm-utils
SRCVERS[2]=1.4.1
SRCPACK[2]=http://pm-utils.freedesktop.org/releases/${SRCNAME[2]}-${SRCVERS[2]}.tar.gz
SRCCOPY[2]="GPL2"

PMUTILSLIBDIR=${SYS_DIR[share]}/pm-utils

build2()
{
sed -i 's|$(libdir)/pkgconfig|$(datarootdir)/pkgconfig|g' Makefile.in
CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \
./configure \
 --build="${ARCH}-slackware-linux" \
 --disable-dependency-tracking \
 --prefix="${SYS_DIR[usr]}" \
 --mandir="${SYS_DIR[man]}" \
 --sysconfdir="${SYS_DIR[etc]}" \
 --libdir="${SYS_DIR[share]}" \
 --localstatedir="${SYS_DIR[var]}" \
 --docdir="${SYS_DIR[doc]}/${SRCNAME[2]}-${SRCVERS[2]}"
make ${JOBS}
make install DESTDIR="${PKG}"
doc AUTHORS README.SLACKWARE
changelog ChangeLog
rm -f ${PKG}${PMUTILSLIBDIR}/{sleep.d/55NetworkManager,power.d/{harddrive,disable_wol,hal-cd-polling}}
}

SRCNAME[3]=pm-quirks
SRCVERS[3]=20100619
SRCPACK[3]=http://pm-utils.freedesktop.org/releases/${SRCNAME[3]}-${SRCVERS[3]}.tar.gz
SRCROOT[3]=video-quirks

build3()
{
install.dir ${PKG}${PMUTILSLIBDIR}/video-quirks
install.dat *.quirkdb ${PKG}${PMUTILSLIBDIR}/video-quirks
}