Name:           upstart
Version:        1.12.1
Release:        4%{?_dist_release}
Summary:        An event-driven init system
Summary(ja):    イベントドリブン型 init システム

Group:          System Environment/Base
License:        GPLv2 and LGPLv2+
URL:            http://launchpad.net/upstart

Source0:        http://launchpad.net/upstart/1.x/%{version}/+download/upstart-%{version}.tar.gz
Source1:        init-system-dbus.conf
#Patch1:         upstart-telinit.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Obsoletes: SysVinit < 2.88
Provides: SysVinit = 2.88
BuildRequires:  gettext, audit-libs-devel, expat-devel 
BuildRequires:  dbus-devel >= 1.2.16
BuildRequires:  libnih-devel >= 1.0.3-2
BuildRequires:  json-c-devel >= 0.10
BuildRequires:  eudev-libudev-devel
BuildRequires:  dconf-devel
Requires:       initscripts >= 8.90.4

%description
Upstart is an event-based replacement for the /sbin/init daemon which
handles starting of tasks and services during boot, stopping them
during shutdown and supervising them while the system is running.

%description -l ja
Upstart はイベントドリブン型の /sbin/init デーモンです。OSブート時の
タスクやサービスの開始やシャットダウン時の終了およびそれらの管理を担
当します。

%package devel
Summary: Development files for upstart
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Development files for upstart

%package tools
Summary: Misc tools for upstart
Group: System Environment/Base
Requires: %{name} = %{version}-%{release}
Requires: python3
Requires: dbus-python3

%description tools
Misc tools for upstart

%prep
%setup -q
#%patch1 -p1 -b .u

%build
%configure --sbindir=/sbin --libdir=/%{_lib}
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}

