%define pkg_version 1.0.1
%define pkg_release 1%{?_dist_release}
%define libdaemon_version 0.14

Summary:      System settings D-Bus service for OpenRC 
Summary(ja):  D-Busシステム設定サービス
Name:         openrc-settingsd
Version:      %{pkg_version}
Release:      %{pkg_release}
Vendor:       Project Vine
Distribution: Vine Linux

License:      GPL2+
Group:        System Environment/Base
URL:          https://gitweb.gentoo.org/proj/openrc-settingsd.git/
Source0:      https://dev.gentoo.org/~tetromino/distfiles/openrc-settingsd/openrc-settingsd-%{version}.tar.xz
Source1:      libdaemon-%{libdaemon_version}.tar.gz
Patch0:       openrc-settingsd-vine.patch

BuildRequires: glib2-devel
BuildRequires: dbus-devel
BuildRequires: polkit-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
 Implementation of systemd's settings interface (hostnamed, localed, timedated) for OpenRC

%prep
%setup -q -a 1
%patch0 -p1 -b .vine
ln -sf libdaemon-%{libdaemon_version} libdaemon

%build
autoreconf -ivf

pushd libdaemon-%{libdaemon_version}
%configure
%{__make} %{?_smp_mflags}
popd
ln -sf libdaemon-%{libdaemon_version}/libdaemon/.libs/libdaemon.a ./

%configure
%{__make} %{?_smp_mflags}


%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}

rm -rf %{buildroot}%{_sysconfdir}/conf.d
rm -rf %{buildroot}%{_sysconfdir}/init.d


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}


%files
%defattr(-,root,root)
%license COPYING libdaemon/LICENSE
%doc AUTHORS NEWS README
%{_sysconfdir}/dbus-1/system.d/*
%{_libexecdir}/*
%{_datadir}/openrc-settingsd
%{_datadir}/polkit-1/actions/*
%{_datadir}/dbus-1/interfaces/*
%{_datadir}/dbus-1/system-services/*
%{_mandir}/man8/*


%changelog
* Fri Jan 04 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.1-1
- initial build for Vine Linux.