summaryrefslogtreecommitdiff
path: root/community/preload
diff options
context:
space:
mode:
Diffstat (limited to 'community/preload')
-rw-r--r--community/preload/PKGBUILD26
-rw-r--r--community/preload/rc.d97
-rw-r--r--community/preload/service2
3 files changed, 11 insertions, 114 deletions
diff --git a/community/preload/PKGBUILD b/community/preload/PKGBUILD
index 106b1f7b3..90b88459f 100644
--- a/community/preload/PKGBUILD
+++ b/community/preload/PKGBUILD
@@ -1,50 +1,44 @@
-# $Id: PKGBUILD 74711 2012-08-02 09:27:00Z bpiotrowski $
+# $Id: PKGBUILD 90536 2013-05-13 00:33:46Z eric $
# Maintainer:
# Contributor: Jaroslaw Swierczynski <swiergot@aur.archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>
pkgname=preload
pkgver=0.6.4
-pkgrel=5
+pkgrel=6
arch=('i686' 'x86_64' 'mips64el')
pkgdesc="Makes applications run faster by prefetching binaries and shared objects"
url="http://sourceforge.net/projects/preload"
license=('GPL2')
depends=('glib2' 'bash')
-makedepends=('help2man' 'pkgconfig')
+makedepends=('help2man')
backup=('etc/preload.conf')
options=('!makeflags')
install=$pkgname.install
source=("http://downloads.sourceforge.net/sourceforge/preload/$pkgname-$pkgver.tar.gz"
- rc.d service)
+ service)
md5sums=('10786287b55afd3a2b433b4f898809f4'
- 'bde0dd7867c77e7c4d10b481b5cddcd3'
- 'db9350ab52fd643edbc88ebab2c8c1bb')
+ 'b4871a6ade86968322b3bdf3fce88e99')
build() {
- cd "${srcdir}"/$pkgname-$pkgver
+ cd $pkgname-$pkgver
./configure --prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
+ --sbindir=/usr/bin \
--localstatedir=/var
make
}
package() {
- cd "${srcdir}"/$pkgname-$pkgver
- make DESTDIR="${pkgdir}" install
+ cd $pkgname-$pkgver
+ make DESTDIR="${pkgdir}" sysconfigdir=/etc/conf.d install
- install -Dm755 "${srcdir}"/rc.d "${pkgdir}"/etc/rc.d/preload
install -Dm644 "${srcdir}"/service "${pkgdir}"/usr/lib/systemd/system/preload.service
- rm -rf "${pkgdir}"/etc/rc.d/init.d
-
+ rm -rf "${pkgdir}"/etc/rc.d
rm -rf "${pkgdir}"/var/lib/preload/preload.state
rm -rf "${pkgdir}"/var/log/preload.log
- install -d "${pkgdir}"/etc/conf.d
- mv "${pkgdir}"/etc/sysconfig/* "${pkgdir}"/etc/conf.d
- rm -rf "${pkgdir}"/etc/sysconfig
-
sed -r -i 's#^((map|exe)prefix =) (.+)$#\1 /opt;\3#' "${pkgdir}"/etc/preload.conf
}
diff --git a/community/preload/rc.d b/community/preload/rc.d
deleted file mode 100644
index a3cb01ba0..000000000
--- a/community/preload/rc.d
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/bash
-#
-# /etc/rc.d/init.d/preload
-#
-# Starts the preload daemon
-#
-# Heavily modified for Arch Linux by Leslie P. Polzer <polzer@gnu.org>.
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-
-PID=`pidof -o %PPID /usr/sbin/preload`
-
-if [ -f /etc/conf.d/preload ]; then
- . /etc/conf.d/preload
-fi
-
-MIN_MEMORY=${MIN_MEMORY:-256}
-# Check for > MIN_MEMORY MB
-free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
-
-RETVAL=0
-
-#
-# See how we were called.
-#
-
-start() {
- if [ -z "$PID" ]; then
- stat_busy "Starting preload daemon: "
- /usr/sbin/preload $PRELOAD_OPTS
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
- if [ -n $IONICE_OPTS ]; then
- /usr/bin/ionice $IONICE_OPTS -p "`pidof -o %PPID /usr/sbin/preload`"
- fi
- add_daemon preload
- stat_done
- else
- stat_fail
- fi
- fi
- return $RETVAL
-}
-
-stop() {
- stat_busy "Stopping preload daemon: "
- kill $PID &>/dev/null
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
- rm_daemon preload
- stat_done
- PID=""
- else
- stat_fail
- fi
- return $RETVAL
-}
-
-
-restart() {
- $0 stop
- sleep 1
- $0 start
-}
-
-reload() {
- trap "" SIGHUP
- kill -HUP $PID
-}
-
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- reload)
- reload
- ;;
- restart)
- restart
- ;;
- condrestart)
- if [ ! -z $PID ]; then
- restart
- else
- stat_fail
- fi
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|condrestart|reload}"
- exit 1
-esac
-
-exit $RETVAL
diff --git a/community/preload/service b/community/preload/service
index e4202751f..a26e2d01b 100644
--- a/community/preload/service
+++ b/community/preload/service
@@ -5,7 +5,7 @@ Description=Adaptive readahead daemon
Type=simple
IOSchedulingClass=3
EnvironmentFile=/etc/conf.d/preload
-ExecStart=/usr/sbin/preload --foreground $PRELOAD_OPTS
+ExecStart=/usr/bin/preload --foreground $PRELOAD_OPTS
[Install]
WantedBy=multi-user.target