# Temporary workaround %global ruby_vendorlibdir /usr/share/ruby/vendor_ruby Name: bughunting Version: 2024.1 Release: 2%{?dist} Summary: Red Hat Bughunting Competition client tools License: MIT URL: https://gitlab.com/bughunting/bughunting/ Source0: %{name}-%{version}.txz BuildArch: noarch BuildRequires: ruby-devel BuildRequires: rubygem(test-unit) BuildRequires: rubygem(term-ansicolor) BuildRequires: rubygem(rspec) BuildRequires: rubygem(xmlrpc) BuildRequires: rubygem(puma) BuildRequires: rubygem(rexml) BuildRequires: %{_bindir}/make Requires: ruby(release) Requires: rubygem(term-ansicolor) Requires: rubygem(xmlrpc) Requires: rubygem(puma) Requires: rubygem(rexml) %description %package client Summary: Red Hat Bughunting Competition client tools Requires: %{name} = %{version}-%{release} %description client %package server Summary: Red Hat Bughunting Competition server and development tools Requires(pre): shadow-utils Requires(post): openssh Requires: %{name} = %{version}-%{release} Requires: ruby %if 0%{?fedora} > 0 # This %%if fork is here to allow installing # bughunting-server package on RHEL machines to do testing by huntlocal. Requires: rubygem(sinatra) %endif Requires: rubygem(sqlite3) Requires: rubygem(json) Requires: rubygem(haml) Requires: sudo # /usr/sbin/ip Requires: iproute %description server %prep %setup -q %build %install make install DESTDIR=%{buildroot} # create directory for SSH keys and touch files generated during installation mkdir -p %{buildroot}%{_sysconfdir}/%{name} touch %{buildroot}%{_sysconfdir}/%{name}/remote_id_rsa touch %{buildroot}%{_sysconfdir}/%{name}/remote_id_rsa.pub %check # Let's do syntax check, as the test suite coverage is poor find -type f -name '*.rb' \ | xargs -P0 -i bash -c "{ ruby -c '{}' 2>&1 || exit 255 } | grep -v '^Syntax OK$' ;:" find -type f -name '*.sh' \ | xargs -P0 -i bash -c " bash -n '{}' 2>&1 || exit 255 " ruby -Isrc -e 'Dir.glob "./tests/test_*.rb", &method(:require)' rspec spec %pre server getent passwd bughunting-server >/dev/null || useradd -U -M -u 1018 -d %{_sharedstatedir}/%{name}/ bughunting-server # users for jail (not the users that are on clients or client machine names) for user in bughunting{1..31} ; do getent passwd $user >/dev/null || useradd -M -d /dev/null -s /sbin/nologin $user done %preun server # Uninstall if [ $1 == 0 ];then getent passwd bughunting-server >/dev/null && userdel bughunting-server for user in bughunting{1..31} ; do getent passwd $user >/dev/null && userdel $user done fi %pre client getent passwd bughunting >/dev/null || useradd -U -M -u 1050 bughunting %preun client # Uninstall if [ $1 == 0 ];then getent passwd bughunting >/dev/null && userdel bughunting fi %post server # server installation if [ $1 -eq 1 ]; then # lets generate SSH keys ssh-keygen -f %{_sysconfdir}/%{name}/remote_id_rsa -t rsa -N '' -C bughunting > /dev/null fi %postun server # Uninstall if [ $1 == 0 ];then rm -f %{_sysconfdir}/%{name}/remote_id_rsa fi %files %doc README %dir %attr(-, bughunting-server, bughunting-server) %{_sharedstatedir}/%{name}/ %dir %{_sysconfdir}/bughunting %dir %{ruby_vendorlibdir}/bughunting %dir %{_datadir}/bughunting %{ruby_vendorlibdir}/bughunting/common/ %{ruby_vendorlibdir}/bughunting/common.rb %dir %{_datadir}/%{name}/scripts %files client %config(noreplace) %{_sysconfdir}/bughunting/client.yml %{ruby_vendorlibdir}/bughunting/client/ %{_bindir}/hunt %{_datadir}/%{name}/scripts/entry-copy-tasks.sh %files server %dir %attr(-, bughunting-server, bughunting-server) %{_sharedstatedir}/%{name}/ %dir %attr(-, bughunting-server, bughunting-server) %{_sharedstatedir}/%{name}/archive %config(noreplace) %{_sysconfdir}/%{name}/server.yml %ghost %config(noreplace) %{_sysconfdir}/%{name}/remote_id_rsa %ghost %config(noreplace) %{_sysconfdir}/%{name}/remote_id_rsa.pub %{ruby_vendorlibdir}/%{name}/check/ %{ruby_vendorlibdir}/%{name}/devel/ %{ruby_vendorlibdir}/%{name}/install/ %{ruby_vendorlibdir}/%{name}/server/ %{_bindir}/huntserver %{_bindir}/huntinstall %{_bindir}/huntlocal %{_bindir}/huntdebug %{_datadir}/%{name}/scripts/*.sh %{_datadir}/%{name}/scripts/*.rb #web part %config(noreplace) %{_sysconfdir}/bughunting/web.yml %{_datadir}/%{name}/web %{ruby_vendorlibdir}/%{name}/web/ %changelog * Tue Jul 30 2024 Pavel Valena - 2024.1-2 - Build #2 for Fix Code 2024. * Mon Jul 22 2024 Pavel Valena - 2024.1-1 - Initial build for Fix Code 2024 * Tue Oct 03 2023 Pavel Valena - 2023.2-5 - rebuild test * Wed Jul 26 2023 Pavel Valena - 2023.2-4 - Final build #2 for FixCode 2023 * Wed Jul 26 2023 Pavel Valena - 2023.2-3 - Final build for FixCode 2023 * Tue Jul 18 2023 Pavel Valena - 2023.2-2 - Build for FixCode 2023 * Fri Mar 10 2023 Pavel Valena - 2023.1-1 - Build for Ideas 2023 * Mon Oct 31 2022 Pavel Valena - 2022.6-1 - DevConf.cz 2022/11 * Tue Aug 09 2022 Pavel Valena - 2022.4-3 - rebuilt * Mon Aug 08 2022 Pavel Valena - 2022.4-2 - Build for Fix Code 2022 * Mon Aug 08 2022 Pavel Valena - 2022.3-5 - Build for DevConf.CZ mini June 2022. * Fri Apr 08 2022 Pavel Valena - 2022.2-3 - Build for Open House 2022. * Mon Jan 24 2022 Pavel Valena - 2022.1-7 - Build for DevConf.CZ 2022 * Tue Aug 10 2021 Pavel Valena - 2021.5-4 - Refresh spec file. * Fri Apr 06 2018 Tomas Hozza - 2018.0-1 - Add rubygem(xmlrpc) as a dependency of the main bughunting package * Mon Mar 05 2018 Honza Horak - 2017.0-3 - Add rubygem(xmlrpc) as a dependency of the server * Thu Mar 23 2017 Pavel Raiskup - 2017.0-2 - require rubygem haml * Thu Mar 16 2017 Tomas Hozza - 2017.0-1 - bumped version for 2017 - generate SSH RSA keys when server is installed - minor SPEC edits to use macros instead of hardcoded values * Wed Apr 06 2016 Pavel Raiskup - 2016.0-6 - bump version for client? fixes * Wed Mar 09 2016 Pavel Raiskup - 2016.0-5 - fix installation on RHEL7 * Wed Mar 09 2016 Michal Luscon - 2016.0-3 - add bughunting requirement for server subpackage * Wed Mar 09 2016 Pavel Raiskup - 2016.0-2 - new version FY2016 - don't require non-existing web subpackage * Sun Mar 29 2015 Pavel Raiskup - 2015.0-2 - resolve rhbz#1167767 issues * Thu Mar 19 2015 Michal Luscon - 2015.0-1 - new version 2015 * Wed Aug 27 2014 Michal Luscon - 2014.0-7 - merge bughunting-server and bughunting-web packages * Fri Apr 04 2014 Pavel Raiskup - 2014.0-6 - from now deploy general dependencies via ks * Wed Apr 02 2014 Pavel Raiskup - 2014.0-5 - install manuals on client * Mon Mar 31 2014 Pavel Raiskup - 2014.0-4 - huntserver does not work without *-web package * Sat Mar 29 2014 Pavel Raiskup - 2014.0-3 - install "library" file needed for bug-hunters confusion * Fri Mar 07 2014 Michal Luscon - 2014.0-2 - huntinstall: use task directory from server config - update INSTALL and README * Wed Jan 29 2014 Pavel Raiskup - 2014.0-1 - try to init for 2014 round * Mon Apr 08 2013 Pavel Raiskup - 2013.0-1 - fix ruby requirement (I'm not ruby guru but according to fedora guidelines this should be ok) * Wed Apr 04 2012 Jan Vcelak 2012.0-10 - server fixes * Wed Apr 04 2012 Jan Vcelak 2012.0-9 - client fixes, qa tasks evaluation fixes * Wed Apr 04 2012 Jan Vcelak 2012.0-8 - testround 2 fixes * Tue Apr 03 2012 Jan Vcelak 2012.0-7 - testround 1 fixes * Tue Apr 03 2012 Jan Vcelak 2012.0-6 - client fixes * Tue Apr 03 2012 Jan Vcelak 2012.0-5 - update config files * Tue Apr 03 2012 Jan Vcelak 2012.0-4 - subpackage components * Fri Mar 23 2012 Jan Vcelak 2012.0-3 - remove tasks subpackage, will be supplied separately * Wed Mar 21 2012 Jan Vcelak 2012.0-2 - some updates in local tools * Tue Mar 20 2012 Jan Vcelak 2012.0-1 - initial release for 2012