updated on Tue Jan 17 12:00:36 UTC 2012
[aur-mirror.git] / tuned-git / PKGBUILD
blob3bd2dd8e3a1a62956b4ccfa42a3c7cd2718ca7d5
1 # Maintainer: Tom < reztho at archlinux dot org >
2 pkgname=tuned-git
3 pkgver=20111008
4 pkgrel=1
5 pkgdesc="Daemon that performs monitoring and adaptive configuration of devices in the system"
6 arch=('any')
7 url="https://fedorahosted.org/tuned/"
8 license=('GPL')
9 depends=('python2' 'ethtool')
10 makedepends=('git')
11 provides=('tuned')
12 backup=('etc/tuned.conf')
13 source=('tuned_rc')
15 _gitroot='git://git.fedorahosted.org/git/tuned'
16 _gitname='tuned'
18 build() {
19   cd "$srcdir"
20   msg "Connecting to GIT server...."
22   if [[ -d "$_gitname" ]]; then
23     cd "$_gitname" && git pull origin
24     msg "The local files are updated."
25   else
26     git clone "$_gitroot" "$_gitname"
27   fi
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"
37 package() {
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"
46   
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 {} \;
70   
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')