install everything in /usr

This patch is needed for the /usr-move feature
https://fedoraproject.org/wiki/Features/UsrMove

This package requires now 'filesystem' >= 3, which is only installable
on a system which has /bin, /sbin, /lib, /lib64 as symlinks to /usr and
not regular directories. The 'filesystem' package acts as a guard, to
prevent *this* package to be installed on old unconverted systems.

New installations will have the 'filesystem' >=3 layout right away, old
installations need to be converted with anaconda or dracut first; only
after that, the 'filesystem' package, and also *this* package can be
installed.

Packages *should* not install files in /bin, /sbin, /lib, /lib64, but
only in the corresponding directories in /usr. Packages *must* not
install conflicting files with the same names in the corresponding
directories in / and /usr. Especially compatibilty symlinks must not be
installed.

Feel free to modify any of the changes to the spec file, but keep the
above in mind.
This commit is contained in:
Harald Hoyer 2012-01-25 18:31:42 +01:00
parent 19dca999a8
commit de1af9d6bf

View File

@ -4,7 +4,7 @@
Summary: Advanced Linux Sound Architecture (ALSA) utilities Summary: Advanced Linux Sound Architecture (ALSA) utilities
Name: alsa-utils Name: alsa-utils
Version: %{baseversion}%{?fixversion} Version: %{baseversion}%{?fixversion}
Release: 7%{?dist} Release: 8%{?dist}
License: GPLv2+ License: GPLv2+
Group: Applications/Multimedia Group: Applications/Multimedia
URL: http://www.alsa-project.org/ URL: http://www.alsa-project.org/
@ -22,8 +22,10 @@ BuildRequires: libsamplerate-devel
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: gettext-devel BuildRequires: gettext-devel
BuildRequires: xmlto BuildRequires: xmlto
Conflicts: udev < 062 BuildRequires: systemd-units >= 39-2
Requires: alsa-lib >= %{baseversion}, systemd-units, dialog Conflicts: udev <= 179-2
Requires: alsa-lib >= %{baseversion}, systemd-units >= 39-2, dialog
Conflicts: filesystem < 3
# https://bugzilla.redhat.com/show_bug.cgi?id=738227 # https://bugzilla.redhat.com/show_bug.cgi?id=738227
Patch0: 0001-Unmute-MacBookAir4-1-speakers.patch Patch0: 0001-Unmute-MacBookAir4-1-speakers.patch
@ -37,7 +39,9 @@ Architecture (ALSA).
%patch0 -p1 -b .mba41 %patch0 -p1 -b .mba41
%build %build
%configure CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" --sbindir=/sbin --disable-alsaconf --with-systemdsystemunitdir=/lib/systemd/system %configure CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" --disable-alsaconf \
--with-udev-rules-dir=%{_prefix}/lib/udev/rules.d \
--with-systemdsystemunitdir=%{_unitdir}
%{__make} %{?_smp_mflags} %{__make} %{?_smp_mflags}
%{__cp} %{SOURCE4} . %{__cp} %{SOURCE4} .
@ -47,26 +51,24 @@ make install DESTDIR=$RPM_BUILD_ROOT
%find_lang %{name} %find_lang %{name}
# Install ALSA udev rules # Install ALSA udev rules
install -p -m 644 %{SOURCE10} $RPM_BUILD_ROOT/lib/udev/rules.d/90-alsa-restore.rules mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib/udev/rules.d
install -p -m 644 %{SOURCE20} $RPM_BUILD_ROOT/lib/systemd/system/alsa-restore.service install -p -m 644 %{SOURCE10} $RPM_BUILD_ROOT/%{_prefix}/lib/udev/rules.d/90-alsa-restore.rules
install -p -m 644 %{SOURCE21} $RPM_BUILD_ROOT/lib/systemd/system/alsa-store.service mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
install -p -m 644 %{SOURCE20} $RPM_BUILD_ROOT/%{_unitdir}/alsa-restore.service
install -p -m 644 %{SOURCE21} $RPM_BUILD_ROOT/%{_unitdir}/alsa-store.service
# Install support utilities # Install support utilities
mkdir -p -m755 $RPM_BUILD_ROOT/bin mkdir -p -m755 $RPM_BUILD_ROOT/%{_bindir}
install -p -m 755 alsaunmute %{buildroot}/bin/ install -p -m 755 alsaunmute %{buildroot}/%{_bindir}
mkdir -p -m755 $RPM_BUILD_ROOT/%{_mandir}/man1 mkdir -p -m755 $RPM_BUILD_ROOT/%{_mandir}/man1
install -p -m 644 %{SOURCE5} %{buildroot}/%{_mandir}/man1/alsaunmute.1 install -p -m 644 %{SOURCE5} %{buildroot}/%{_mandir}/man1/alsaunmute.1
# Link alsactl to /usr/sbin # Move /usr/share/alsa/init to /usr/lib/alsa/init
mkdir -p $RPM_BUILD_ROOT/%{_sbindir} mkdir -p -m 755 %{buildroot}/%{_prefix}/lib/alsa
ln -s ../../sbin/alsactl $RPM_BUILD_ROOT/%{_sbindir}/alsactl mv %{buildroot}%{_datadir}/alsa/init %{buildroot}/%{_prefix}/lib/alsa
# Move /usr/share/alsa/init to /lib/alsa/init # Link /usr/lib/alsa/init to /usr/share/alsa/init back
mkdir -p -m 755 %{buildroot}/lib/alsa ln -s ../../lib/alsa/init %{buildroot}%{_datadir}/alsa/init
mv %{buildroot}%{_datadir}/alsa/init %{buildroot}/lib/alsa
# Link /lib/alsa/init to /usr/share/alsa/init back
ln -s ../../../lib/alsa/init %{buildroot}%{_datadir}/alsa/init
# Create a place for global configuration # Create a place for global configuration
mkdir -p -m 755 %{buildroot}/etc/alsa mkdir -p -m 755 %{buildroot}/etc/alsa
@ -86,21 +88,19 @@ ln -s alsa-info %{buildroot}/usr/bin/alsa-info.sh
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING ChangeLog README TODO %doc COPYING ChangeLog README TODO
%config /etc/alsa/* %config /etc/alsa/*
/bin/* %{_prefix}/lib/udev/rules.d/*
/sbin/* %{_unitdir}/*
/lib/udev/rules.d/* %{_unitdir}/basic.target.wants/*
/lib/systemd/system/* %{_unitdir}/shutdown.target.wants/*
/lib/systemd/system/basic.target.wants/* %{_prefix}/lib/alsa/init/*
/lib/systemd/system/shutdown.target.wants/*
/lib/alsa/init/*
%{_bindir}/* %{_bindir}/*
%{_sbindir}/* %{_sbindir}/*
%{_datadir}/alsa/ %{_datadir}/alsa/
%{_datadir}/sounds/* %{_datadir}/sounds/*
%{_mandir}/man?/* %{_mandir}/man?/*
%dir /etc/alsa/ %dir /etc/alsa/
%dir /lib/alsa/ %dir %{_prefix}/lib/alsa/
%dir /lib/alsa/init/ %dir %{_prefix}/lib/alsa/init/
%dir /var/lib/alsa/ %dir /var/lib/alsa/
%post %post
@ -112,6 +112,10 @@ if [ -s /etc/asound.state -a ! -s /var/lib/alsa/asound.state ] ; then
fi fi
%changelog %changelog
* Wed Jan 25 2012 Harald Hoyer <harald@redhat.com> 1.0.24.1-8
- install everything in /usr
https://fedoraproject.org/wiki/Features/UsrMove
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.24.1-7 * Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.24.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild