%define build_compat32  %{?_with_compat32:1}%{!?_with_compat32:0}

Name:           libgudev
Version:        232
Release:        1%{?_dist_release}
Summary:        UDev GObject bindings
Summary(ja):    UDev の GObject バインディング

Group:          System Environment/Libraries
License:        LGPLv2.1
URL:            http://git.gnome.org/browse/libgudev
Source0:        http://download.gnome.org/sources/%{name}/230/%{name}-%{version}.tar.xz

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

BuildRequires:  eudev-libudev-devel
BuildRequires:  glib2-devel >= 2.22.0
BuildRequires:  gobject-introspection-devel
BuildRequires:  gtk-doc

Obsoletes:  eudev-libgudev1 < 3.1.5
Provides:   eudev-libgudev1 = 3.1.5
Obsoletes:  libgudev1 < 230
Provides:   libgudev1 = %{version}-%{release}

Vendor: Project Vine
Distribution: Vine Linux

%description
This package contains the libraries for adding libudev support to applications
that use glib.

%description -l ja
このパッケージには Glib を使用するアプリケーションに libudev サポートを
追加するためのライブラリが含まれております。


%package        devel
Summary:        Development files for %{name}
Summary(ja):    %{name} の開発環境
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Obsoletes:      eudev-libgudev1-devel < 3.1.5
Provides:       eudev-libgudev1-devel = 3.1.5
Obsoletes:      libgudev1-devel < 230
Provides:       libgudev1-devel = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files
for developing applications that use %{name}.

# compat32
%package -n compat32-%{name}
Summary:        UDev GObject bindings
Summary(ja):    UDev の GObject バインディング
Group:          System Environment/Libraries
Requires:       %{name} = %{version}-%{release}
Obsoletes:      compat32-eudev-libgudev1 < 3.1.5
Provides:       compat32-eudev-libgudev1 = 3.1.5
Obsoletes:      compat32-libgudev1 < 230
Provides:       compat32-libgudev1 = %{version}-%{release}

%description -n  compat32-%{name}
This package contains the libraries for adding libudev support to applications
that use glib.

%description -n  compat32-%{name} -l ja
このパッケージには Glib を使用するアプリケーションに libudev サポートを
追加するためのライブラリが含まれております。


%package -n compat32-%{name}-devel
Summary:        Development files for %{name}
Summary(ja):    %{name} の開発環境
Group:          Development/Libraries
Requires:       compat32-%{name} = %{version}-%{release}
Obsoletes:      compat32-eudev-libgudev1-devel < 3.1.5
Provides:       compat32-eudev-libgudev1-devel = 3.1.5
Obsoletes:      compat32-libgudev1-devel < 230
Provides:       compat32-libgudev1-devel = %{version}-%{release}

%description -n compat32-%{name}-devel
The %{name}-devel package contains libraries and header files
for developing applications that use %{name}.

%prep
%setup -q


%build
%configure \
	--disable-static \
	--disable-umockdev

make %{?_smp_mflags}


%install
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'


%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%if %{build_compat32}
%post -n compat32-%{name} -p /sbin/ldconfig
%postun -n compat32-%{name} -p /sbin/ldconfig
%endif


%files
%defattr(-,root,root,-)
%license COPYING
%doc README NEWS
%{_libdir}/libgudev-1.0.so.*
%{_libdir}/girepository-1.0/GUdev-1.0.typelib

%files devel
%defattr(-,root,root,-)
%{_libdir}/libgudev-1.0.so
%{_includedir}/gudev-1.0/gudev/*.h
%{_datadir}/gir-1.0/GUdev-1.0.gir
%{_libdir}/pkgconfig/gudev-1.0*

%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root,-)
%{_libdir}/libgudev-1.0.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root,-)
%{_libdir}/libgudev-1.0.so
%endif


%changelog
* Sun Dec 30 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 232-1
- new upstream release.

* Sun Apr 24 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 230-1
- initial build

