%define glib2_version           2.32.0
%define dbus_version            1.4.20
%define dbus_glib_version       0.98
%define polkit_version          0.104
%define parted_version          2.3
%define udev_version            175
%define mdadm_version           2.6.7
%define device_mapper_version   1.02
%define libatasmart_version     0.17
%define sg3_utils_version       1.27
%define smp_utils_version       0.94
%define lvm2_version            2.02.78

Summary: Storage Management Service
Name: udisks2
Version: 2.1.0
Release: 1%{?_dist_release}
License: GPLv2+
Group: System Environment/Libraries
URL: http://www.freedesktop.org/wiki/Software/udisks

Source0: http://udisks.freedesktop.org/releases/udisks-%{version}.tar.bz2

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: dbus-devel  >= %{dbus_version}
BuildRequires: dbus-glib-devel >= %{dbus_glib_version}
BuildRequires: polkit-devel >= %{polkit_version}
BuildRequires: parted-devel >= %{parted_version}
BuildRequires: device-mapper-devel >= %{device_mapper_version}
BuildRequires: libacl-devel
BuildRequires: intltool
BuildRequires: libatasmart-devel >= %{libatasmart_version}
BuildRequires: libgudev1-devel >= %{udev_version}
BuildRequires: libudev-devel >= %{udev_version}
BuildRequires: sg3_utils-devel >= %{sg3_utils_version}
BuildRequires: lvm2-devel >= %{lvm2_version}
BuildRequires: gobject-introspection-devel

# needed to pull in the system bus daemon
Requires: dbus >= %{dbus_version}
# needed to pull in the udev daemon
Requires: udev >= %{udev_version}
# we need at least this version for bugfixes / features etc.
Requires: libatasmart >= %{libatasmart_version}
Requires: mdadm >= %{mdadm_version}
# for smp_rep_manufacturer
Requires: smp_utils >= %{smp_utils_version}
# for mount, umount, mkswap
Requires: util-linux-ng
# for mkfs.ext3, mkfs.ext3, e2label
Requires: e2fsprogs
# for mkfs.xfs, xfs_admin
Requires: xfsprogs
# for mkfs.vfat
Requires: dosfstools
# for mlabel
Requires: mtools
# for mkntfs - no ntfsprogs on ppc, though
%ifnarch ppc ppc64
Requires: ntfsprogs
%endif

# for /proc/self/mountinfo, only available in 2.6.26 or higher
Conflicts: kernel < 2.6.26

# we need liblvm2app at least this recent since the ABI changed (sizes
# reported in number of bytes instead of number of sectors) without
# the sonumber changing
#
Requires: lvm2-libs >= %{lvm2_version}

Vendor: Project Vine
Distribution: Vine Linux

%description
udisks provides a daemon, D-Bus API and command line tools
for managing disks and storage devices.

%package devel
Summary: D-Bus interface definitions for udisks
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

# See comment above
#
%description devel
D-Bus interface definitions and documentation for udisks.


%package        doc
Summary:        Documentation for udisks2
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
BuildArch:	noarch

%description    doc
This package contains documentation for udisks2.


%prep
%setup -q -n udisks-%{version}

%build
%configure \
	--enable-gtk-doc
make

%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a

# for now, include a compat symlink for the command-line tool
# and man page
ln -s udisks $RPM_BUILD_ROOT%{_bindir}/devkit-disks
ln -s udisks.1 $RPM_BUILD_ROOT%{_datadir}/man/man1/devkit-disks.1

mkdir $RPM_BUILD_ROOT/run

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README AUTHORS NEWS COPYING HACKING
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.UDisks2.conf
/lib/udev/rules.d/80-udisks2.rules
%{_bindir}/devkit-disks
%{_bindir}/udisksctl
%{_sbindir}/umount.udisks2
%dir %{_prefix}/lib/udisks2
%{_prefix}/lib/udisks2/udisksd
%{_libdir}/libudisks2.so.*
%{_libdir}/girepository-1.0/UDisks-2.0.typelib
%{_datadir}/bash-completion/completions/udisksctl
%{_datadir}/dbus-1/system-services/org.freedesktop.UDisks2.service
%{_datadir}/polkit-1/actions/org.freedesktop.udisks2.policy
%{_mandir}/man1/*
%{_mandir}/man8/*
%attr(0700,root,root) %dir %{_localstatedir}/lib/udisks2
%attr(0755,root,root) %dir /run

%files devel
%defattr(-,root,root,-)
%{_includedir}/udisks2
%{_libdir}/libudisks2.so
%{_libdir}/pkgconfig/udisks2.pc
%{_datadir}/gir-1.0/UDisks-2.0.gir

%files doc
%defattr(-,root,root,-)
%{_datadir}/gtk-doc/html/%{name}

#
%changelog
* Thu Mar 21 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.1.0-1
- new upstream release

* Thu Jan 03 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0.1-1
- new upstream release

* Tue Oct 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0.0-1
- new upstream release

* Sat Sep 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.99.0-1
- new upstream release

* Sun Jun 10 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.98.0-1
- new upstream release
- add BuildRequires: libacl-devel

* Sun Apr 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.94.0-1
- Initial build for Vine Linux

