Blame copr-dist-git.spec

3e88a66
Name:       copr-dist-git
clime 626e1a9
Version:    0.26
clime 626e1a9
Release:    1%{?dist}
3e88a66
Summary:    Copr services for Dist Git server
3e88a66
3e88a66
Group:      Applications/Productivity
3e88a66
License:    GPLv2+
clime 626e1a9
URL:        https://pagure.io/copr/copr
3e88a66
# Source is created by
clime 626e1a9
# git clone https://pagure.io/copr/copr.git
3e88a66
# cd copr/dist-git
3e88a66
# tito build --tgz
3e88a66
Source0: %{name}-%{version}.tar.gz
3e88a66
3e88a66
BuildArch:  noarch
clime 626e1a9
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le s390x %{mips}
3e88a66
3e88a66
BuildRequires: systemd
3e88a66
BuildRequires: dist-git
3e88a66
BuildRequires: python-bunch
3e88a66
BuildRequires: python-requests
clime 476d63f
BuildRequires: pyrpkg >= 1.47
3e88a66
# check
3e88a66
BuildRequires: python-six
3e88a66
BuildRequires: python-netaddr
3e88a66
BuildRequires: python-dateutil
3e88a66
BuildRequires: pytest
3e88a66
BuildRequires: python-pytest-cov
3e88a66
BuildRequires: python-mock
clime 476d63f
%if 0%{?el7}
clime 476d63f
BuildRequires: python-psutil
clime 476d63f
%else
clime be78dca
BuildRequires: python2-psutil
clime 476d63f
%endif
3e88a66
BuildRequires: pytz
3e88a66
clime efad51b
%if 0%{?fedora} > 23
clime efad51b
# BuildRequires also because of build-time tests
clime efad51b
BuildRequires: python2-jinja2
clime efad51b
Requires: python2-jinja2
clime efad51b
%else
clime efad51b
BuildRequires: python-jinja2
clime efad51b
Requires: python-jinja2
clime efad51b
%endif
clime efad51b
3e88a66
Requires: systemd
3e88a66
Requires: dist-git
3e88a66
Requires: python-bunch
3e88a66
Requires: python-requests
clime 476d63f
%if 0%{?el7}
clime 476d63f
Requires: python-psutil
clime 476d63f
%else
clime be78dca
Requires: python2-psutil
clime 476d63f
%endif
clime efad51b
Requires: python-jinja2
clime 476d63f
Requires: pyrpkg >= 1.47
3e88a66
Requires: mock-scm
clime efad51b
Requires: docker
3e88a66
Requires: httpd
3e88a66
%{?fedora:Requires(post): policycoreutils-python-utils}
3e88a66
%{?rhel:Requires(post): policycoreutils-python}
3e88a66
3e88a66
%description
3e88a66
COPR is lightweight build system. It allows you to create new project in WebUI
3e88a66
and submit new builds and COPR will create yum repository from latest builds.
3e88a66
3e88a66
This package contains Copr services for Dist Git server.
3e88a66
3e88a66
3e88a66
%prep
3e88a66
%setup -q
3e88a66
3e88a66
3e88a66
%build
3e88a66
clime 626e1a9
%pre
clime 626e1a9
getent group docker >/dev/null || groupadd -r docker
clime 626e1a9
getent group packager >/dev/null || groupadd -r packager
clime 626e1a9
getent group copr-dist-git >/dev/null || groupadd -r copr-dist-git
clime 626e1a9
getent group apache >/dev/null || groupadd -r apache
clime 626e1a9
getent passwd copr-dist-git >/dev/null || \
clime 626e1a9
useradd -r -m -g copr-dist-git -G packager,docker,apache -c "copr-dist-git user" copr-dist-git
clime 626e1a9
/usr/bin/passwd -l copr-dist-git >/dev/null
clime 626e1a9
clime 626e1a9
exit 0
3e88a66
3e88a66
%install
3e88a66
3e88a66
install -d %{buildroot}%{_datadir}/copr/dist_git
3e88a66
install -d %{buildroot}%{_sysconfdir}/copr
3e88a66
install -d %{buildroot}%{_sysconfdir}/logrotate.d/
3e88a66
install -d %{buildroot}%{_sysconfdir}/httpd/conf.d/
3e88a66
install -d %{buildroot}%{_unitdir}
3e88a66
install -d %{buildroot}%{_var}/log/copr-dist-git
3e88a66
install -d %{buildroot}%{_sharedstatedir}/copr-dist-git
3e88a66
install -d %{buildroot}%{_bindir}/
3e88a66
3e88a66
cp -a dist_git/* %{buildroot}%{_datadir}/copr/dist_git
3e88a66
cp -a conf/copr-dist-git.conf.example %{buildroot}%{_sysconfdir}/copr/copr-dist-git.conf
3e88a66
cp -a conf/httpd/copr-dist-git.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/copr-dist-git.conf
3e88a66
cp -a copr-dist-git.service %{buildroot}%{_unitdir}/
3e88a66
cp -a run/* %{buildroot}%{_bindir}/
3e88a66
3e88a66
cp -a conf/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/copr-dist-git
3e88a66
3e88a66
# for ghost files
3e88a66
touch %{buildroot}%{_var}/log/copr-dist-git/main.log
3e88a66
3e88a66
%check
3e88a66
3e88a66
%if 0%{?fedora} >= 21
3e88a66
# too old `pytest` in epel repo
3e88a66
PYTHONPATH=.:$PYTHONPATH python -B -m pytest \
3e88a66
  -v --cov-report term-missing --cov ./dist_git ./tests/
3e88a66
%endif
3e88a66
3e88a66
%post
3e88a66
# change context to be readable by cgit
3e88a66
semanage fcontext -a -t httpd_sys_content_t '/var/lib/copr-dist-git(/.*)?'
3e88a66
restorecon -rv /var/lib/copr-dist-git
clime efad51b
%systemd_post copr-dist-git.service
clime efad51b
clime efad51b
%preun
clime efad51b
%systemd_preun copr-dist-git.service
clime efad51b
clime efad51b
%postun
clime efad51b
%systemd_postun_with_restart copr-dist-git.service
3e88a66
3e88a66
%files
3e88a66
%license LICENSE
3e88a66
3e88a66
%{_bindir}/*
3e88a66
%dir %{_datadir}/copr 
3e88a66
%{_datadir}/copr/*
3e88a66
%dir %{_sysconfdir}/copr
clime 626e1a9
%config(noreplace) %attr(0640, root, copr-dist-git) %{_sysconfdir}/copr/copr-dist-git.conf
3e88a66
%config(noreplace) %attr(0644, root, root) %{_sysconfdir}/httpd/conf.d/copr-dist-git.conf
3e88a66
clime 626e1a9
%dir %attr(0755, copr-dist-git, copr-dist-git) %{_sharedstatedir}/copr-dist-git/
3e88a66
3e88a66
%{_unitdir}/copr-dist-git.service
3e88a66
3e88a66
%dir %{_sysconfdir}/logrotate.d
3e88a66
%config(noreplace) %{_sysconfdir}/logrotate.d/copr-dist-git
clime 626e1a9
%attr(0755, copr-dist-git, copr-dist-git) %{_var}/log/copr-dist-git
clime 626e1a9
%attr(0644, copr-dist-git, copr-dist-git) %{_var}/log/copr-dist-git/main.log
3e88a66
%ghost %{_var}/log/copr-dist-git/*.log
3e88a66
3e88a66
%changelog
clime 626e1a9
* Wed Apr 12 2017 clime <clime@redhat.com> 0.26-1
clime 626e1a9
- follow docker ExclusiveArches spec directive
clime 626e1a9
- replace leftover username in lograte config
clime 626e1a9
- fix README
clime 626e1a9
clime 626e1a9
* Mon Apr 10 2017 clime <clime@redhat.com> 0.25-1
clime 626e1a9
- compatibility fixes for the latest dist-git (upstream)
clime 626e1a9
- improved error logging and exception handling of external commands
clime 626e1a9
- improve repo creation & srpm import logging and exception handling
clime 626e1a9
- replace copr-service user by copr-dist-git and useradd the user
clime 626e1a9
- Bug 1426033 - git-annex missing, cannot use tito.builder.GitAnnexBuilder
clime 626e1a9
- replace fedorahosted links
clime 626e1a9
- error logging of pyrpkg upload into lookaside
clime 626e1a9
- update langpack hack in dist-git Dockerfile
293ad0a
clime 476d63f
* Thu Jan 26 2017 clime <clime@redhat.com> 0.24-1
clime 476d63f
- install mock-scm in docker image from official fedora repos
clime 476d63f
- upgrade docker image to f25
clime 476d63f
- Fixes for building COPR Backend and Dist-git on EL7
clime 476d63f
- fix copy hack for new internal pyrpkg API
clime 476d63f
clime efad51b
* Thu Dec 01 2016 clime <clime@redhat.com> 0.23-1
clime efad51b
- use other than epel chroot for scm building
clime efad51b
- use newest mock
clime efad51b
- run mock-scm inside of docker
clime efad51b
- add README information about how docker image is built
clime efad51b
- stripped down impl of building from dist-git
clime efad51b
- fixed unittests
clime efad51b
- refactor VM.run method
clime efad51b
- remove exited containers
clime efad51b
- add possibility to run dist-git in single thread
clime efad51b
- refactor lookaside my_upload slightly
clime efad51b
- Bug 1377780 - Multiple failed tasks with: Importing SRPM into Dist Git failed.
clime efad51b
clime efad51b
* Mon Sep 19 2016 clime <clime@redhat.com> 0.22-1
clime efad51b
- fix Git&Tito subdirectory use-case
clime efad51b
clime efad51b
* Mon Sep 19 2016 clime <clime@redhat.com> 0.21-1
clime efad51b
- Git&Tito, pyp2rpm, gem2rpm now run in docker
clime efad51b
clime be78dca
* Mon Aug 15 2016 clime <clime@redhat.com> 0.20-1
clime be78dca
- try to obtain multiple tasks at once
clime be78dca
- Add python2-psutil requirement
clime be78dca
- inform frontend about terminated task
clime be78dca
- log when starting and finishing workers
clime be78dca
- log timeout value from worker
clime be78dca
- run mock with --uniqueext
clime be78dca
- implement timeout-based terminating
clime be78dca
- parallelization by pool of workers
clime be78dca
clime be78dca
* Fri May 27 2016 clime <clime@redhat.com> 0.19-1
clime be78dca
- strip whitespaces from the gem name
clime be78dca
clime 349baa1
* Thu May 26 2016 clime <clime@redhat.com> 0.18-1
clime 349baa1
- implemented building from rubygems
clime 349baa1
clime 349baa1
* Fri Apr 22 2016 Miroslav Suchý <msuchy@redhat.com> 0.17-1
clime 349baa1
- support for pyrpkg-1.43
clime 349baa1
- typo in method name
clime 349baa1
- use os.listdir instead of Popen
clime 349baa1
- sort imports
clime 349baa1
- more verbose logging of exception
clime 349baa1
clime 349baa1
* Tue Apr 12 2016 Miroslav Suchý <msuchy@redhat.com> 0.16-1
clime 349baa1
- clean up after dist-git import
clime 349baa1
- assure python_versions type for pypi builds
clime 349baa1
- 1322553 - checkout specific branch
clime 349baa1
3e88a66
* Fri Mar 18 2016 Miroslav Suchý <msuchy@redhat.com> 0.15-1
3e88a66
- own /etc/logrotate.d
3e88a66
- own /usr/share/copr
3e88a66
- trailing dot in description
3e88a66
3e88a66
* Mon Mar 14 2016 Jakub Kadlčík <jkadlcik@redhat.com> 0.14-1
3e88a66
- per task logging for users
3e88a66
- don't assume the SCM repo has the same name as the package
3e88a66
- added policycoreutils-python-utils dependency
3e88a66
- do shallow git clone for mock-scm
3e88a66
- support building from PyPI
3e88a66
3e88a66
* Fri Jan 29 2016 Miroslav Suchý <msuchy@redhat.com> 0.13-1
3e88a66
- [dist-git] error handling based on subprocess return codes instead of output
3e88a66
  to stderr (e.g. git outputs progress to stderr) + missing catch for
3e88a66
  GitException in do_import (results in better error messages in frontend, see
3e88a66
  bz#1295540)
3e88a66
3e88a66
* Mon Jan 25 2016 Miroslav Suchý <msuchy@redhat.com> 0.12-1
3e88a66
- pass --scm-option spec=foo to mock-scm (msuchy@redhat.com)
3e88a66
3e88a66
* Thu Jan 21 2016 clime <clime@redhat.com> 0.11-1
3e88a66
- tito added to requirements
3e88a66
3e88a66
* Sat Jan 16 2016 clime <clime@redhat.com> 0.10-1
3e88a66
- fixed do_import test
3e88a66
- workaround for BZ 1283101
3e88a66
3e88a66
* Mon Nov 16 2015 Miroslav Suchý <msuchy@redhat.com> 0.9-1
3e88a66
- make more abstract exceptions
3e88a66
- implement support for multiple Mock SCMs
3e88a66
- split SourceDownloader to multiple SourceProvider classes
3e88a66
- refactor duplicate code from GIT_AND_TITO and GIT_AND_MOCK
3e88a66
- require mock-scm
3e88a66
- implement mock support in dist-git
3e88a66
- do not check cert when downloading srpm
3e88a66
3e88a66
* Mon Nov 02 2015 Miroslav Suchý <msuchy@redhat.com> 0.8-1
3e88a66
- add Git and Tito errors
3e88a66
- tito support
3e88a66
- hotfix for resubmit button
3e88a66
3e88a66
* Tue Sep 15 2015 Valentin Gologuzov <vgologuz@redhat.com> 0.7-1
3e88a66
- provide build failure details
3e88a66
- replace urllib.urlretrieve with requests.get to catch non-200 HTTP  status codes
3e88a66
3e88a66
* Fri Aug 14 2015 Valentin Gologuzov <vgologuz@redhat.com> 0.6-1
3e88a66
- [dist-git][rhbz: #1253335] Running rpkg in the dedicated process.
3e88a66
3e88a66
* Wed Aug 05 2015 Valentin Gologuzov <vgologuz@redhat.com> 0.5-1
3e88a66
- don't run tests during %check on epel
3e88a66
3e88a66
* Wed Aug 05 2015 Valentin Gologuzov <vgologuz@redhat.com> 0.4-1
3e88a66
- additional BuildRequires to run tests
3e88a66
3e88a66
* Tue Aug 04 2015 Valentin Gologuzov <vgologuz@redhat.com> 0.3-1
3e88a66
- fixed commit message to include package name and version
3e88a66
- added initial tests; renamed folder with sources to use underscore instead of dash
3e88a66
- mark build as failed for any error during import
3e88a66
- don't break on the post failure to frontend
3e88a66
- get pkg name + version during import
3e88a66
- Use /var/lib/copr-dist-git/ to store pkg listing.
3e88a66
- refresh cgit after import
3e88a66
3e88a66
* Thu Jul 23 2015 Valentin Gologuzov <vgologuz@redhat.com> 0.2-1
3e88a66
- new package built with tito
3e88a66
3e88a66
* Thu Jun 25 2015 Adam Samalik <asamalik@redhat.com> 0.1
3e88a66
- basic package