# don't ship default jobs
rm -f %{buildroot}/%{_sysconfdir}/init/*
install -m 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/init/

# install upstart-{socket,udev}-bridge.conf
install -m 644 extra/conf/*.conf %{buildroot}/%{_sysconfdir}/init/

# remove unneeded files
rm %{buildroot}/%{_lib}/*.{a,la}

%find_lang %{name}

%check
#some tests fail in koji while pass in mock and local build
#to run make check use "--with check"
%if %{?_with_check:1}%{!?_with_check:0}
  make check
%endif

%clean
rm -rf %{buildroot}

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS
%doc COPYING
%doc NEWS
%doc README
%doc TODO
%doc HACKING
%{_sysconfdir}/init/
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/Upstart.conf
/%{_lib}/libupstart.so.*
/sbin/halt
/sbin/init
/sbin/initctl
/sbin/poweroff
/sbin/reboot
/sbin/runlevel
/sbin/shutdown
/sbin/start
/sbin/status
/sbin/stop
/sbin/restart
/sbin/telinit
/sbin/reload
/sbin/upstart-socket-bridge
/sbin/upstart-udev-bridge
/sbin/upstart-dbus-bridge
/sbin/upstart-dconf-bridge
/sbin/upstart-event-bridge
/sbin/upstart-file-bridge
/sbin/upstart-local-bridge
%{_bindir}/init-checkconf
%dir %{_datadir}/upstart
%dir %{_datadir}/upstart/sessions
%{_datadir}/upstart/sessions/*
%{_mandir}/man5/init.5.gz
%{_mandir}/man5/inittab.5.gz
%{_mandir}/man7/*.7*
%{_mandir}/man8/*.8*
%exclude %{_mandir}/man8/initctl2dot.8*
%exclude %{_mandir}/man8/upstart-monitor.8*

%files devel
%defattr(-,root,root,-)
/%{_lib}/libupstart.so
%{_includedir}/upstart*
%{_prefix}/lib/pkgconfig/*.pc

%files tools
%defattr(-,root,root,-)
%{_bindir}/upstart-monitor
%{_bindir}/initctl2dot
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/scalable/apps/*.svg
%{_datadir}/upstart/icons/*.svg
%{_mandir}/man8/initctl2dot.8*
%{_mandir}/man8/upstart-monitor.8*

%changelog
* Tue Jun 24 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.12.1-4
- change BuildRequires: eudev-libudev-devel instead of libudev-devel

* Sun Jun 22 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 1.12.1-3
- rebuild with libnih-1.0.3-2

* Mon Jun 16 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 1.12.1-2
- add -tools subpackage
- split initctl2dot and upstart-monitor to -tools subpackage
- add R: dbus-python3 to upstart-tools

* Sun Jun 15 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 1.12.1-1
- update to 1.12.1
- add BR: dconf-devel
- add -devel subpackage

* Wed Nov 28 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 1.6-2
- install upstart-{socket,udev}-bridge.conf

* Wed Nov 28 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 1.6-1
- update to 1.6
- add BR: libudev-devel
- add BR: json-c-devel >= 0.10

* Sat Apr 09 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2-1
- new upstream release

* Thu Mar 10 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.7-1
- new upstream release

* Wed May 12 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.5-2
- add R: initscripts >= 8.90.4

* Sun Apr 11 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.5-1
- initial build for Vine Linux

* Wed Feb 24 2010 Petr Lautrbach <plautrba@redhat.com> 0.6.5-3
- run "make check" only with --with check

* Fri Feb 19 2010 Casey Dahlin <cdahlin@redhat.com> 0.6.5-2
- be more specific about which libnih we need.

* Wed Feb 17 2010 Petr Lautrbach <plautrba@redhat.com> 0.6.5-1
- upgrade to 0.6.5

* Fri Jan 29 2010 Petr Lautrbach <plautrba@redhat.com> 0.6.3-7
- add SIGUSR1 handler and init-system-dbus.conf (#559660)

* Sun Jan 17 2010 Dennis Gilmore <dennis@ausil.us> - 0.6.3-6
- add patch from upstream fixing sparc alignment issues

* Mon Jan 11 2010 Petr Lautrbach <plautrba@redhat.com> 0.6.3-5
- License changed to GPLv2 and LGPLv2+

* Wed Dec 16 2009 Petr Lautrbach <plautrba@redhat.com> 0.6.3-4
- audit events patch rebased for 0.6 (#470661)

* Thu Dec  3 2009 Bill Nottingham <notting@redhat.com> 0.6.3-3
- make 'telinit u' a no-op, temporarily

* Fri Nov 27 2009 Petr Lautrbach <plautrba@redhat.com> 0.6.3-2
- Removed tests which fail in koji

* Fri Nov 20 2009 Casey Dahlin <cdahlin@redhat.com> - 0.6.3-1
- Upgrade to 0.6.3

* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.3.11-3
- rebuilt with new audit

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jun 22 2009 Petr Lautrbach <plautrba@redhat.com> - 0.3.11-1
- Update to 0.3.11

* Mon Apr 27 2009 Bill Nottingham <notting@redhat.com> - 0.3.9-24
- Apply the audit patch correctly (#470661)

* Fri Apr 3 2009 Casey Dahlin <cdahlin@redhat.com> - 0.3.9-23
- Add audit events patch from Steve Grubb <sgrubb@redhat.com> (Bug #470661)

* Fri Jan 23 2009 Casey Dahlin <cdahlin@redhat.com> - 0.3.9-22
- Re-add 'telinit u' support along with patch to fix it (#450488). Patch due to
  <pspencer@fields.utoronto.ca>

* Mon Jan 12 2009 Bill Nottingham <notting@redhat.com> - 0.3.9-21
- Remove 'telinit u' support as it is broken (#450488, <cjdahlin@ncsu.edu>)

* Fri Apr 25 2008 Bill Nottingham <notting@redhat.com> - 0.3.9-19
- with the merge of event-compat-sysv, move the sysvinit obsoletes/provides here

* Thu Apr 24 2008 Bill Nottingham <notting@redhat.com> - 0.3.9-18
- fix some man page typos (#444008, <archimerged@gmail.com>)

* Wed Apr 09 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-17
- Added list of stock events to events(5)

* Tue Apr 08 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-16
- Add telinit u support

* Fri Apr 04 2008 Bill Nottingham <notting@redhat.com> - 0.3.9-15
- Add a events(5) manpage that describes event syntax

* Thu Apr 03 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-14
- Change bug report email address to fedora-devel-list@redhat.com

* Fri Mar 14 2008 Bill Nottingham <notting@redhat.com> - 0.3.9-13
- Ignore rpm temporary files of the foo;<somehex> format
- Make ignores of .rpm{new,orig,save} match only at the end of the name

* Thu Mar 13 2008 Bill Nottingham <notting@redhat.com> - 0.3.9-12
- forgot about rpmorig too (ugh)

* Thu Mar 13 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-11
- Make logd a noreplace

* Thu Mar 13 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-10
- Add patch to ignore .rpm{new,save} files

* Mon Mar 03 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-9
- Remove automake dependency, build Makefile.in changes into patch

* Mon Mar 03 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-8
- Run automake after patching

* Mon Mar 03 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-7
- Added BuildRequires: automake

* Mon Mar 03 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-6
- Added patch to allow runtime tty changes

* Fri Feb 15 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-5
- Added patch to imply --force on runlevels 0 and 6

* Wed Feb 06 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-4
- Patched for GCC 4.3

* Thu Jan 31 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-3
- Added AUTHORS, COPYING, etc.
- Made config --libdir option relative

* Mon Jan 21 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-2
- Remove libnih and libupstart

* Sun Jan 13 2008 Casey Dahlin <cjdahlin@ncsu.edu> - 0.3.9-1
- Initial packaging
