forked from pool/hdparm
Marcus Meissner
f78bbe3ebc
- update to version 9.48 * 9.48 - fixed a number of output bugs due to the devslp patch * 9.47 - added devslp patch (IDENTIFY word 76) from David Woodhouse. - help and manpage fixes from Michal Minar. * 9.46 - fix compilation with "musl libc". - added "hex:aabbcc.." for binary security passwords. - return EIO when read_big_block() fails - use llabs() rather than abs() in identify.c - use spec-cleaner OBS-URL: https://build.opensuse.org/request/show/313426 OBS-URL: https://build.opensuse.org/package/show/Base:System/hdparm?expand=0&rev=80
123 lines
4.1 KiB
RPMSpec
123 lines
4.1 KiB
RPMSpec
#
|
|
# spec file for package hdparm
|
|
#
|
|
# Copyright (c) 2015 SUSE LINUX 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/
|
|
#
|
|
|
|
|
|
%{!?_udevdir: %global _udevdir %(pkg-config --variable=udevdir udev) }
|
|
%{!?_udevrulesdir: %global _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d }
|
|
Name: hdparm
|
|
Version: 9.48
|
|
Release: 0
|
|
Summary: A Program to get and set hard disk parameters
|
|
License: SUSE-Permissive
|
|
Group: Hardware/Other
|
|
Url: http://sourceforge.net/projects/hdparm/
|
|
Source: http://downloads.sf.net/hdparm/%{name}-%{version}.tar.gz
|
|
Source1: 56-idedma.rules
|
|
Source2: sysconfig.ide
|
|
Source3: udev.idedma.sh
|
|
Patch1: hdparm-nostrip.patch
|
|
Patch2: hdparm-wiper-warn.patch
|
|
Patch3: hdparm-leak-fix.patch
|
|
Patch4: hdparm-9.43-fix-bashisms.patch
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: pkgconfig(udev)
|
|
Requires(post): %fillup_prereq coreutils
|
|
Provides: base:/sbin/hdparm
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%description
|
|
A shell utility to access and tune the ioctl features of the Linux IDE
|
|
driver and IDE drives.
|
|
|
|
%prep
|
|
%setup -q
|
|
%patch1
|
|
%patch2 -p1
|
|
%patch3
|
|
%patch4 -p1
|
|
|
|
%build
|
|
make %{?_smp_mflags} CFLAGS="%{optflags} -Wall -Wstrict-prototypes" LDFLAGS= CC="gcc"
|
|
cp -p wiper/README.txt README.wiper
|
|
|
|
%install
|
|
mkdir -p "%{buildroot}%{_mandir}/man8"
|
|
install -d "%{buildroot}/%{_sbindir}"
|
|
%make_install binprefix="%{_prefix}"
|
|
mv contrib/README contrib/README.contrib
|
|
install -d "%{buildroot}/%{_udevrulesdir}"
|
|
install -m 644 %{SOURCE1} "%{buildroot}/%{_udevrulesdir}"
|
|
install -d "%{buildroot}%{_localstatedir}/adm/fillup-templates"
|
|
install -m 644 %{SOURCE2} "%{buildroot}%{_localstatedir}/adm/fillup-templates"
|
|
install -m 755 %{SOURCE3} "%{buildroot}/%{_udevdir}/idedma.sh"
|
|
install -d "%{buildroot}%{_libexecdir}/hdparm"
|
|
install -m 755 contrib/idectl "%{buildroot}%{_libexecdir}/hdparm"
|
|
install -m 755 contrib/ultrabayd "%{buildroot}%{_libexecdir}/hdparm"
|
|
install -m 755 wiper/wiper.sh "%{buildroot}/%{_sbindir}"
|
|
#UsrMerge
|
|
mkdir -p "%{buildroot}/sbin"
|
|
ln -sf %{_sbindir}/wiper.sh "%{buildroot}/sbin"
|
|
ln -sf %{_sbindir}/hdparm "%{buildroot}/sbin"
|
|
#EndUsrMerge
|
|
|
|
%post
|
|
if [ -f etc/sysconfig/hardware ] ; then
|
|
mv etc/sysconfig/hardware etc/sysconfig/ide
|
|
fi
|
|
%{remove_and_set -n ide DEVICES_FORCE_IDE_DMA_ON DEVICES_FORCE_IDE_DMA_OFF}
|
|
%{fillup_only -n ide}
|
|
# new settings
|
|
NEW_DMA=""
|
|
# convert old settings
|
|
if [ "$DEVICES_FORCE_IDE_DMA_ON" != "" -a "$DEVICES_FORCE_IDE_DMA_ON" != "no" ] ; then
|
|
for dev in $DEVICES_FORCE_IDE_DMA_ON; do
|
|
NEW_DMA="${NEW_DMA:+$NEW_DMA }/dev/$dev:on"
|
|
done
|
|
fi
|
|
if [ "$DEVICES_FORCE_IDE_DMA_OFF" != "" -a "$DEVICES_FORCE_IDE_DMA_OFF" != "no" ] ; then
|
|
for dev in $DEVICES_FORCE_IDE_DMA_OFF; do
|
|
NEW_DMA="${NEW_DMA:+$NEW_DMA }/dev/$dev:off"
|
|
done
|
|
fi
|
|
# update sysconfig file
|
|
if [ "$NEW_DMA" != "" ] ; then
|
|
echo "Updating etc/sysconfig/ide"
|
|
# remove old values, update new variable
|
|
sed -e "s|^DEVICES_FORCE_IDE_DMA=\"\\(.*\\)\"|DEVICES_FORCE_IDE_DMA=\"$NEW_DMA \\1\"|" \
|
|
etc/sysconfig/ide > etc/sysconfig/ide.new \
|
|
&& mv etc/sysconfig/ide.new etc/sysconfig/ide
|
|
rm -f etc/sysconfig/ide.new
|
|
fi
|
|
%{?udev_rules_update:%udev_rules_update}
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%doc Changelog README.acoustic contrib/README.contrib README.wiper
|
|
%{_mandir}/man8/hdparm.8.gz
|
|
#UsrMerge
|
|
/sbin/hdparm
|
|
/sbin/wiper.sh
|
|
#EndUserMerge
|
|
%{_sbindir}/hdparm
|
|
%{_sbindir}/wiper.sh
|
|
%{_udevdir}/idedma.sh
|
|
%{_udevrulesdir}/56-idedma.rules
|
|
%{_libexecdir}/hdparm
|
|
%{_localstatedir}/adm/fillup-templates/sysconfig.ide
|
|
|
|
%changelog
|