Blame copr-dist-git.spec

3e88a66
Name:       copr-dist-git
d18ed0f
Version:    0.46
e74c8a0
Release:    1%{?dist}
3e88a66
Summary:    Copr services for Dist Git server
3e88a66
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
d18ed0f
# git checkout copr-dist-git-0.46
3e88a66
# cd copr/dist-git
clime 1cb0e98
# rpkg sources --spec
d18ed0f
Source0:    copr-dist-git-0.46.tar.gz
3e88a66
3e88a66
BuildArch:  noarch
3e88a66
3e88a66
BuildRequires: systemd
clime 6d8431a
BuildRequires: python3-devel
clime 1cb0e98
BuildRequires: python3-munch
clime 1cb0e98
BuildRequires: python3-requests
clime 1cb0e98
BuildRequires: python3-rpkg
clime 1cb0e98
BuildRequires: python3-pytest
clime 1cb0e98
BuildRequires: python3-pytest-cov
e74c8a0
BuildRequires: python3-copr-common
clime efad51b
3e88a66
Requires: systemd
3e88a66
Requires: httpd
clime 1cb0e98
Requires: dist-git
e74c8a0
Requires: python3-copr-common
clime 1cb0e98
Requires: python3-requests
clime 1cb0e98
Requires: python3-rpkg
clime 1cb0e98
Requires: python3-munch
e74c8a0
Requires: findutils
e74c8a0
Requires: (copr-selinux if selinux-policy-targeted)
984e411
Requires: crontabs
e74c8a0
e74c8a0
Recommends: python3-copr
Your Name 282640a
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 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 || \
Your Name 9753a27
useradd -r -m -g copr-dist-git -G packager,apache -c "copr-dist-git user" copr-dist-git
clime 626e1a9
/usr/bin/passwd -l copr-dist-git >/dev/null
clime 626e1a9
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}/
984e411
install -d %{buildroot}%{_sysconfdir}/cron.monthly
984e411
984e411
install -p -m 755 conf/cron.monthly/copr-dist-git %{buildroot}%{_sysconfdir}/cron.monthly/copr-dist-git
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
d18ed0f
mv %{buildroot}%{_bindir}/remove_unused_sources %{buildroot}%{_bindir}/copr-prune-dist-git-sources
d18ed0f
3e88a66
# for ghost files
3e88a66
touch %{buildroot}%{_var}/log/copr-dist-git/main.log
3e88a66
clime 6d8431a
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/copr/dist_git
clime 6d8431a
3e88a66
e74c8a0
%check
e74c8a0
./run_tests.sh
3e88a66
3e88a66
%post
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}/*
984e411
%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
984e411
%config(noreplace) %attr(0755, root, root) %{_sysconfdir}/cron.monthly/copr-dist-git
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
d18ed0f
* Fri Jul 12 2019 Pavel Raiskup <praiskup@redhat.com> 0.46-1
d18ed0f
- add offline argument to upload method, to fix RPM import
d18ed0f
- add script to clear lookaside cache of old sources
d18ed0f
984e411
* Wed Apr 24 2019 Jakub Kadlčík <frostyx@email.cz> 0.45-1
984e411
- remove old logs from cron
984e411
e74c8a0
* Thu Jan 10 2019 Miroslav Suchý <msuchy@redhat.com> 0.44-1
e74c8a0
- add python3-copr Recommends:
e74c8a0
- one-shot script script to remove data for already deleted coprs
e74c8a0
- allow blacklisting packages from chroots
e74c8a0
e74c8a0
* Fri Oct 19 2018 Miroslav Suchý <msuchy@redhat.com> 0.43-1
e74c8a0
- fix SELinux
e74c8a0
- use FailTypeEnum from copr_common
e74c8a0
- use EnumType from copr_common
e74c8a0
- use git_dir_archive instead of git_dir_pack
e74c8a0
- fix `cgit_pkg_list` script
e74c8a0
- use git_dir_archive instead of git_dir_pack
6e2ebc8
clime 6d8431a
* Mon Aug 06 2018 clime <clime@redhat.com> 0.42-1
clime 6d8431a
- manual byte-code compilation
clime 6d8431a
- for py3 use unittest.mock, otherwise mock from python2-mock
9379a2a
clime 1cb0e98
* Fri May 18 2018 clime <clime@redhat.com> 0.41-1
clime 1cb0e98
- switch to python3
clime 1cb0e98
- rpkg deployment into COPR - containers + releng continuation
clime 1cb0e98
clime bb69e4e
* Fri Feb 23 2018 clime <clime@redhat.com> 0.40-1
clime bb69e4e
- remove Group tag
clime bb69e4e
clime 8f57309
* Mon Feb 19 2018 clime <clime@redhat.com> 0.39-1
clime 8f57309
- Shebangs cleanup
clime 8f57309
- fix spec for rhel8
clime 8f57309
- escapes in changelogs
clime 8f57309
clime 7f69aaa
* Sun Feb 18 2018 clime <clime@redhat.com> 0.38-1
clime 7f69aaa
- remove old conditional in spec
clime 7f69aaa
- fix python requires, also trim deps down
clime 7f69aaa
- add source_status field for Builds
clime 7f69aaa
- remove no longer needed CAP_SYS_CHROOT cap
fb70992
clime 6d73703
* Thu Sep 07 2017 clime <clime@redhat.com> 0.37-1
clime 6d73703
- most of the logic moved to copr-rpmbuild
clime 6d73703
clime bc91bd7
* Fri Aug 25 2017 clime <clime@redhat.com> 0.36-1
clime bc91bd7
- run spec parsing in an isolated manner
clime bc91bd7
- Spelling fixes
clime bc91bd7
clime 11dfd09
* Fri Aug 04 2017 clime <clime@redhat.com> 0.35-1
clime 11dfd09
- fix cvs-data ignore regular expression
clime 11dfd09
clime 454e133
* Mon Jul 31 2017 clime <clime@redhat.com> 0.34-1
clime 454e133
- remove --global for git config in tests so that it does not
clime 454e133
  modify ~/.gitconfig
clime 454e133
- fix #106 Renaming a spec file in a newer version causes the
clime 454e133
  build to fail
clime 454e133
- make get_package_name more robust
clime 454e133
- add DistGitProvider with support for multiple distgits
a7b631b
Your Name 9753a27
* Wed Jul 19 2017 clime <clime@redhat.com> 0.33-1
Your Name 9753a27
- remove ExclusiveArch directive
Your Name 9753a27
- add support for SCM Subdirectory parameter
Your Name 9753a27
- remove docker related stuff
Your Name 9753a27
- fix variable name
Your Name 9753a27
- add missing import in providers.py
Your Name 9753a27
- auto-differentiate between downstream and upstream repo in
Your Name 9753a27
  SCMProvider
Your Name 9753a27
- do not include dist information in displayed version
Your Name 9753a27
- remove unused exceptions
Your Name 9753a27
- get_package_name from spec_path is now a separate method
Your Name 9753a27
- do not modify spec for MockScm method
Your Name 9753a27
- use python's tarfile instead of tar shell cmd
Your Name 9753a27
Your Name 282640a
* Fri Jul 14 2017 clime <clime@redhat.com> 0.32-1
Your Name 282640a
- srpms are now not being built on dist-git
Your Name 282640a
- MockSCM and Tito methods unified into single source
Your Name 282640a
clime 2be5fcf
* Fri Jul 07 2017 clime <clime@redhat.com> 0.31-1
clime 2be5fcf
- remove no longer required condition for a scm import to run
clime 2be5fcf
- .spec build implemented
clime 2be5fcf
- fedora:25 image offers the needed en_US.UTF-8 locale now
clime 2be5fcf
- Dockerfile with less layers
clime 2be5fcf
clime e37bfb3
* Fri Jun 09 2017 clime <clime@redhat.com> 0.30-1
clime e37bfb3
- import build task only once
clime e37bfb3
- remove unsupported --depth from git svn command
clime e37bfb3
- add dep on git-svn
clime e37bfb3
- better exception handling in MockScmProvider
clime e37bfb3
- fix 'git svn clone' and add exception handling for clone part in MockScm provider
clime e37bfb3
clime 8a003a3
* Thu Jun 01 2017 clime <clime@redhat.com> 0.29-1
clime 8a003a3
- Bug 1457888 - Mock SCM method fails to build a package
clime 8a003a3
- increase depth for git clone so that required tags that tito needs are downloaded
clime 8a003a3
clime 8a003a3
* Wed May 31 2017 clime <clime@redhat.com> 0.28-1
clime 8a003a3
- add --depth 1 for git clone in GitProvider
clime 8a003a3
- add missing 'which' for tito && git-annex builds
clime 8a003a3
- arbitrary dist-git branching support
clime 8a003a3
- use MockScmProvider without mock-scm to solve performance problems
clime 8a003a3
- add "powerpc64le" into list of archs to allow building for
clime 8a003a3
clime 7d8f131
* Mon May 15 2017 clime <clime@redhat.com> 0.27-1
clime 7d8f131
- Bug 1447102 - fedpkg build fail during import phase
clime 7d8f131
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
clime 8f57309
- 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