1 # Maintainer: Tom < reztho at archlinux dot org >
5 pkgdesc="Daemon that performs monitoring and adaptive configuration of devices in the system"
7 url="https://fedorahosted.org/tuned/"
9 depends=('python2' 'ethtool')
12 backup=('etc/tuned.conf')
15 _gitroot='git://git.fedorahosted.org/git/tuned'
20 msg "Connecting to GIT server...."
22 if [[ -d "$_gitname" ]]; then
23 cd "$_gitname" && git pull origin
24 msg "The local files are updated."
26 git clone "$_gitroot" "$_gitname"
29 msg "GIT checkout done or server timeout"
30 msg "Starting build..."
32 rm -rf "$srcdir/$_gitname-build"
33 git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
34 cd "$srcdir/$_gitname-build"
38 cd "$srcdir/$_gitname-build"
39 make DESTDIR="$pkgdir/" install
41 # Patching for using python2
42 find "${pkgdir}/usr/sbin/" -type f -exec sed -i 's@#!/usr/bin/python@#!/usr/bin/python2@' {} \;
44 # Patching for making tuned to use /var/run/tuned.pid
45 sed -i 's@/var/run/tuned/tuned.pid@/var/run/tuned.pid@' "${pkgdir}/usr/share/tuned/tuned.py"
47 # Installing default config
48 install -m644 "${pkgdir}/etc/tune-profiles/default/tuned.conf" "${pkgdir}/etc/tuned.conf"
50 # Changing the config file for enabling net tuning
51 sed -i 's@^enabled=False$@# enabled=False@' "${pkgdir}/etc/tuned.conf"
53 msg "Removing some directories and files..."
54 rm -vrf "${pkgdir}/etc/bash_completion.d"
55 rm -vrf "${pkgdir}/etc/security"
56 rm -vrf "${pkgdir}/etc/sysconfig"
57 rm -vrf "${pkgdir}/etc/ktune.d"
58 rm -vrf "${pkgdir}/etc/rc.d"
59 rm -vrf "${pkgdir}/etc/pam.d"
60 rm -vrf "${pkgdir}/etc/tune-profiles"
61 rm -vrf "${pkgdir}/var"
62 rm -vrf "${pkgdir}/usr/bin"
63 rm -vrf "${pkgdir}/usr/libexec"
64 rm -vrf "${pkgdir}/usr/share/man/man1"
65 rm -vrf "${pkgdir}/lib"
66 rm -v "${pkgdir}/usr/share/tuned/tuned_adm.py"
67 find "${pkgdir}/usr/sbin/" -type f ! -iname 'tuned' -exec rm -v {} \;
68 find "${pkgdir}/usr/share/man/man8/" -type f ! -iname 'tuned.*' -exec rm -v {} \;
69 find "${pkgdir}/usr/sbin/" -iname '*stat' -exec rm -v {} \;
71 # Installing the rc daemon script
72 install -Dm755 "${srcdir}/tuned_rc" "${pkgdir}/etc/rc.d/tuned"
75 # vim:set ts=2 sw=2 et:
76 md5sums=('9b923835672995412c93f88cd963081c')