diff --git a/.gitignore b/.gitignore index 7f30d94..2884e6f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /copr-frontend-1.99.tar.gz /copr-frontend-1.100.tar.gz /copr-frontend-1.101.tar.gz +/copr-frontend-1.104.tar.gz diff --git a/copr-frontend.spec b/copr-frontend.spec index 7133e79..f1a446a 100644 --- a/copr-frontend.spec +++ b/copr-frontend.spec @@ -1,11 +1,40 @@ -%global with_test 0 +%bcond_without check + %if 0%{?rhel} < 7 && 0%{?rhel} > 0 %global _pkgdocdir %{_docdir}/%{name}-%{version} %global __python2 %{__python} %endif +# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_of_Additional_RPM_Macros +%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) + + +%global flavor_guard %name-flavor = %version +%global flavor_files_list %_datadir/copr/copr-flavor-filelist +%global flavor_generator %_datadir/copr/coprs_frontend/generate_colorscheme +%global staticdir %_datadir/copr/coprs_frontend/coprs/static +%global templatedir %_datadir/copr/coprs_frontend/coprs/templates + +%global flavor_files \ +%staticdir/header_background.png \ +%staticdir/favicon.ico \ +%staticdir/copr_logo.png \ +%staticdir/css/style-overwrite.css \ +%templatedir/project_info.html + +%global devel_files \ +%flavor_generator + +%define exclude_files() %{lua: + macro = "%" .. rpm.expand("%1") .. "_files" + x = rpm.expand(macro) + for line in string.gmatch(x, "([^\\n]+)") do + print("%exclude " .. line .. "\\n") + end +} + Name: copr-frontend -Version: 1.101 +Version: 1.104 Release: 1%{?dist} Summary: Frontend for Copr @@ -26,6 +55,7 @@ BuildRequires: python-setuptools BuildRequires: python2-requests BuildRequires: python2-devel BuildRequires: systemd +BuildRequires: python2-modulemd %if 0%{?rhel} < 7 && 0%{?rhel} > 0 BuildRequires: python-argparse %endif @@ -57,18 +87,26 @@ Requires: python-six Requires: python-netaddr Requires: python-flask-restful Requires: python-marshmallow >= 2.0.0 +Requires: python2-modulemd +Requires: python-pygments + +Requires: %flavor_guard + # for tests: Requires: pytest Requires: python-flexmock Requires: python-mock Requires: python-decorator Requires: yum -Suggests: logstash Requires: redis Requires: python-redis Requires: python-dateutil Requires: crontabs +%if 0%{?fedora} +Suggests: logstash +%endif + %if 0%{?fedora} >= 23 Requires: python-dnf BuildRequires: python-dnf @@ -77,10 +115,17 @@ Requires: dnf BuildRequires: dnf %endif +%if 0%{?fedora} >= 24 +Requires: python2-zmq +%else +Requires: python-zmq +%endif + %if 0%{?rhel} < 7 && 0%{?rhel} > 0 BuildRequires: python-argparse %endif -# check + +%if %{with check} BuildRequires: python-six BuildRequires: python-flask BuildRequires: python-flask-script @@ -106,6 +151,8 @@ BuildRequires: python-sphinx BuildRequires: python-sphinxcontrib-httpdomain BuildRequires: python-whoosh BuildRequires: python-blinker +BuildRequires: python-pygments +%endif %if 0%{?with_python3} Requires: dnf @@ -126,6 +173,8 @@ Requires: python3-marshmallow Requires: python3-blinker Requires: python3-flask-openid Requires: python3-openid-teams +Requires: python3-modulemd +Requires: python3-pygments %if 0%{?fedora} >= 23 Requires: python3-dnf @@ -170,6 +219,27 @@ and submit new builds and COPR will create yum repository from latests builds. This package include documentation for COPR code. Mostly useful for developers only. + +%package fedora +Summary: Template files for %{name} +Requires: %{name} = %{version} +Provides: %flavor_guard + +%description fedora +Template files for %{name} (basically colors, logo, etc.). This package is +designed to be replaced - build your replacement package against %{name}-devel +to produce compatible {name}-flavor package, then use man dnf.conf(5) 'priority' +option to prioritize your package against the default package we provide. + + +%package devel +Summary: Development files to build against %{name} + +%description devel +Files which allow a build against %{name}, currently it's useful to build +custom %{name}-flavor package. + + %prep %setup -q @@ -180,6 +250,7 @@ pushd documentation COPR_CONFIG=../../documentation/copr-documentation.conf make %{?_smp_mflags} python popd + %install install -d %{buildroot}%{_sysconfdir}/copr install -d %{buildroot}%{_datadir}/copr/coprs_frontend @@ -192,12 +263,15 @@ install -d %{buildroot}%{_sharedstatedir}/copr/data/whooshee/copr_user_whoosheer install -d %{buildroot}%{_sharedstatedir}/copr/data/srpm_storage install -d %{buildroot}%{_sysconfdir}/cron.hourly install -d %{buildroot}/%{_bindir} +install -d %{buildroot}%{_unitdir} install -p -m 755 conf/cron.hourly/copr-frontend %{buildroot}%{_sysconfdir}/cron.hourly/copr-frontend cp -a coprs_frontend/* %{buildroot}%{_datadir}/copr/coprs_frontend sed -i "s/__RPM_BUILD_VERSION/%{version}-%{release}/" %{buildroot}%{_datadir}/copr/coprs_frontend/coprs/templates/layout.html +cp -a copr-fedmsg-listener.service %{buildroot}%{_unitdir}/ + mv %{buildroot}%{_datadir}/copr/coprs_frontend/coprs.conf.example ./ mv %{buildroot}%{_datadir}/copr/coprs_frontend/config/* %{buildroot}%{_sysconfdir}/copr rm %{buildroot}%{_datadir}/copr/coprs_frontend/CONTRIBUTION_GUIDELINES @@ -210,11 +284,15 @@ cp -a conf/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} cp -a conf/logstash.conf %{buildroot}%{_sysconfdir}/logstash.d/copr_frontend.conf touch %{buildroot}%{_var}/log/copr-frontend/frontend.log - ln -fs /usr/share/copr/coprs_frontend/manage.py %{buildroot}/%{_bindir}/copr-frontend +mkdir -p %buildroot/$(dirname %flavor_files_list) +cat < %buildroot%flavor_files_list +%flavor_files +EOF + %check -%if %{with_test} && "%{_arch}" == "x86_64" +%if %{with check} && "%{_arch}" == "x86_64" pushd coprs_frontend REDIS_PORT=7777 redis-server --port $REDIS_PORT & #&> _redis.log & @@ -224,15 +302,37 @@ ln -fs /usr/share/copr/coprs_frontend/manage.py %{buildroot}/%{_bindir}/copr-fro popd %endif +mkdir -p %buildroot%macrosdir +cat <%buildroot%macrosdir/macros.coprfrontend +%%copr_frontend_flavor_guard %flavor_guard +%%copr_frontend_flavor_filelist %flavor_files_list +%%copr_frontend_flavor_generator %flavor_generator +%%copr_frontend_staticdir %staticdir +%%copr_frontend_templatedir %templatedir +%%copr_frontend_chroot_logodir %%copr_frontend_staticdir/chroot_logodir +EOF + + %pre getent group copr-fe >/dev/null || groupadd -r copr-fe getent passwd copr-fe >/dev/null || \ useradd -r -g copr-fe -G copr-fe -d %{_datadir}/copr/coprs_frontend -s /bin/bash -c "COPR frontend user" copr-fe /usr/bin/passwd -l copr-fe >/dev/null + %post service httpd condrestart service logstash condrestart +%systemd_post copr-fedmsg-listener.service + + +%preun +%systemd_preun copr-fedmsg-listener.service + + +%postun +%systemd_postun_with_restart copr-fedmsg-listener.service + %files %license LICENSE @@ -246,6 +346,8 @@ service logstash condrestart %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/logstash.d/copr_frontend.conf +%{_unitdir}/copr-fedmsg-listener.service + %defattr(-, copr-fe, copr-fe, -) %dir %{_sharedstatedir}/copr/data %dir %{_sharedstatedir}/copr/data/openid_store @@ -265,12 +367,84 @@ service logstash condrestart %config(noreplace) %{_sysconfdir}/copr/copr_unit_test.conf %config(noreplace) %attr(0755, root, root) %{_sysconfdir}/cron.hourly/copr-frontend +%exclude_files flavor +%exclude_files devel + + +%files fedora +%license LICENSE +%flavor_files + + +%files devel +%license LICENSE +%flavor_files_list +%devel_files +%macrosdir/* + %files doc %license LICENSE %doc documentation/python-doc + %changelog +* Thu Dec 01 2016 clime 1.104-1 +- set default build timeout to 18 hours +- allow hiding "quick enable" helper +- login should not be required for viewing modules +- (cli) inform user about build links +- create backend_rawhide_to_release command +- adding chroot repos implemented +- group_add: make group in breadcrumb menu clickable - create status/order functions by 'create_db' +- modularize design files +- spec: allow 'rpmbuild --without check' +- use "Suggests" tag only in Fedora +- add api method for translating module NVR to DNF repo url +- promptly generate mock profiles +- added auto-prune project's option +- Bug 1393361 - get_project_details returns incorrect yum_repos +- Bug 1086139 - [RFE] provide UI to cancel a build +- group support for modules +- modularity 1.0.2 support +- create proper module table +- by pagure fedmsgs induced auto-rebuilds +- Bug 1384923 - Ignore push events to other branches when one is + selected +- stripped down impl of building from dist-git +- fix unit tests +- Bug 1377854 - provide functional URL when asking to renew token +- Bug 1382243 - Multiple rows were found for one() +- add link to all BZs to footer +- Bug 1335168 - Delete build(s) from CLI +- Bug 1380810 - [RFE] Show original repo when forking +- Bug 1368458 - Resubmit does not work on forked projects. +- FAS groups need re-login, inform user +- Bug 1381790 - rename Rawhide to F26 in Copr and create F27 when Fedora branches instead +- use 'debug' level for krb debug message +- fix krb auth for services +- fork only successful builds +- check user permissions when building module +- implement methods for querying multiple modules +- Bug 1361641 - Status in build table shows wrong values +- show html code for build badge +- speed up querying for recent builds +- modularity UI improvements +- do not fork created_on from previous project +- fix Bug 1376703 - Cannot cancel build and now explain + +* Wed Sep 21 2016 clime 1.103-1 +- add migration to enable mageia chroots +- fix Bug 1369763 - Cannot delete repo due to a canceled build +- Fix a typo + +* Mon Sep 19 2016 clime 1.102-1 +- support for mageia chroots +- add a note about Copr not being supported by Fedora Infra +- Bug 1374906 - Login redirection for raising legal flag doesn't work +- Modularity integration +- Bug 1370704 - Internal Server Error (too many values to unpack) + * Mon Sep 12 2016 clime 1.101-1 - package query fix diff --git a/sources b/sources index 35749cb..971fad7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -89e0dc54d7eaf974f6b341714d17fd94 copr-frontend-1.101.tar.gz +e6072eedf53af0add1d62cf220608a34 copr-frontend-1.104.tar.gz