mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-13 19:49:03 +08:00
Rebuilding eject, also adding a patch from Gentoo.
This commit is contained in:
parent
6ad424911e
commit
ed16d9d5b1
@ -1,22 +1,41 @@
|
|||||||
# $Id: PKGBUILD 30403 2009-03-19 06:32:31Z eric $
|
#
|
||||||
# Maintainer: dorphell <dorphell@archlinux.org>
|
# Chakra Packages for Chakra, part of chakra-project.org
|
||||||
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
|
#
|
||||||
|
# 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
|
pkgname=eject
|
||||||
pkgver=2.1.5
|
pkgver=2.1.5
|
||||||
pkgrel=4
|
pkgrel=5
|
||||||
pkgdesc="Eject is a program for ejecting removable media under software control"
|
pkgdesc="Eject is a program for ejecting removable media under software control."
|
||||||
arch=(i686 x86_64)
|
arch=('i686' 'x86_64')
|
||||||
url="http://ca.geocities.com/jefftranter@rogers.com/eject.html"
|
url="http://eject.sourceforge.net/"
|
||||||
license=('GPL')
|
license=('GPL')
|
||||||
depends=('glibc')
|
depends=('glibc')
|
||||||
source=(http://launchpad.net/eject/main/2.1.5/+download/$pkgname-$pkgver.tar.gz eject-2.1.5-handle-spaces.patch)
|
source=("http://chakra.sourceforge.net/sources/${pkgname}/${pkgname}-${pkgver}.tar.gz"
|
||||||
md5sums=('74299e7293f0a007a139fe61d23aea90' '595b97c3bd56fd41e3b01b07885f81dc')
|
'gentoo-2.1.5-toggle.patch')
|
||||||
|
md5sums=('63c52a4debf84f718d61684e2aff1b20'
|
||||||
|
'177cba21a4c66be4956ded46550573c1')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd $srcdir/$pkgname-$pkgver
|
cd "${srcdir}/${pkgname}"
|
||||||
patch -Np0 -i $srcdir/eject-2.1.5-handle-spaces.patch || return 1
|
|
||||||
./configure --prefix=/usr --mandir=/usr/share/man || return 1
|
# Patch adapted from the original Gentoo one
|
||||||
make || return 1
|
patch -Np1 -i "${srcdir}/gentoo-2.1.5-toggle.patch"
|
||||||
make DESTDIR=$pkgdir install || return 1
|
|
||||||
|
# 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:
|
||||||
|
25
eject/gentoo-2.1.5-toggle.patch
Normal file
25
eject/gentoo-2.1.5-toggle.patch
Normal 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
|
Loading…
Reference in New Issue
Block a user