Rebuilding eject, also adding a patch from Gentoo.

This commit is contained in:
Daniele 2011-12-30 02:48:32 +00:00
parent 6ad424911e
commit ed16d9d5b1
2 changed files with 58 additions and 14 deletions

View File

@ -1,22 +1,41 @@
# $Id: PKGBUILD 30403 2009-03-19 06:32:31Z eric $
# Maintainer: dorphell <dorphell@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=eject
pkgver=2.1.5
pkgrel=4
pkgdesc="Eject is a program for ejecting removable media under software control"
arch=(i686 x86_64)
url="http://ca.geocities.com/jefftranter@rogers.com/eject.html"
pkgrel=5
pkgdesc="Eject is a program for ejecting removable media under software control."
arch=('i686' 'x86_64')
url="http://eject.sourceforge.net/"
license=('GPL')
depends=('glibc')
source=(http://launchpad.net/eject/main/2.1.5/+download/$pkgname-$pkgver.tar.gz eject-2.1.5-handle-spaces.patch)
md5sums=('74299e7293f0a007a139fe61d23aea90' '595b97c3bd56fd41e3b01b07885f81dc')
source=("http://chakra.sourceforge.net/sources/${pkgname}/${pkgname}-${pkgver}.tar.gz"
'gentoo-2.1.5-toggle.patch')
md5sums=('63c52a4debf84f718d61684e2aff1b20'
'177cba21a4c66be4956ded46550573c1')
build() {
cd $srcdir/$pkgname-$pkgver
patch -Np0 -i $srcdir/eject-2.1.5-handle-spaces.patch || return 1
./configure --prefix=/usr --mandir=/usr/share/man || return 1
make || return 1
make DESTDIR=$pkgdir install || return 1
cd "${srcdir}/${pkgname}"
# Patch adapted from the original Gentoo one
patch -Np1 -i "${srcdir}/gentoo-2.1.5-toggle.patch"
# Ensure the project has been properly bootstrapped
[ ! -x ./configure ] && ./bootstrap
./configure --prefix=/usr --mandir=/usr/share/man
make
}
package() {
cd "${srcdir}/${pkgname}"
make DESTDIR="${pkgdir}" install
}
# vim:set ts=2 sw=2 et:

View File

@ -0,0 +1,25 @@
diff -Naur a/eject.c b/eject.c
--- a/eject.c 2011-12-30 02:44:09.786560448 +0000
+++ b/eject.c 2011-12-30 02:45:10.322889868 +0000
@@ -610,6 +610,21 @@
#ifdef CDROMCLOSETRAY
+ /* Ask the CDROM for info, otherwise fall back to manual */
+ switch (ioctl(fd, CDROM_DRIVE_STATUS)) {
+ case CDS_TRAY_OPEN:
+ CloseTray(fd);
+ return;
+
+ case CDS_NO_DISC:
+ case CDS_DISC_OK:
+ if (ioctl(fd, CDROMEJECT, 0) < 0) {
+ perror("ioctl");
+ exit(1);
+ }
+ return;
+ }
+
/* Try to open the CDROM tray and measure the time needed.
* In my experience the function needs less than 0.05
* seconds if the tray was already open, and at least 1.5 seconds