File eject.spec of Package eject

#
# spec file for package eject
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           eject
BuildRequires:  automake
BuildRequires:  recode
BuildRequires:  sg3_utils-devel
Url:            http://eject.sourceforge.net/
Summary:        A Program to Eject Media under Software Control
License:        GPL-2.0+
Group:          System/Base
Version:        2.1.0
Release:        0
Source:         %{name}-%{version}.tar.bz2
Patch1:         %{name}-%{version}-subfs.diff
Patch3:         %{name}-%{version}-scsi.diff
Patch4:         %{name}-%{version}-po-cleanup.diff
Patch5:         %{name}-%{version}-prototypes.diff
Patch6:         %{name}-%{version}-toggle.diff
Patch7:         %{name}-%{version}-status.diff
Patch8:         %{name}-%{version}-umount.diff
# PATCH-FIX-SUSE fix segfault when unmounting (bnc#716644)
Patch9:         eject-2.1.0-regfree_segfault.patch
PreReq:         permissions
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Eject allows removable media (typically a CD-ROM, floppy disk, tape, or
JAZ or ZIP disk) to be ejected under software control. The command can
also control some multidisc CD-ROM changers, the autoeject feature
supported by some devices, and close the disc tray of some CD-ROM
drives.

%prep
%setup -q
%patch1
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9 -p1

%build
export CFLAGS="%optflags -fpie"
export LDFLAGS="-pie  -Wl,-z,relro,-z,now"
aclocal
automake -a
autoconf
%configure --enable-default-device=/dev/cdrom
make %{?_smp_mflags}

%install
make install DESTDIR=$RPM_BUILD_ROOT
#UsrMerge
mkdir -p $RPM_BUILD_ROOT/bin
ln -sf %{_bindir}/eject $RPM_BUILD_ROOT/bin
#EndUsrMerge
%find_lang %{name}

%post
%set_permissions %{_bindir}/eject

%verifyscript
%verify_permissions -e %{_bindir}/eject

%files -f %{name}.lang
%defattr(-,root,root)
%doc README COPYING ChangeLog TODO PORTING
%doc %{_mandir}/man?/*
%verify(not mode) %attr(4750,root,audio) %{_bindir}/eject
%{_bindir}/*
#UsrMerge
/bin/eject
#EndUsrMerge

%changelog
openSUSE Build Service is sponsored by