Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.8
obs-server
obs-server.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server.spec of Package obs-server
# # spec file for package obs-server # # Copyright (c) 2014 SUSE LINUX Products 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/ # %if 0%{?fedora} || 0%{?rhel} %global apache_user apache %global apache_group apache %bcond_without selinux %else %global apache_user wwwrun %global apache_group www %bcond_with selinux %endif %if !0%{?_httpd_confdir:1} %define _httpd_confdir %{_sysconfdir}/httpd/conf.d %endif %define secret_key_file %{_datadir}/obs-api/config/secret.key %if 0%{?suse_version} >= 1315 %define reload_on_update() %{?nil: test -n "$FIRST_ARG" || FIRST_ARG=$1 if test "$FIRST_ARG" -ge 1 ; then test -f /etc/sysconfig/services && . /etc/sysconfig/services if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then test -x /bin/systemctl && /bin/systemctl daemon-reload >/dev/null 2>&1 || : for service in %{?*} ; do test -x /bin/systemctl && /bin/systemctl reload $service >/dev/null 2>&1 || : done fi fi %nil } %endif # Macros for Suse compatibility. %if 0%{?fedora} || 0%{?rhel} %define enable_services() %{?nil: for service in %{?*}; do /sbin/chkconfig --add $service done %{nil} } %else %define enable_services() %{nil} %endif %if !0%{?stop_on_removal:1} %if 0%{?fedora} || 0%{?rhel} %define stop_on_removal() %{?nil: if [ "$1" = 0 ]; then for service in %{?*}; do /sbin/service $service stop >/dev/null 2>&1 /sbin/chkconfig --del $service done fi %{nil} } %else %define stop_on_removal() %{nil} %endif %endif %if !0%{?restart_on_update:1} %if 0%{?fedora} || 0%{?rhel} %define restart_on_update() %{?nil: if [ "$1" -ge 1 ]; then for service in %{?*}; do /sbin/service $service condrestart >/dev/null 2>&1 done fi %{nil} } %else %define restart_on_update() %{nil} %endif %endif %if !0%{?reload_on_update:1} %if 0%{?fedora} || 0%{?rhel} %define reload_on_update() %{?nil: if [ "$1" -ge 1 ]; then for service in %{?*}; do /sbin/service $service reload >/dev/null 2>&1 done fi %{nil} } %else %define restart_on_update() %{nil} %endif %endif %if !0%{?run_permissions:1} %define run_permissions() %{nil} %endif %if !0%{?fillup_and_insserv:1} %define fillup_and_insserv(n:) %{nil} %endif %if !0%{?insserv_cleanup:1} %define insserv_cleanup() %{nil} %endif %if !0%{?verifyscript:1} %define verifyscript(n:) %{nil} %endif %if !0%{?verify_permissions:1} %define verify_permissions() %{nil} %endif %if 0%{fedora} < 27 %define patches_to_apply %(a=(%{patches}); echo ${a[@]:0:((${#a[@]}-16))}) %else %define patches_to_apply %{patches} %endif Name: obs-server Summary: The Open Build Service -- Server Component License: GPL-2.0 and GPL-3.0 %if 0%{?suse_version} < 1210 && 0%{?suse_version:1} Group: Productivity/Networking/Web/Utilities %endif Version: 2.8.4 Release: 1 Url: http://www.openbuildservice.org BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: https://github.com/openSUSE/open-build-service/archive/%{version}/open-build-service-%{version}.tar.gz Source1: find-requires.sh Source2: obs-server-rc-compat Source3: crawler-user-agents.json Patch1: obs-server-2.8-0001-api-Use-bundler_ext-instead-of-bundler-if-Gemfile.in.patch Patch2: obs-server-2.8-0002-api-Require-json-gem-explicitly-for-tests.patch Patch3: obs-server-2.8-0003-api-Log-server-name-to-test-log-for-backend-log-mess.patch Patch4: obs-server-2.8-0004-api-Use-OBS_API_PREFIX-instead-of-explicit-pathname-.patch Patch5: obs-server-2.8-0005-backend-Make-OBS_BACKEND_DATA_DIR-variable-configura.patch Patch6: obs-server-2.8-0006-dist-Set-proper-Apache-user-group-when-installing-sc.patch Patch7: obs-server-2.8-0007-backend-Set-proper-pathnames-when-installing-backend.patch Patch8: obs-server-2.8-0008-dist-Set-proper-pathnames-when-installing-dist-files.patch Patch9: obs-server-2.8-0009-dist-Use-configuration-variables-instead-of-hardcode.patch Patch10: obs-server-2.8-0010-api-Use-absolute-pathnames-for-apidocs-in-config-env.patch Patch11: obs-server-2.8-0011-dist-Make-fillup-file-location-and-name-configurable.patch Patch12: obs-server-2.8-0012-dist-Make-obs-devel-doc-location-configutrable.patch Patch13: obs-server-2.8-0013-backend-Fix-cleanup-in-BSSched-EventSource-Directory.patch Patch14: obs-server-2.8-0014-api-Autodetect-mysqld-and-memcached-pathname-for-api.patch Patch15: obs-server-2.8-0015-api-Specify-mysqld-pidfile-explicitly-for-api-test.patch Patch16: obs-server-2.8-0016-webui-Wait-for-flash-message-to-appear-in-webui-test.patch Patch17: obs-server-2.8-0017-dist-Make-tests-respect-INITDDIR-and-SBINDIR-configu.patch Patch18: obs-server-2.8-0018-dist-api-backend-Make-backend-ports-configurable.patch Patch19: obs-server-2.8-0019-dist-backend-Make-backend-log-directory-configurable.patch Patch20: obs-server-2.8-0020-api-Make-api-log-directory-configurable.patch Patch21: obs-server-2.8-0021-api-Don-t-require-specific-version-of-minitest.patch Patch22: obs-server-2.8-0022-dist-Allow-worker-to-use-tmpfs-for-other-virtualisat.patch Patch24: obs-server-2.8-0024-api-Require-less-specific-version-of-nokogiri-Ruby-g.patch Patch25: obs-server-2.8-0025-ci-Fix-compatibility-with-Ruby-2.3-in-webui-helper-t.patch Patch26: obs-server-2.8-0026-api-Require-less-specific-version-of-rspec-rails-Rub.patch Patch27: obs-server-2.8-0027-backend-fix-perl-syntax.patch Patch28: obs-server-2.8-0028-backend-bs_dodup-use-the-testcaseformat-option-to-ge.patch Patch101: obs-server-2.8-0101-api-Drop-exception-handling-for-ActionController-Red.patch Patch102: obs-server-2.8-0102-ci-Rails-5.1-Fix-test-failure-caused-by-url_for-chan.patch Patch103: obs-server-2.8-0103-ci-Rails-5.1-Update-overwrite-of-ActionDispatch-Inte.patch Patch104: obs-server-2.8-0104-api-webui-Rails-5.1-Remove-calling-render-with-text.patch Patch105: obs-server-2.8-0105-api-dist-Update-to-rails-version-5.1.patch Patch106: obs-server-2.8-0106-api-Rails-5.1-Replace-HoptoadNotifier-by-airbrake.patch Patch107: obs-server-2.8-0107-ci-Rails-5.1-Fix-test-failure-caused-by-missing-requ.patch Patch108: obs-server-2.8-0108-ci-Update-code-quality-test.patch Patch109: obs-server-2.8-0109-ci-Rails-5.1-Update-intialization-of-ActionControlle.patch Patch110: obs-server-2.8-0110-api-Only-enable-airbrake-when-there-is-a-project-id-.patch Patch111: obs-server-2.8-0111-dist-Add-migration-rails-env-to-airbrake-ignore-list.patch Patch112: obs-server-2.8-0112-api-webui-Drop-monkeypatch-of-ActiveRecord.patch Patch113: obs-server-2.8-0113-ci-api-Remove-deprecation-warning-in-migrations.patch Patch114: obs-server-2.8-0114-api-Add-rails-version-to-all-migrations.patch Patch115: obs-server-2.8-0115-ci-Fix-Rails-HttpPositionalArguments.patch Patch116: obs-server-2.8-0116-ci-xhr-is-deprecated.patch BuildRequires: python-devel # make sure this is in sync with the RAILS_GEM_VERSION specified in the # config/environment.rb of the various applications. # atm the obs rails version patch above unifies that setting among the applications # also see requires in the obs-server-api sub package BuildRequires: build >= 20160304 BuildRequires: inst-source-utils BuildRequires: perl(BSSolv) >= 0.07 BuildRequires: perl-Compress-Zlib BuildRequires: perl-Diff-LibXDiff BuildRequires: perl-File-Sync >= 0.10 BuildRequires: perl-JSON-XS BuildRequires: perl-Net-SSLeay BuildRequires: perl-Socket-MsgHdr BuildRequires: perl-TimeDate BuildRequires: perl-XML-Parser BuildRequires: perl-XML-Simple BuildRequires: perl(Digest::MD5) BuildRequires: perl(Digest::SHA) BuildRequires: perl(Devel::Cover) BuildRequires: perl(Test::Simple) > 1 BuildRequires: perl(Test::Harness) BuildRequires: perl(Archive::Tar) BuildRequires: procps BuildRequires: /usr/bin/Xvfb Requires(pre): %{_sbindir}/useradd %{_sbindir}/groupadd BuildArch: noarch Requires: obs-common Requires: build >= 20160304 Requires: obs-productconverter >= %version Requires: perl(BSSolv) >= 0.07 # Required by source server Requires: diffutils Requires(pre): git-core Requires: patch %if 0%{?suse_version:1} # require the createrepo and python-yum version which got validated during testsuite run Requires: %(/bin/bash -c 'rpm -q --qf "%%{name} = %%{version}-%%{release}" createrepo') Requires: %(/bin/bash -c 'rpm -q --qf "%%{name} = %%{version}-%%{release}" python-yum') %else Requires: createrepo >= 0.10.4 Requires: yum %endif BuildRequires: xz %if 0%{?suse_version:1} BuildRequires: fdupes PreReq: %insserv_prereq permissions pwdutils %endif %if 0%{?fedora} || 0%{?rhel} Requires: chkconfig %endif %if 0%{?suse_version:1} Recommends: yum yum-metadata-parser repoview dpkg Recommends: deb >= 1.5 Recommends: lvm2 Recommends: openslp-server Recommends: obs-signd Recommends: inst-source-utils Recommends: perl-Diff-LibXDiff %else Requires: dpkg Requires: yum Requires: yum-metadata-parser %endif Requires: perl-Compress-Zlib Requires: perl-File-Sync >= 0.10 Requires: perl-JSON-XS Requires: perl-Net-SSLeay Requires: perl-Socket-MsgHdr Requires: perl-XML-Parser Requires: perl-XML-Simple Requires: perl(Digest::MD5) Requires: perl(Digest::SHA) Requires: perl(Archive::Tar) %if %{with selinux} BuildRequires: selinux-policy-devel BuildRequires: checkpolicy %endif %description The Open Build Service (OBS) backend is used to store all sources and binaries. It also calculates the need for new build jobs and distributes it. %package -n obs-worker Requires: obs-common Requires: cpio Requires: curl Requires: perl-Compress-Zlib Requires: perl-TimeDate Requires: perl-XML-Parser Requires: screen # for build script Requires: psmisc # For runlevel script: Requires: curl Recommends: openslp lvm2 Requires: bash Requires: binutils Requires: bsdtar Summary: The Open Build Service -- Build Host Component %if 0%{?suse_version} && 0%{?suse_version} < 1210 Group: Productivity/Networking/Web/Utilities %endif %if 0%{?suse_version} PreReq: %insserv_prereq %endif %if 0%{?suse_version} <= 1030 Requires: lzma %endif Requires: util-linux >= 2.16 # the following may not even exist depending on the architecture Recommends: powerpc32 %description -n obs-worker This is the obs build host, to be installed on each machine building packages in this obs installation. Install it alongside obs-server to run a local playground test installation. %package -n obs-common Summary: The Open Build Service -- base configuration files %if 0%{?suse_version} && 0%{?suse_version} < 1210 Group: Productivity/Networking/Web/Utilities %endif %if 0%{?suse_version} PreReq: %fillup_prereq %endif %description -n obs-common This is a package providing basic configuration files. %package -n obs-api Summary: The Open Build Service -- The API and WEBUI %if 0%{?suse_version} && 0%{?suse_version} < 1210 Group: Productivity/Networking/Web/Utilities %endif %if 0%{?suse_version} PreReq: %insserv_prereq %endif Requires: obs-common %if 0%{?fedora} >= 19 Requires: ruby(release) Requires: ruby(rubygems) %endif %if 0%{?suse_version:1} #For apache Requires: apache2 apache2-mod_xforward rubygem-passenger-apache2 ruby2.4-rubygem-passenger %endif # memcache is required for session data Requires: memcached Conflicts: memcached < 1.4 # For local runs BuildRequires: rubygem(sqlite3) Requires: mysql %if %{with selinux} Requires: policycoreutils %endif Requires: ruby >= 2.0 # needed for fulltext searching Requires: sphinx >= 2.1.8 BuildRequires: obs-api-testsuite-deps = %{version} BuildRequires: rubygem(ruby-ldap) # For doc generation BuildRequires: rubygem(i18n) # for test suite: BuildRequires: createrepo >= 0.10.4 BuildRequires: curl BuildRequires: memcached >= 1.4 BuildRequires: mysql BuildRequires: mysql-server BuildRequires: rubygem(ci_reporter) %if 0%{?suse_version:1} BuildRequires: netcfg BuildRequires: xorg-x11-Xvnc BuildRequires: xorg-x11-server BuildRequires: xorg-x11-server-extra %endif BuildRequires: nodejs # write down dependencies for production BuildRequires: rubygem(bundler) Requires: %(bash %{S:1} %{S:0} "production" %{patches_to_apply}) # for rebuild_time Requires: perl(GD) %if 0%{?fedora} || 0%{?rhel} Requires: chkconfig %endif %if 0%{?suse_version:1} Requires: ghostscript-fonts-std %else Requires: ghostscript-fonts %if 0%{?fedora} || 0%{?rhel} Requires: urw-fonts %endif %endif Obsoletes: obs-api-doc %if 0%{?suse_version} < 1210 && 0%{?suse_version:1} Group: Productivity/Networking/Web/Utilities %endif %description -n obs-api This is the API server instance, and the web client for the OBS. %package -n obs-devel Summary: The Open Build Service -- The API and WEBUI Testsuite %if 0%{?suse_version} < 1210 && 0%{?suse_version:1} Group: Productivity/Networking/Web/Utilities %endif Obsoletes: obs-webui-testsuite Requires: obs-api = %{version}-%{release} %requires_eq obs-api-testsuite-deps %description -n obs-devel Install to track dependencies for git %package -n obs-source_service Summary: The Open Build Service -- source service daemon %if 0%{?suse_version} < 1210 && 0%{?suse_version:1} Group: Productivity/Networking/Web/Utilities %endif # Our default services, used in osc and webui Requires: obs-common Requires: perl(XML::Structured) # Recommends: obs-service-download_url Recommends: obs-service-verify_file %if 0%{?fedora} || 0%{?rhel} Requires: chkconfig %endif %description -n obs-source_service The OBS source service is a component to modify submitted sources on the server side. This may include source checkout, spec file generation, gpg validation, quality checks and other stuff. This component is optional and not required to run the service. %package -n obs-productconverter Summary: The Open Build Service -- product definition utility %if 0%{?suse_version} < 1210 && 0%{?suse_version:1} Group: Productivity/Networking/Web/Utilities %endif # For perl library files, TODO: split out obs-lib subpackage? Requires: obs-server %description -n obs-productconverter bs_productconvert is a utility to create Kiwi- and Spec- files from a product definition. %package -n obs-utils Summary: The Open Build Service -- utilities %if 0%{?suse_version} < 1210 && 0%{?suse_version:1} Group: Productivity/Networking/Web/Utilities %endif Requires: build Requires: osc %description -n obs-utils obs_project_update is a tool to copy a packages of a project from one obs to another %package -n obs-tests-appliance Summary: The Open Build Service -- Test cases for installed appliances Requires: obs-server = %{version} Requires: obs-api = %{version} %if 0%{?suse_version} < 1210 && 0%{?suse_version:1} Group: Productivity/Networking/Web/Utilities %endif %description -n obs-tests-appliance This package contains test cases for testing a installed appliances. Test cases can be for example: * checks for setup-appliance.sh * checks if database setup worked correctly * checks if required service came up properly %package plugin-notify_hermes Summary: The Open Build Service -- notification plugin for Hermes Group: Productivity/Networking/Web/Utilities BuildArch: noarch Requires: %{name} %description plugin-notify_hermes Plugin for Open Build Service to send event notifications through Hermes notification distribution system. See http://en.opensuse.org/openSUSE:Hermes for details. %package plugin-notify_rabbitmq Summary: The Open Build Service -- notification plugin for RabbitMQ Group: Productivity/Networking/Web/Utilities BuildArch: noarch Requires: %{name} %description plugin-notify_rabbitmq Plugin for Open Build Service to send event notifications through RabbitMQ is open source message broker. See http://www.rabbitmq.com/ for details. #-------------------------------------------------------------------------------- %prep export DESTDIR=$RPM_BUILD_ROOT %setup -q -n open-build-service-%version %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 %patch20 -p1 %patch21 -p1 %patch22 -p1 %patch24 -p1 %patch25 -p1 %patch26 -p1 %patch27 -p1 %patch28 -p1 %if 0%{?fedora} >= 27 %patch101 -p1 %patch102 -p1 %patch103 -p1 %patch104 -p1 %patch105 -p1 %patch106 -p1 %patch107 -p1 %patch108 -p1 %patch109 -p1 %patch110 -p1 %patch111 -p1 %patch112 -p1 %patch113 -p1 %patch114 -p1 %patch115 -p1 %patch116 -p1 %endif # drop build script, we require the installed one from own package rm -rf src/backend/build find . -name .git\* \ -o -name Capfile \ -o -name deploy.rb \ -o -name Gemfile.lock \ | xargs rm -rf #Run the test suite with current config version cp %{SOURCE3} src/api/config/ %if 0%{?fedora} || 0%{?rhel} sed -i \ -e '1s|^#!/usr/bin/env ruby\.ruby.*|#!/usr/bin/ruby|' \ -e '1s|^#! */usr/bin/ruby\.ruby.*|#!/usr/bin/ruby|' \ docs/api/restility/bin/* \ src/api/bin/* \ src/api/script/* sed -i \ -e 's|ruby\.ruby[0-9.]*|ruby|g' \ -e 's|rake\.ruby[0-9.]*|rake|g' \ -e 's|bundle\.ruby[0-9.]*|bundle|g' \ -e 's|rspec\.ruby[0-9.]*|rspec|g' \ -e 's|clockworkd\.ruby[0-9.]*|clockworkd|g' \ dist/setup-appliance.sh \ dist/obsapidelayed \ src/api/db/migrate/*.rb \ src/api/test/unit/*.rb \ src/api/script/* \ src/api/Makefile %endif %if %{with selinux} mkdir src/selinux pushd src/selinux cat > obs-api.te <<EOF policy_module(obs-api, 1.0) require { type var_log_t; type passenger_tmp_t; type passenger_t; type httpd_t; class sock_file write; class file { ioctl open getattr append }; } #============= httpd_t ============== allow httpd_t passenger_tmp_t:sock_file write; #============= passenger_t ============== allow passenger_t var_log_t:file { ioctl open getattr append }; corenet_tcp_connect_memcache_port(passenger_t) corenet_tcp_connect_mysqld_port(passenger_t) corenet_tcp_connect_unreserved_ports(passenger_t) dev_manage_sysfs_dirs(passenger_t) init_rw_stream_sockets(passenger_t) EOF cat > obs-api.fc <<EOF /var/log/obs-api(/.*)? system_u:object_r:passenger_log_t:s0 %{_datadir}/obs-api/tmp(/.*)? system_u:object_r:passenger_tmp_t:s0 EOF popd %endif %build export DESTDIR=$RPM_BUILD_ROOT # we need it for the test suite or it may silently succeed test -x /usr/bin/Xvfb # # generate apidocs # make %if %{with selinux} pushd src/selinux make -f %{_datadir}/selinux/devel/Makefile popd %endif %install export DESTDIR=$RPM_BUILD_ROOT %if 0%{?suse_version} < 1300 perl -p -i -e 's/^APACHE_VHOST_CONF=.*/APACHE_VHOST_CONF=obs-apache2.conf/' Makefile.include %endif sed -i \ -e 's|^BINDIR=.*|BINDIR=%{_bindir}|' \ -e 's|^SBINDIR=.*|SBINDIR=%{_sbindir}|' \ -e 's|^INITDDIR=.*|INITDDIR=%{_initddir}|' \ -e 's|^OBS_BACKEND_DATA_DIR=.*|OBS_BACKEND_DATA_DIR=%{_sharedstatedir}/obs|' \ -e 's|^OBS_BACKEND_LOG_DIR=.*|OBS_BACKEND_LOG_DIR=%{_localstatedir}/log/obs|' \ -e 's|^OBS_DOCUMENT_ROOT=.*|OBS_DOCUMENT_ROOT=%{_datadir}/obs|' \ -e 's|^OBS_API_PREFIX=.*|OBS_API_PREFIX=%{_datadir}/obs-api|' \ -e 's|^OBS_API_LOG_DIR=.*|OBS_API_LOG_DIR=%{_localstatedir}/log/obs-api|' \ -e 's|^OBS_APIDOCS_PREFIX=.*|OBS_APIDOCS_PREFIX=%{_datadir}/obs-api-doc|' \ %if 0%{?fedora} || 0%{?rhel} -e 's|^OBS_FILLUP_DIR=.*|OBS_FILLUP_DIR=%{_sysconfdir}/sysconfig|' \ -e 's|^OBS_FILLUP_FILE=.*|OBS_FILLUP_FILE=obs-server|' \ -e 's|^OBS_DEVEL_DOC_DIR=.*|OBS_DEVEL_DOC_DIR=%{_docdir}/obs-devel|' \ -e 's|^OBS_SRCSERVER_PORT=.*|OBS_SRCSERVER_PORT=15352|' \ -e 's|^OBS_REPOSERVER_PORT=.*|OBS_REPOSERVER_PORT=15252|' \ -e 's|^OBS_SERVICESERVER_PORT=.*|OBS_SERVICESERVER_PORT=15152|' \ -e 's|^APACHE_USER=.*|APACHE_USER=apache|' \ -e 's|^APACHE_GROUP=.*|APACHE_GROUP=apache|' \ -e 's|^APACHE_CONIFGDIR=.*|APACHE_CONIFGDIR=/etc/httpd|' \ -e 's|^APACHE_CONIFGDIR_VHOST=.*|APACHE_CONIFGDIR_VHOST=%{_httpd_confdir}|' \ %endif Makefile.include export OBS_VERSION="%{version}" DESTDIR=%{buildroot} RAILS_RELATIVE_URL_ROOT=../.. make install # Clean messages left over from installation %{__cp} /dev/null %{buildroot}%{_localstatedir}/log/obs-api/production.log %if 0%{?fedora} || 0%{?rhel} %{__mv} %{buildroot}%{_httpd_confdir}/obs.conf %{buildroot}%{_httpd_confdir}/obs.conf.dist %endif # # turn duplicates into hard links # # There's dupes between webui and api: %if 0%{?suse_version} >= 1030 %fdupes $RPM_BUILD_ROOT%{_datadir}/obs-api $RPM_BUILD_ROOT%{_datadir}/obs-api-doc %endif # fix build for SLE 11 %if 0%{?suse_version} < 1315 touch %{buildroot}/%{secret_key_file} chmod 0640 %{buildroot}/%{secret_key_file} %endif # To get the most current user agent list we need i-net access. Thus we fetch # the file via an OBS service and install it here. install -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/obs-api/config # drop testcases for now rm -rf %{buildroot}%{_datadir}/obs-api/spec # fail when Makefiles created a directory if ! test -L %{buildroot}/usr/lib/obs/server/build; then echo "/usr/lib/obs/server/build is not a symlink!" exit 1 fi rm %{buildroot}%{_datadir}/obs-api/Gemfile.lock mv %{buildroot}%{_datadir}/obs-api/Gemfile %{buildroot}%{_datadir}/obs-api/Gemfile.in sed -i \ -e "s/'activerecord'/'active_record'/" \ -e "s/'actionmailer'/'action_mailer'/" \ -e "s/'yajl-ruby'/'yajl'/" \ %{buildroot}%{_datadir}/obs-api/Gemfile.in rm -rf %{buildroot}%{_datadir}/obs-api/.bundle %if %{with selinux} %{__mkdir_p} %{buildroot}%{_datadir}/selinux/packages/obs-api %{__install} -m644 src/selinux/obs-api.pp \ %{buildroot}%{_datadir}/selinux/packages/obs-api/obs-api.pp %endif %if !0%{?suse_version:1} install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/obs install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/obs/rc.compat sed -i \ -e 's|\. /etc/rc.status|. %{_datadir}/obs/rc.compat|' \ $RPM_BUILD_ROOT%{_initddir}/* %endif sed -i \ -e 's|/usr/bin/bundle[^ ]* exec ||' \ $RPM_BUILD_ROOT%{_initddir}/obsapidelayed %check %if 0%{?disable_obs_test_suite} echo "WARNING:" echo "WARNING: OBS test suite got skipped!" echo "WARNING:" exit 0 %endif ### TEMPORARY HACK # disabling this testsuite, since sphinx startup breaks unreliable in kvm # needs debugging and fixing rm src/api/test/functional/webui/search_controller_test.rb export TZ=GMT export LANG=C.UTF-8 export DESTDIR=$RPM_BUILD_ROOT # check installed backend pushd $RPM_BUILD_ROOT/usr/lib/obs/server/ rm -rf build ln -sf /usr/lib/build build # just for %%check, it is a %%ghost popd # run in build environment pushd src/backend/ rm -rf build ln -sf /usr/lib/build build popd #### # start backend testing pushd $RPM_BUILD_ROOT/usr/lib/obs/server/ %if 0%{?disable_obs_backend_test_suite:1} < 1 # TODO: move syntax check to backend test suite for i in bs_*; do perl -wc "$i" done bash $RPM_BUILD_DIR/open-build-service-%version/src/backend/testdata/test_dispatcher || exit 1 popd make -C src/backend test %endif #### # start api testing # %if 0%{?disable_obs_frontend_test_suite:1} < 1 make -C src/api test %endif #### # distribution tests %if 0%{?disable_obs_dist_test_suite:1} < 1 make -C dist test %endif %pre -n obs-common getent group obsrun >/dev/null || %{_sbindir}/groupadd -r obsrun getent passwd obsrun >/dev/null || \ %{_sbindir}/useradd -r -g obsrun -d /usr/lib/obs -s %{_sbindir}/nologin \ -c "User for build service backend" obsrun exit 0 %preun %stop_on_removal obssrcserver obsrepserver obsdispatcher obsscheduler obspublisher obswarden obssigner obsdodup obsdeltastore obsservicedispatch %preun -n obs-worker %stop_on_removal obsworker %post %enable_services obssrcserver obsrepserver obsdispatcher obsscheduler obspublisher obswarden obssigner obsdodup obsdeltastore %if 0%{?suse_version} >= 1315 %reload_on_update obssrcserver obsrepserver obsdispatcher obspublisher obswarden obssigner obsdodup obsdeltastore obsservicedispatch %else %restart_on_update obssrcserver obsrepserver obsdispatcher obspublisher obswarden obssigner obsdodup obsdeltastore obsservicedispatch %endif %restart_on_update obsscheduler %pre -n obs-source_service getent passwd obsservicerun >/dev/null || \ %{_sbindir}/useradd -r -g obsrun -d /usr/lib/obs -s %{_sbindir}/nologin \ -c "User for the build service source service" obsservicerun exit 0 %preun -n obs-source_service %stop_on_removal obsservice %post -n obs-source_service %enable_services obsservice %if 0%{?suse_version} >= 1315 %reload_on_update obsservice %else %restart_on_update obsservice %endif %posttrans # this changes from directory to symlink. rpm can not handle this itself. if [ -e /usr/lib/obs/server/build -a ! -L /usr/lib/obs/server/build ]; then rm -rf /usr/lib/obs/server/build fi if [ ! -e /usr/lib/obs/server/build ]; then ln -sf ../../build /usr/lib/obs/server/build fi %postun %insserv_cleanup %verifyscript -n obs-server %verify_permissions # cleanup empty directory just in case rmdir %{_sharedstatedir}/obs 2> /dev/null || : %post -n obs-worker %enable_services obsworker # NOT used on purpose: restart_on_update obsworker # This can cause problems when building chroot # and bs_worker is anyway updating itself at runtime based on server code %pre -n obs-api getent passwd obsapidelayed >/dev/null || \ %{_sbindir}/useradd -r -s /bin/bash -c "User for build service api delayed jobs" \ -d %{_datadir}/obs-api -g %{apache_group} obsapidelayed %post -n obs-common %enable_services obsstoragesetup %{fillup_and_insserv -n obs-server} %post -n obs-api if [ ! -e %{secret_key_file} ]; then pushd . cd %{_datadir}/obs-api/config ( umask 0077; cd %{_datadir}/obs-api && RAILS_ENV=production rake secret > %{secret_key_file} ) || exit 1 popd fi chmod 0640 %{secret_key_file} chown root.%{apache_group} %{secret_key_file} # update config sed -i -e 's,[ ]*adapter: mysql$, adapter: mysql2,' %{_datadir}/obs-api/config/database.yml touch %{_localstatedir}/log/obs-api/production.log chown %{apache_user}:%{apache_group} %{_localstatedir}/log/obs-api/production.log %if %{with selinux} semodule -i %{_datadir}/selinux/packages/obs-api/obs-api.pp restorecon -R %{_localstatedir}/log/obs-api %endif %restart_on_update apache2 %restart_on_update memcached %restart_on_update obsapisetup %restart_on_update obsapidelayed su %{apache_user} -s /bin/sh -c 'cd %{_datadir}/obs-api && RAILS_ENV=production rake db:migrate' %postun -n obs-api %insserv_cleanup %if %{with selinux} test "$1" -eq 0 && semodule -r obs-api >/dev/null 2>&1 || : %endif %files %defattr(-,root,root) %doc dist/{README.UPDATERS,README.SETUP} docs/openSUSE.org.xml ReleaseNotes-* README.md COPYING AUTHORS %dir /etc/slp.reg.d %dir /usr/lib/obs %dir /usr/lib/obs/server /etc/logrotate.d/obs-server %{_initddir}/obsdispatcher %{_initddir}/obspublisher %{_initddir}/obsrepserver %{_initddir}/obsscheduler %{_initddir}/obssrcserver %{_initddir}/obswarden %{_initddir}/obsdodup %{_initddir}/obsdeltastore %{_initddir}/obsservicedispatch %{_initddir}/obssigner %{_sbindir}/obs_admin %{_sbindir}/obs_serverstatus %{_sbindir}/rcobsdispatcher %{_sbindir}/rcobspublisher %{_sbindir}/rcobsrepserver %{_sbindir}/rcobsscheduler %{_sbindir}/rcobssrcserver %{_sbindir}/rcobswarden %{_sbindir}/rcobsdodup %{_sbindir}/rcobsdeltastore %{_sbindir}/rcobsservicedispatch %{_sbindir}/rcobssigner %dir /usr/lib/obs/server/plugins /usr/lib/obs/server/BSDispatcher /usr/lib/obs/server/BSRepServer /usr/lib/obs/server/BSSched /usr/lib/obs/server/BSSrcServer /usr/lib/obs/server/XML /usr/lib/obs/server/*.pm /usr/lib/obs/server/BSConfig.pm.template /usr/lib/obs/server/DESIGN /usr/lib/obs/server/License /usr/lib/obs/server/README /usr/lib/obs/server/bs_admin /usr/lib/obs/server/bs_cleanup /usr/lib/obs/server/bs_archivereq /usr/lib/obs/server/bs_check_consistency /usr/lib/obs/server/bs_deltastore /usr/lib/obs/server/bs_servicedispatch /usr/lib/obs/server/bs_dodup /usr/lib/obs/server/bs_getbinariesproxy /usr/lib/obs/server/bs_mergechanges /usr/lib/obs/server/bs_mkarchrepo /usr/lib/obs/server/bs_dispatch /usr/lib/obs/server/bs_publish /usr/lib/obs/server/bs_repserver /usr/lib/obs/server/bs_sched /usr/lib/obs/server/bs_serverstatus /usr/lib/obs/server/bs_srcserver /usr/lib/obs/server/bs_worker /usr/lib/obs/server/bs_signer /usr/lib/obs/server/bs_warden /usr/lib/obs/server/worker /usr/lib/obs/server/worker-deltagen.spec %config(noreplace) /usr/lib/obs/server/BSConfig.pm %config(noreplace) /etc/slp.reg.d/* %dir %attr(-,obsrun,obsrun) %{_sharedstatedir}/obs %dir %attr(-,obsrun,obsrun) %{_localstatedir}/log/obs %attr(-,obsrun,obsrun) %{_sharedstatedir}/obs/log # created via %%post, since rpm fails otherwise while switching from # directory to symlink %ghost /usr/lib/obs/server/build %files -n obs-source_service %defattr(-,root,root) %{_initddir}/obsservice /etc/logrotate.d/obs-source_service /etc/cron.d/cleanup_scm_cache %{_sbindir}/rcobsservice /usr/lib/obs/server/bs_service /usr/lib/obs/server/call-service-in-docker.sh /usr/lib/obs/server/cleanup_scm_cache # add obsservicerun user into docker group if docker # gets installed %triggerin -n obs-source_service -- docker %{_sbindir}/usermod -a -G docker obsservicerun %files -n obs-worker %defattr(-,root,root) %{_initddir}/obsworker %{_sbindir}/rcobsworker %dir %attr(-,obsrun,obsrun) %{_sharedstatedir}/obs %dir %attr(-,obsrun,obsrun) %{_localstatedir}/log/obs %files -n obs-api %defattr(-,root,root) %doc dist/{README.UPDATERS,README.SETUP} docs/openSUSE.org.xml ReleaseNotes-* README.md COPYING AUTHORS %{_datadir}/obs/overview %{_datadir}/obs-api/config/thinking_sphinx.yml.example %config(noreplace) %{_datadir}/obs-api/config/thinking_sphinx.yml %attr(-,%{apache_user},%{apache_group}) %config(noreplace) %{_datadir}/obs-api/config/production.sphinx.conf %dir %{_datadir}/obs-api %dir %{_datadir}/obs-api/config %config(noreplace) %{_datadir}/obs-api/config/cable.yml %config(noreplace) %{_datadir}/obs-api/config/feature.yml %config(noreplace) %{_datadir}/obs-api/config/puma.rb %config(noreplace) %{_datadir}/obs-api/config/secrets.yml %config(noreplace) %{_datadir}/obs-api/config/spring.rb %config(noreplace) %{_datadir}/obs-api/config/crawler-user-agents.json %{_datadir}/obs-api/config/initializers %dir %{_datadir}/obs-api/config/environments %dir %{_datadir}/obs-api/files %dir %{_datadir}/obs-api/db %{_datadir}/obs-api/db/checker.rb %{_datadir}/obs-api/Gemfile.in %{_datadir}/obs-api/config.ru %{_datadir}/obs-api/config/application.rb %{_datadir}/obs-api/config/clock.rb /etc/logrotate.d/obs-api %{_initddir}/obsapidelayed %{_initddir}/obsapisetup %{_sbindir}/rcobsapisetup %{_sbindir}/rcobsapidelayed %{_datadir}/obs-api/app %attr(-,%{apache_user},%{apache_group}) %{_datadir}/obs-api/db/structure.sql %{_datadir}/obs-api/db/attribute_descriptions.rb %{_datadir}/obs-api/db/data %{_datadir}/obs-api/db/migrate %{_datadir}/obs-api/db/seeds.rb %{_datadir}/obs-api/files/wizardtemplate.spec %{_datadir}/obs-api/lib %{_datadir}/obs-api/public %{_datadir}/obs-api/Rakefile %{_datadir}/obs-api/script %{_datadir}/obs-api/bin %{_datadir}/obs-api/test %{_datadir}/obs-api-doc %{_datadir}/obs-api/config/locales %{_datadir}/obs-api/vendor # # some files below config actually are _not_ config files # so here we go, file by file # %{_datadir}/obs-api/config/boot.rb %{_datadir}/obs-api/config/routes.rb %{_datadir}/obs-api/config/environments/development.rb %{_datadir}/obs-api/config/unicorn %attr(0640,root,%apache_group) %config(noreplace) %verify(md5) %{_datadir}/obs-api/config/database.yml %attr(0640,root,%apache_group) %{_datadir}/obs-api/config/database.yml.example %attr(0644,root,root) %config(noreplace) %verify(md5) %{_datadir}/obs-api/config/options.yml %attr(0644,root,root) %{_datadir}/obs-api/config/options.yml.example %dir %attr(0755,%apache_user,%apache_group) %{_datadir}/obs-api/db/sphinx %dir %attr(0755,%apache_user,%apache_group) %{_datadir}/obs-api/db/sphinx/production %config %{_datadir}/obs-api/config/environment.rb %config %{_datadir}/obs-api/config/environments/production.rb %config %{_datadir}/obs-api/config/environments/test.rb %config %{_datadir}/obs-api/config/environments/stage.rb %{_datadir}/obs-api/log %dir %attr(-,%{apache_user},%{apache_group}) %{_localstatedir}/log/obs-api %attr(-,%{apache_user},%{apache_group}) %{_datadir}/obs-api/tmp # these dirs primarily belong to apache2: %if 0%{?fedora} || 0%{?rhel} %{_httpd_confdir}/obs.conf.dist %else %dir /etc/apache2 %dir /etc/apache2/vhosts.d %config(noreplace) /etc/apache2/vhosts.d/obs.conf %endif %if %{with selinux} %{_datadir}/selinux/packages/obs-api/obs-api.pp %endif %defattr(0644,%{apache_user},%{apache_group}) %ghost %{_localstatedir}/log/obs-api/access.log %ghost %{_localstatedir}/log/obs-api/backend_access.log %ghost %{_localstatedir}/log/obs-api/delayed_job.log %ghost %{_localstatedir}/log/obs-api/error.log %ghost %{_localstatedir}/log/obs-api/lastevents.access.log %ghost %{_localstatedir}/log/obs-api/production.log %ghost %attr(0640,root,%{apache_group}) %secret_key_file %files -n obs-common %defattr(-,root,root) %{_datadir}/obs/rc.compat %if 0%{?suse_version:1} /var/adm/fillup-templates/sysconfig.obs-server %else %config(noreplace) %{_sysconfdir}/sysconfig/obs-server %endif /usr/lib/obs/server/setup-appliance.sh %{_initddir}/obsstoragesetup %{_sbindir}/rcobsstoragesetup %files -n obs-utils %defattr(-,root,root) %{_sbindir}/obs_project_update %files -n obs-productconverter %defattr(-,root,root) %{_bindir}/obs_productconvert /usr/lib/obs/server/bs_productconvert %files -n obs-devel %defattr(-,root,root) %dir %_docdir/obs-devel %_docdir/obs-devel/README.devel %files -n obs-tests-appliance %defattr(-,root,root) %dir /usr/lib/obs/tests/ %dir /usr/lib/obs/tests/appliance /usr/lib/obs/tests/appliance/* %files plugin-notify_hermes %defattr(-,root,root) %dir /usr/lib/obs/server/plugins /usr/lib/obs/server/plugins/notify_hermes.pm %files plugin-notify_rabbitmq %defattr(-,root,root) %dir /usr/lib/obs/server/plugins /usr/lib/obs/server/plugins/notify_rabbitmq.pm %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor