%define glib2_version 2.31.13
%define gobject_introspection_version 1.30.0
%define polkit_version 0.101
%define systemd_version 184
%define libatasmart_version 0.12
%define dbus_version 1.4.0
Summary: Disk Manager
Name: udisks2
Version: 2.1.2
Release: 5%{?dist}
License: GPLv2+
Group: System Environment/Libraries
URL: http://www.freedesktop.org/wiki/Software/udisks
Source0: http://udisks.freedesktop.org/releases/udisks-%{version}.tar.bz2
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
BuildRequires: polkit-devel >= %{polkit_version}
BuildRequires: intltool
BuildRequires: libatasmart-devel >= %{libatasmart_version}
BuildRequires: libgudev1-devel >= %{systemd_version}
BuildRequires: gtk-doc
BuildRequires: systemd-devel
BuildRequires: libacl-devel
# needed to pull in the system bus daemon
Requires: dbus >= %{dbus_version}
# needed to pull in the udev daemon
Requires: systemd >= %{systemd_version}
# we need at least this version for bugfixes / features etc.
Requires: libatasmart >= %{libatasmart_version}
# for mount, umount, mkswap
Requires: util-linux
# for mkfs.ext3, mkfs.ext3, e2label
Requires: e2fsprogs
# for mkfs.xfs, xfs_admin
Requires: xfsprogs
# for mkfs.vfat
Requires: dosfstools
# for partitioning
Requires: parted
Requires: gdisk
# for LUKS devices
Requires: cryptsetup-luks
# for ejecting removable disks
Requires: eject
# for MD-RAID
Requires: mdadm
Requires: libudisks2 = %{version}-%{release}
# for mkntfs (not available on rhel or on ppc/ppc64)
%if ! 0%{?rhel}
%ifnarch ppc ppc64
Requires: ntfsprogs
%endif
%endif
# for /proc/self/mountinfo, only available in 2.6.26 or higher
Conflicts: kernel < 2.6.26
# https://bugzilla.redhat.com/show_bug.cgi?id=976796
# ensure smooth upgrade path from udisks(1)
Obsoletes: udisks
# Some patch touches Makefile.am
BuildRequires: automake autoconf
BuildRequires: gnome-common
# add a man page for umount.udisks2
# https://bugzilla.redhat.com/show_bug.cgi?id=948926
Patch8: umount.udisks2-manpage.patch
# udisks2: udiskctl loop-delete crash
# https://bugzilla.redhat.com/show_bug.cgi?id=1036076
Patch9: udisks-2.1.3-udisksctl-loop-delete-crash.patch
# udisks2: thread safety issues
# https://bugzilla.redhat.com/show_bug.cgi?id=1036099
Patch10: udisks-2.1.3-getpwuid-thread-safety.patch
Patch11: udisks-2.1.3-udisks_daemon_util_get_caller_uid_sync-missing-goto.patch
# udisks2 doesn't unmount /dev/sr0 when optical media is ejected using optical drive button
# https://bugzilla.redhat.com/show_bug.cgi?id=835120
Patch12: udisks-2.x.x-cleanup-cdrom.patch
# Issues found by clang static analyzer
# https://bugzilla.redhat.com/show_bug.cgi?id=1056580
Patch13: udisks-2.1.3-uninitialized-vars.patch
Patch14: udisks-2.1.3-uninitialized-wait_data.patch
# CVE-2014-0004
# https://bugzilla.redhat.com/show_bug.cgi?id=1070144
Patch15: udisks-2.x.x-CVE-2014-0004.patch
%description
udisks provides a daemon, D-Bus API and command line tools for
managing disks and storage devices. This package is for the udisks 2.x
series.
%package -n libudisks2
Summary: Dynamic library to access the udisks daemon
Group: System Environment/Libraries
License: LGPLv2+
%description -n libudisks2
This package contains the dynamic library libudisks2, which provides
access to the udisks daemon. This package is for the udisks 2.x
series.
%package -n libudisks2-devel
Summary: Development files for libudisks2
Group: Development/Libraries
Requires: libudisks2 = %{version}-%{release}
Requires: pkgconfig
License: LGPLv2+
%description -n libudisks2-devel
This package contains the development files for the library
libudisks2, a dynamic library, which provides access to the udisks
daemon. This package is for the udisks 2.x series.
%prep
%setup -q -n udisks-%{version}
%patch8 -p1 -b .umount.udisks2-manpage
%patch9 -p1 -b .udisksctl-loop-delete-crash
%patch10 -p1 -b .getpwuid-thread-safety
%patch11 -p1 -b .udisks_daemon_util_get_caller_uid_sync-missing-goto
%patch12 -p1 -b .cleanup-cdrom
%patch13 -p1 -b .uninitialized-vars
%patch14 -p1 -b .uninitialized-wait_data
%patch15 -p1 -b .cve-2014-0004
%build
# umount.udisks2-manpage.patch touches Makefile.am
libtoolize --force || :
aclocal || :
autoheader || :
automake || :
autoconf || :
# we can't use _hardened_build here, see
# https://bugzilla.redhat.com/show_bug.cgi?id=892837
export CFLAGS='-fPIC %optflags'
export LDFLAGS='-pie -Wl,-z,now -Wl,-z,relro'
%configure --enable-gtk-doc
make
%install
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
%find_lang %{name}
%post -n libudisks2 -p /sbin/ldconfig
%postun -n libudisks2 -p /sbin/ldconfig
%files -f %{name}.lang
%doc README AUTHORS NEWS COPYING HACKING
%dir %{_sysconfdir}/udisks2
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.UDisks2.conf
%{_datadir}/bash-completion/completions/udisksctl
%{_prefix}/lib/systemd/system/udisks2.service
%{_prefix}/lib/udev/rules.d/80-udisks2.rules
%{_sbindir}/umount.udisks2
%dir %{_prefix}/lib/udisks2
%{_prefix}/lib/udisks2/udisksd
%{_bindir}/udisksctl
%{_mandir}/man1/*
%{_mandir}/man8/*
%{_datadir}/polkit-1/actions/org.freedesktop.udisks2.policy
%{_datadir}/dbus-1/system-services/org.freedesktop.UDisks2.service
# Permissions for local state data are 0700 to avoid leaking information
# about e.g. mounts to unprivileged users
%attr(0700,root,root) %dir %{_localstatedir}/lib/udisks2
%files -n libudisks2
%{_libdir}/libudisks2.so.*
%{_libdir}/girepository-1.0/UDisks-2.0.typelib
%files -n libudisks2-devel
%{_libdir}/libudisks2.so
%dir %{_includedir}/udisks2
%dir %{_includedir}/udisks2/udisks
%{_includedir}/udisks2/udisks/*.h
%{_datadir}/gir-1.0/UDisks-2.0.gir
%dir %{_datadir}/gtk-doc/html/udisks2
%{_datadir}/gtk-doc/html/udisks2/*
%{_libdir}/pkgconfig/udisks2.pc
# Note: please don't forget the %{?dist} in the changelog. Thanks
%changelog
* Wed Feb 26 2014 Jan Safranek <jsafrane@redhat.com> - 2.1.2-5
- Fix CVE-2014-0004: stack-based buffer overflow when handling long path names
(#1070144)
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 2.1.2-4
- Mass rebuild 2014-01-24
* Wed Jan 22 2014 Tomas Bzatek <tbzatek@redhat.com> - 2.1.2-3%{?dist}
- Fix upgrade path from old udisks
* Wed Jan 22 2014 Tomas Bzatek <tbzatek@redhat.com> - 2.1.2-2%{?dist}
- Fix crash when loop-deleting non-loop device (#1036076)
- Fix some thread safety issues (#1036099)
- Fix lingering mount after CD-ROM drive is ejected (#835120)
- Fix some uninitializes variables (#1056580)
* Thu Jan 16 2014 Tomas Bzatek <tbzatek@redhat.com> - 2.1.2-1%{?dist}
- Update to 2.1.2
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 2.1.0-5
- Mass rebuild 2013-12-27
* Thu Jul 25 2013 Tomas Bzatek <tbzatek@redhat.com> - 2.1.0-4%{?dist}
- Add a man page for umount.udisks2 (#948926)
* Tue Jul 02 2013 Tomas Bzatek <tbzatek@redhat.com> - 2.1.0-3%{?dist}
- Sync with recent upstream changes
- Add Provides/Obsoletes udisks (#976796)
* Thu Mar 28 2013 Tomas Bzatek <tbzatek@redhat.com> - 2.1.0-2%{?dist}
- Fix firewire drives identification (#909010)
* Wed Mar 20 2013 Kalev Lember <kalevlember@gmail.com> - 2.1.0-1
- Update to 2.1.0
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.91-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Tue Jan 22 2013 Matthias Clasen <mclasen@redhat.com> - 2.0.91-2%{?dist}
- Hardened build
* Mon Jan 07 2013 David Zeuthen <davidz@redhat.com> - 2.0.91-1%{?dist}
- Update to release 2.0.91
* Tue Dec 18 2012 David Zeuthen <davidz@redhat.com> - 2.0.90-1%{?dist}
- Update to release 2.0.90
* Fri Oct 02 2012 David Zeuthen <davidz@redhat.com> - 2.0.0-1%{?dist}
- Update to release 2.0.0
* Fri Jul 27 2012 David Zeuthen <davidz@redhat.com> - 1.99.0-1%{?dist}
- Update to release 1.99.0
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.98.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Thu Jun 07 2012 David Zeuthen <davidz@redhat.com> - 1.98.0-1%{?dist}
- Update to release 1.98.0
* Mon Jun 04 2012 Kay Sievers <kay@redhat.com> - 1.97.0-4
- rebuild for libudev1
* Tue May 22 2012 Peter Robinson <pbrobinson@fedoraproject.org> - 1.97.0-3
- Add upstream patch to fix issue with rootfs being on a bound mount
* Fri May 18 2012 Matthias Clasen <mclasen@redhat.com> - 1.97.0-2%{?dist}
- Add a Requires for eject (#810882)
* Wed May 09 2012 David Zeuthen <davidz@redhat.com> - 1.97.0-1%{?dist}
- Update to release 1.97.0
* Thu May 03 2012 David Zeuthen <davidz@redhat.com> - 1.96.0-2%{?dist}
- Include patch so Fedora Live media is shown
* Mon Apr 30 2012 David Zeuthen <davidz@redhat.com> - 1.96.0-1%{?dist}
- Update to release 1.96.0
* Mon Apr 30 2012 David Zeuthen <davidz@redhat.com> - 1.95.0-3%{?dist}
- BR: gnome-common
* Mon Apr 30 2012 David Zeuthen <davidz@redhat.com> - 1.95.0-2%{?dist}
- Make daemon actually link with libsystemd-login
* Mon Apr 30 2012 David Zeuthen <davidz@redhat.com> - 1.95.0-1%{?dist}
- Update to release 1.95.0
* Tue Apr 10 2012 David Zeuthen <davidz@redhat.com> - 1.94.0-1%{?dist}
- Update to release 1.94.0
* Tue Apr 03 2012 David Zeuthen <davidz@redhat.com> - 1.93.0-2%{?dist}
- Don't inadvertently unmount large block devices (fdo #48155)
* Mon Mar 05 2012 David Zeuthen <davidz@redhat.com> - 1.93.0-1%{?dist}
- Update to release 1.93.0
* Thu Feb 23 2012 David Zeuthen <davidz@redhat.com> - 1.92.0-2%{?dist}
- Fix build
* Thu Feb 23 2012 David Zeuthen <davidz@redhat.com> - 1.92.0-1%{?dist}
- Update to release 1.92.0
* Wed Feb 22 2012 David Zeuthen <davidz@redhat.com> - 1.91.0-2%{?dist}
- Avoid using $XDG_RUNTIME_DIR/media for now
* Mon Feb 06 2012 David Zeuthen <davidz@redhat.com> - 1.91.0-1%{?dist}
- Update to release 1.91.0
* Fri Jan 21 2012 David Zeuthen <davidz@redhat.com> - 1.90.0-3%{?dist}
- Manually set PATH, if not set
* Fri Jan 20 2012 David Zeuthen <davidz@redhat.com> - 1.90.0-2%{?dist}
- Rebuild
* Fri Jan 20 2012 David Zeuthen <davidz@redhat.com> - 1.90.0-1%{?dist}
- Update to release 1.90.0
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.90.0-0.git20111128.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon Nov 28 2011 David Zeuthen <davidz@redhat.com> - 1.90.0-0.git20111128%{?dist}
- Updated for review comments (#756046)
* Mon Nov 22 2011 David Zeuthen <davidz@redhat.com> - 1.90.0-0.git20111122%{?dist}
- Initial packaging of udisks2