kanku/kanku.spec

506 lines
14 KiB
RPMSpec
Raw Normal View History

#
# spec file for package kanku
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define kanku_user kankurun
%define kanku_group kanku
%define kanku_prefix /opt/kanku
%define kanku_vardir %{kanku_prefix}/var
Name: kanku
# Version gets set by obs-service-tar_scm
Version: 0.0.0
Release: 0.0
License: GPL-3.0
Summary: Development and continuous integration made easy
Url: https://github.com/M0ses/kanku
Group: Productivity/Networking/Web/Utilities
Source: %{name}-%{version}.tar.xz
BuildArch: noarch
BuildRequires: perl-macros
BuildRequires: fdupes
BuildRequires: systemd-rpm-macros
# perl requires for %check
BuildRequires: perl(DBIx::Class::Fixtures)
BuildRequires: perl(Test::Simple)
BuildRequires: perl(YAML)
BuildRequires: perl(Config::Tiny)
BuildRequires: perl(Path::Class)
BuildRequires: perl(Sys::Virt)
BuildRequires: perl(Moose)
BuildRequires: perl(Log::Log4perl)
BuildRequires: perl(MooseX::App::Cmd)
BuildRequires: perl(Dancer2::Plugin::REST)
BuildRequires: perl(MooseX::Singleton)
BuildRequires: perl(Expect)
BuildRequires: perl(Net::SSH2)
BuildRequires: perl(Net::IP)
BuildRequires: perl(Net::OBS::Client)
BuildRequires: perl(XML::Structured)
BuildRequires: perl(DBIx::Class::Migration)
BuildRequires: perl(Template)
BuildRequires: perl(Log::Log4perl)
BuildRequires: perl(Config::Tiny)
BuildRequires: perl(Dancer2::Plugin::DBIC)
BuildRequires: perl(Dancer2::Plugin::Auth::Extensible)
BuildRequires: perl(Dancer2::Plugin::Auth::Extensible::Provider::DBIC)
BuildRequires: perl(File::HomeDir)
BuildRequires: perl(Template::Plugin::Filter::ANSIColor)
BuildRequires: perl(JSON::XS)
BuildRequires: perl(DBIx::Class)
BuildRequires: perl(DBIx::Class::Migration)
BuildRequires: perl(Template::Plugin::Filter::ANSIColor)
BuildRequires: perl(File::LibMagic)
BuildRequires: perl(IO::Uncompress::UnXz)
BuildRequires: perl(Plack)
BuildRequires: perl(Dancer2)
BuildRequires: perl(Dancer2::Plugin::REST)
BuildRequires: perl(XML::XPath)
BuildRequires: perl(Term::ReadKey)
BuildRequires: perl(IPC::Run)
# DBD::SQLite is also provided by perl-DBD-SQLite-Amalgamation
# but perl-DBD-SQLite-Amalgamation is breaks with SQL syntax errors
# at job_histroy_sub table
BuildRequires: perl-DBD-SQLite
BuildRequires: perl(LWP::Protocol::https)
BuildRequires: perl(Mail::Sendmail)
BuildRequires: perl(Archive::Cpio)
BuildRequires: perl(Dancer2)
BuildRequires: perl(Dancer2::Plugin)
BuildRequires: perl(Dancer2::Plugin::REST)
BuildRequires: perl(Dancer2::Plugin::DBIC)
BuildRequires: perl(Dancer2::Plugin::WebSocket)
BuildRequires: perl(Dancer2::Plugin::Auth::Extensible)
BuildRequires: perl(Net::AMQP::RabbitMQ)
BuildRequires: perl(UUID)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: kanku-cli
Requires: kanku-web
Requires: kanku-worker
Requires: kanku-scheduler
Requires: kanku-dispatcher
Requires: kanku-triggerd
%description
TODO: add some meaningful description
to be more verbose
%prep
%setup -q
%build
/bin/true
%install
make install DESTDIR=%{buildroot}
%fdupes %{buildroot}/opt/kanku/share
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rckanku-web
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rckanku-worker
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rckanku-dispatcher
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rckanku-scheduler
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rckanku-triggerd
%check
# FIXME
#prove -Ilib t/000_use.t
%files
%exclude /etc
%exclude /usr
%package common
Summary: Common files for kanku
Recommends: osc
Recommends: perl(IO::Uncompress::UnXz)
Recommends: apache2
Requires: libvirt-daemon-qemu qemu-kvm libvirt-daemon-config-network libvirt-daemon-config-nwfilter
Requires: sudo
Requires: perl(DBIx::Class::Fixtures)
Requires: perl(Test::Simple)
Requires: perl(YAML)
Requires: perl(Config::Tiny)
Requires: perl(Path::Class)
Requires: perl(Sys::Virt)
Requires: perl(Moose)
Requires: perl(Log::Log4perl)
Requires: perl(MooseX::App::Cmd)
Requires: perl(Dancer2::Plugin::REST)
Requires: perl(MooseX::Singleton)
Requires: perl(Expect)
Requires: perl(Net::SSH2)
Requires: perl(Net::IP)
Requires: perl(Net::OBS::Client)
Requires: perl(XML::Structured)
Requires: perl(DBIx::Class::Migration)
Requires: perl(Template)
Requires: perl(Log::Log4perl)
Requires: perl(Config::Tiny)
Requires: perl(Dancer2::Plugin::DBIC)
Requires: perl(Dancer2::Plugin::Auth::Extensible)
Requires: perl(Dancer2::Plugin::Auth::Extensible::Provider::DBIC)
Requires: perl(File::HomeDir)
Requires: perl(Template::Plugin::Filter::ANSIColor)
Requires: perl(JSON::XS)
Requires: perl(DBIx::Class)
Requires: perl(DBIx::Class::Migration)
Requires: perl(Template::Plugin::Filter::ANSIColor)
Requires: perl(File::LibMagic)
Requires: perl(IO::Uncompress::UnXz)
Requires: perl-Plack
Requires: perl(Dancer2)
Requires: perl(Dancer2::Plugin::REST)
Requires: perl(XML::XPath)
Requires: perl(Term::ReadKey)
Requires: perl(IPC::Run)
# DBD::SQLite is also provided by perl-DBD-SQLite-Amalgamation
# but perl-DBD-SQLite-Amalgamation is breaks with SQL syntax errors
# at job_histroy_sub table
Requires: perl-DBD-SQLite
Requires: perl(LWP::Protocol::https)
Requires: perl(Mail::Sendmail)
Requires: perl(Archive::Cpio)
Requires: perl(UUID)
Requires: logrotate
Conflicts: perl-DBD-SQLite-Amalgamation
%description common
TODO:
add a useful description
%files common
%defattr(-,root,root)
%doc README.md TODO
%dir %{kanku_prefix}
%dir %{kanku_prefix}/lib
%dir %{kanku_prefix}/lib/Kanku
%dir %{kanku_prefix}/lib/Kanku/Daemon
# share contains database related stuff
%dir %{kanku_prefix}/share/
%{kanku_prefix}/share/fixtures
%{kanku_prefix}/share/migrations
%dir %{kanku_prefix}/bin
%attr(755,root,root) %{kanku_prefix}/bin/kanku
%attr(755,root,root) %{kanku_prefix}/bin/kanku-network-setup.pl
%dir %{kanku_prefix}/etc/
%ghost %{kanku_prefix}/etc/config.yml
%config %{kanku_prefix}/etc/console-log.conf
%config %{kanku_prefix}/etc/kanku-network-setup-logging.conf
%dir %{kanku_prefix}/etc/templates
%dir %{kanku_prefix}/etc/templates/examples-vm/
%dir %{kanku_prefix}/etc/templates/cmd
%dir %{kanku_prefix}/etc/templates/cmd/setup
%config %{kanku_prefix}/etc/templates/cmd/init.tt2
%config %{kanku_prefix}/etc/templates/cmd/setup/*
%config %{kanku_prefix}/etc/templates/examples-vm/obs-server-26.tt2
%config %{kanku_prefix}/etc/templates/examples-vm/sles11sp3.tt2
%config %{kanku_prefix}/etc/templates/examples-vm/obs-server.tt2
%dir %{kanku_prefix}/etc/jobs
%dir %{kanku_prefix}/etc/jobs/examples
%config %{kanku_prefix}/etc/jobs/examples/obs-server.yml
%config %{kanku_prefix}/etc/jobs/examples/obs-server-26.yml
%config %{kanku_prefix}/etc/jobs/examples/sles11sp3.yml
%config(noreplace) %{kanku_prefix}/etc/log4perl.conf
%ghost /etc/sudoers.d/kanku
%exclude %dir /etc/profile.d
%config /etc/profile.d/kanku.sh
%exclude %dir /etc/logrotate.d/
%config /etc/logrotate.d/kanku-common
%dir %{kanku_prefix}/lib/Kanku/NotifyQueue/
%{kanku_prefix}/lib/Kanku/NotifyQueue/*.pm
%{kanku_prefix}/lib/Kanku/Handler/
%{kanku_prefix}/lib/Kanku/Roles/
%{kanku_prefix}/lib/Kanku/Schema/
%{kanku_prefix}/lib/Kanku/Setup/
%{kanku_prefix}/lib/Kanku/Util/
%{kanku_prefix}/lib/Kanku/Task/
%{kanku_prefix}/lib/OpenStack/
%{kanku_prefix}/lib/Kanku/Config.pm
%{kanku_prefix}/lib/Kanku/Handler.pod
%{kanku_prefix}/lib/Kanku/Notifier
%{kanku_prefix}/lib/Kanku/Job.pm
%{kanku_prefix}/lib/Kanku/RabbitMQ.pm
%{kanku_prefix}/lib/Kanku/Schema.pm
%{kanku_prefix}/lib/Kanku/JobList.pm
%{kanku_prefix}/lib/Kanku/Task.pm
%{kanku_prefix}/lib/Kanku/Airbrake.pm
%{kanku_prefix}/lib/Kanku/NotifyQueue.pm
%dir %{kanku_prefix}/lib/Kanku/WebSocket
%{kanku_prefix}/lib/Kanku/WebSocket/Notification.pm
%{kanku_prefix}/lib/Kanku/WebSocket/Session.pm
%dir %{kanku_prefix}/lib/Kanku/Airbrake
%{kanku_prefix}/lib/Kanku/Airbrake/Dummy.pm
%dir %{kanku_prefix}/lib/Kanku/LibVirt
%{kanku_prefix}/lib/Kanku/LibVirt/HostList.pm
%dir %{kanku_prefix}/lib/Kanku/Dispatch/
%{kanku_prefix}/lib/Kanku/Dispatch/Local.pm
%package cli
Summary: Command line client for kanku
Requires: kanku-common
Requires: libvirt-client
Requires(pre): libvirt-daemon libvirt-daemon-driver-qemu qemu-kvm
Requires(pre): sudo
Requires: perl(Net::AMQP::RabbitMQ)
%description cli
Command line client for kanku, mainly used for setup tasks
and in developer mode
%files cli
%dir %{kanku_prefix}/views/cli/
%dir %{kanku_prefix}/views/cli/rjob
%{kanku_prefix}/views/cli/*.tt
%{kanku_prefix}/views/cli/rjob/*.tt
%{kanku_prefix}/lib/Kanku/Cmd/
%{kanku_prefix}/lib/Kanku/Cmd.pm
%package common-server
Summary: Common server files or settings for kanku
Requires(pre): libvirt-daemon libvirt-daemon-driver-qemu qemu-kvm
Requires(pre): shadow
%description common-server
This package contains common server files, settings and dependencies
for the kanku server components like kanku-worker, kanku-dispatcher,
kanku-web, kanku-scheduler and kanku-triggerd
%pre common-server
getent group %{kanku_group} >/dev/null || groupadd -r %{kanku_group}
getent passwd %{kanku_user} >/dev/null || useradd -r -g %{kanku_group} -G libvirt -d %{kanku_vardir} -s /sbin/nologin -c "user for kanku" %{kanku_user}
exit 0
%files common-server
%defattr(-, root, root)
%dir %{kanku_prefix}/var
%dir %attr(755, kankurun, kanku) %{kanku_prefix}/var/log
%dir %attr(755, kankurun, kanku) %{kanku_prefix}/var/cache
%dir %attr(755, kankurun, kanku) %{kanku_prefix}/var/run
%dir %attr(755, kankurun, kanku) %{kanku_prefix}/var/db
%package web
Summary: WebUI for kanku
Requires: kanku-common
Requires: kanku-common-server
Requires: perl(Dancer2::Plugin::WebSocket)
Requires: perl(Twiggy)
Requires: perl(Mail::Message::Body::String)
Requires: perl(Mail::Transport::Send)
Requires: perl(Net::AMQP::RabbitMQ)
Requires: perl(UUID)
Requires: smtp_daemon
%description web
TODO:
add a useful description
%pre web
%service_add_pre kanku-web.service
%post web
%service_add_post kanku-web.service
%preun web
%service_del_preun kanku-web.service
%postun web
%service_del_postun kanku-web.service
%files web
%attr(755,root,root) %{kanku_prefix}/bin/kanku-app.psgi
%dir %attr(755, kankurun, kanku) %{kanku_prefix}/var/sessions
%dir %{kanku_prefix}/views/
%{_unitdir}/kanku-web.service
%{_sbindir}/rckanku-web
%{kanku_prefix}/views/admin.tt
%{kanku_prefix}/views/guest.tt
%{kanku_prefix}/views/index.tt
%{kanku_prefix}/views/job.tt
%{kanku_prefix}/views/notify.tt
%{kanku_prefix}/views/notify_disabled.tt
%{kanku_prefix}/views/job_history.tt
%{kanku_prefix}/views/job_result.tt
%dir %{kanku_prefix}/views/layouts
%{kanku_prefix}/views/layouts/main.tt
%{kanku_prefix}/views/login.tt
%dir %{kanku_prefix}/views/login
%{kanku_prefix}/views/login/denied.tt
%{kanku_prefix}/views/admin.tt
%{kanku_prefix}/views/settings.tt
%{kanku_prefix}/views/signup.tt
%{kanku_prefix}/views/pwreset.tt
%{kanku_prefix}/views/reset_password.tt
%dir /etc/apache2
%dir /etc/apache2/conf.d
%ghost %config (noreplace) /etc/apache2/conf.d/kanku.conf
# public contains css/js/bootstrap/jquery etc
%{kanku_prefix}/public/
%{kanku_prefix}/lib/Kanku.pm
%{kanku_prefix}/lib/Kanku/REST.pm
%package worker
Summary: Worker daemon for kanku
Requires: kanku-common
Requires: kanku-common-server
Requires: perl(Net::AMQP::RabbitMQ)
Requires: perl(UUID)
Requires: perl(Sys::CPU)
Requires: perl(Sys::LoadAvg)
Requires: perl(Sys::MemInfo)
%description worker
A simple remote worker for kanku based on RabbitMQ
%pre worker
%service_add_pre kanku-worker.service
%post worker
%service_add_post kanku-worker.service
%preun worker
%service_del_preun kanku-worker.service
%postun worker
%service_del_postun kanku-worker.service
%files worker
%{_unitdir}/kanku-worker.service
%{_sbindir}/rckanku-worker
%{kanku_prefix}/bin/kanku-worker
%{kanku_prefix}/lib/Kanku/Daemon/Worker.pm
%package dispatcher
Summary: Dispatcher daemon for kanku
Requires: kanku-common
Requires: kanku-common-server
Requires: perl(Net::AMQP::RabbitMQ)
Requires(pre): sudo
Recommends: rabbitmq-server
%description dispatcher
A simple dispatcher for kanku based on RabbitMQ
%pre dispatcher
%service_add_pre kanku-dispatcher.service
%post dispatcher
%service_add_post kanku-dispatcher.service
%preun dispatcher
%service_del_preun kanku-dispatcher.service
%postun dispatcher
%service_del_postun kanku-dispatcher.service
%files dispatcher
%{_unitdir}/kanku-dispatcher.service
%{_sbindir}/rckanku-dispatcher
%{kanku_prefix}/bin/kanku-dispatcher
%{kanku_prefix}/lib/Kanku/Daemon/Dispatcher.pm
%{kanku_prefix}/lib/Kanku/Dispatch/RabbitMQ.pm
%{kanku_prefix}/views/notifier/
%package scheduler
Summary: Scheduler daemon for kanku
Requires: kanku-common
Requires: kanku-common-server
%description scheduler
A simple scheduler for kanku based on RabbitMQ
%pre scheduler
%service_add_pre kanku-scheduler.service
%post scheduler
%service_add_post kanku-scheduler.service
%preun scheduler
%service_del_preun kanku-scheduler.service
%postun scheduler
%service_del_postun kanku-scheduler.service
%files scheduler
%attr(755,root,root) %{kanku_prefix}/bin/kanku-scheduler
%{kanku_prefix}/lib/Kanku/Daemon/Scheduler.pm
%{_unitdir}/kanku-scheduler.service
%{_sbindir}/rckanku-scheduler
%package triggerd
Summary: Trigger daemon for kanku
Requires: kanku-common
Requires: kanku-common-server
%description triggerd
A simple triggerd for kanku based on RabbitMQ
%pre triggerd
%service_add_pre kanku-triggerd.service
%post triggerd
%service_add_post kanku-triggerd.service
%preun triggerd
%service_del_preun kanku-triggerd.service
%postun triggerd
%service_del_postun kanku-triggerd.service
%files triggerd
%attr(755,root,root) %{kanku_prefix}/bin/kanku-triggerd
%dir %{kanku_prefix}/lib/Kanku/Listener
%{kanku_prefix}/lib/Kanku/Daemon/TriggerD.pm
%{kanku_prefix}/lib/Kanku/Listener/RabbitMQ.pm
%{_unitdir}/kanku-triggerd.service
%{_sbindir}/rckanku-triggerd
%package doc
Summary: Documentation files for kanku
%description doc
This package contains the documentation files for kanku
%files doc
%{_defaultdocdir}/kanku/
%changelog