From 7e489e7c299974d08f7d20b323f50e8f283e0a7c Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Feb 02 2018 10:40:01 +0000 Subject: Add .copr directory with scripts to allow rebuilding Freshmaker after commit in Copr. --- diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 0000000..e6d6a56 --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,6 @@ +srpm: + /usr/bin/bash .copr/prepare_spec.sh + python setup.py sdist + cp ./dist/*.tar.gz ./.copr + fedpkg --path ./.copr --release el7 srpm + cp ./.copr/*.src.rpm $(outdir) diff --git a/.copr/freshmaker-enum34-requirement.patch b/.copr/freshmaker-enum34-requirement.patch new file mode 100644 index 0000000..5039fe8 --- /dev/null +++ b/.copr/freshmaker-enum34-requirement.patch @@ -0,0 +1,13 @@ +diff --git a/requirements.txt b/requirements.txt +index 3f71e88..9145207 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -20,7 +20,7 @@ Flask-SQLAlchemy + Flask-Script + Flask-Login + requests +-enum34 ; python_version <= '2.7' ++enum34 + odcs[client] + krbcontext + dogpile.cache diff --git a/.copr/freshmaker-pyldap.py b/.copr/freshmaker-pyldap.py new file mode 100644 index 0000000..3d25411 --- /dev/null +++ b/.copr/freshmaker-pyldap.py @@ -0,0 +1,12 @@ +diff --git a/requirements.txt b/requirements.txt +index 994c785..059aad8 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -22,6 +22,6 @@ enum34 + odcs[client] + krbcontext + dogpile.cache +-pyldap ++python-ldap + + git+https://pagure.io/koji.git@koji-1.15.0#egg=koji diff --git a/.copr/freshmaker.spec.in b/.copr/freshmaker.spec.in new file mode 100644 index 0000000..efbcbf6 --- /dev/null +++ b/.copr/freshmaker.spec.in @@ -0,0 +1,170 @@ +Name: freshmaker +Version: $FRESHMAKER_VERSION +Release: $FRESHMAKER_RELEASE%{?dist} +Summary: Freshmaker is a service scheduling rebuilds of artifacts as new content becomes available. + +Group: Development/Tools +License: MIT +URL: https://pagure.io/freshmaker +Source0: https://files.pythonhosted.org/packages/source/o/%{name}/%{name}-%{version}.tar.gz +Patch0: freshmaker-enum34-requirement.patch +Patch1: freshmaker-pyldap.py + +%if 0%{?rhel} && 0%{?rhel} <= 7 +# In EL7 we need flask which needs python-itsdangerous which comes from +# rhel7-extras which is only available on x86_64 for now. +ExclusiveArch: %{ix86} x86_64 +%else +BuildArch: noarch +%endif + +BuildRequires: fedmsg-hub +BuildRequires: help2man +BuildRequires: kobo +BuildRequires: kobo-rpmlib +BuildRequires: python2-devel +BuildRequires: python2-flask-migrate +BuildRequires: python2-funcsigs +BuildRequires: python2-futures +BuildRequires: python2-pdc-client +BuildRequires: python-enum34 +BuildRequires: python-flask-script +BuildRequires: python-httplib2 +BuildRequires: python-m2ext +BuildRequires: python-munch +BuildRequires: python2-odcs-client +BuildRequires: python-dogpile-cache +BuildRequires: python2-krbcontext +BuildRequires: python-flask-login +BuildRequires: python-ldap + +%if 0%{?rhel} && 0%{?rhel} <= 7 +BuildRequires: python-setuptools +BuildRequires: python-fedora +BuildRequires: python-flask +BuildRequires: python-flask-sqlalchemy +BuildRequires: python-mock +BuildRequires: python-nose +BuildRequires: python-psutil +BuildRequires: pytest +BuildRequires: pyOpenSSL +BuildRequires: python-six +BuildRequires: python-sqlalchemy +BuildRequires: koji +%else +BuildRequires: python2-setuptools +BuildRequires: python2-fedora +BuildRequires: python2-flask +BuildRequires: python2-flask-sqlalchemy +BuildRequires: python2-mock +BuildRequires: python2-nose +BuildRequires: python2-psutil +BuildRequires: python2-pytest +BuildRequires: python2-pyOpenSSL +BuildRequires: python2-six +BuildRequires: python2-sqlalchemy +BuildRequires: python2-koji +%endif + +BuildRequires: systemd +%{?systemd_requires} + +Requires: fedmsg-hub +Requires: systemd +Requires: kobo +Requires: kobo-rpmlib +Requires: python2-funcsigs +Requires: python2-futures +Requires: python2-openidc-client +Requires: python2-pdc-client +Requires: python-enum34 +Requires: python-flask-script +Requires: python-httplib2 +Requires: python-m2ext +Requires: python-munch +Requires: python2-odcs-client +Requires: python-dogpile-cache +Requires: python2-krbcontext +Requires: python-flask-login +Requires: python-ldap + +%if 0%{?rhel} && 0%{?rhel} <= 7 +Requires: python-fedora +Requires: python-flask +Requires: python-flask-migrate +Requires: python-flask-sqlalchemy +Requires: python-mock +Requires: python-psutil +Requires: pyOpenSSL +Requires: python-six +Requires: python-sqlalchemy +Requires: koji +Requires: systemd-python +%else +Requires: python2-koji +Requires: python2-fedora +Requires: python2-flask +Requires: python2-flask-migrate +Requires: python2-flask-sqlalchemy +Requires: python2-mock +Requires: python2-psutil +Requires: python2-pyOpenSSL +Requires: python2-six +Requires: python2-sqlalchemy +Requires: python2-systemd +%endif + + +%description +Freshmaker is a service scheduling rebuilds of artifacts as new content becomes available. + + +%prep +%setup -q + +%if 0%{?rhel} && 0%{?rhel} <= 7 +%patch0 -p1 -b .enum34 +%endif + +%patch1 -p1 -b .pyldap + + +%build +%py2_build + + +%install +%py2_install + +export PYTHONPATH=%{buildroot}%{python2_sitelib} +mkdir -p %{buildroot}%{_mandir}/man1 +for command in freshmaker-manager freshmaker-frontend freshmaker-gencert freshmaker-upgradedb ; do +FRESHMAKER_CONFIG_FILE=conf/config.py %{buildroot}%{_bindir}/$command --help || true +FRESHMAKER_CONFIG_FILE=conf/config.py help2man -N --version-string=%{version} \ + %{buildroot}%{_bindir}/$command > \ + %{buildroot}%{_mandir}/man1/$command.1 +done + +install -d -m 0755 %{buildroot}%{_datadir}/freshmaker +install -p -m 0644 contrib/freshmaker.wsgi %{buildroot}%{_datadir}/freshmaker + +# %check +# nosetests-%{python2_version} -v + + +%files +%doc README.md +%license LICENSE +%{python2_sitelib}/freshmaker* +%{_bindir}/freshmaker-* +%{_mandir}/man1/freshmaker-*.1* +%dir %{_sysconfdir}/freshmaker +%{_datadir}/freshmaker +%{_sysconfdir}/fedmsg.d/* +%config(noreplace) %{_sysconfdir}/freshmaker/config.py +%exclude %{_sysconfdir}/freshmaker/*.py[co] +%exclude %{_sysconfdir}/fedmsg.d/*.py[co] +%exclude %{python2_sitelib}/conf/ + + +%changelog diff --git a/.copr/prepare_spec.sh b/.copr/prepare_spec.sh new file mode 100644 index 0000000..ba2f93a --- /dev/null +++ b/.copr/prepare_spec.sh @@ -0,0 +1,5 @@ +dnf -y install python git fedpkg python-setuptools +FRESHMAKER_VERSION=$(python setup.py -V) +FRESHMAKER_RELEASE=$(git log -1 --pretty=format:%ct) +sed -e "s|\$FRESHMAKER_VERSION|$FRESHMAKER_VERSION|g" \ + -e "s|\$FRESHMAKER_RELEASE|$FRESHMAKER_RELEASE|g" ./.copr/freshmaker.spec.in > ./.copr/freshmaker.spec; diff --git a/freshmaker.spec b/freshmaker.spec deleted file mode 100644 index a156433..0000000 --- a/freshmaker.spec +++ /dev/null @@ -1,142 +0,0 @@ -Name: freshmaker -Version: 0.0.4 -Release: 1%{?dist} -Summary: Freshmaker is a service scheduling rebuilds of artifacts as new content becomes available. - -Group: Development/Tools -License: MIT -URL: https://pagure.io/freshmaker -Source0: https://files.pythonhosted.org/packages/source/o/%{name}/%{name}-%{version}.tar.gz - -%if 0%{?rhel} && 0%{?rhel} <= 7 -# In EL7 we need flask which needs python-itsdangerous which comes from -# rhel7-extras which is only available on x86_64 for now. -ExclusiveArch: %{ix86} x86_64 -%else -BuildArch: noarch -%endif - -BuildRequires: fedmsg-hub -BuildRequires: help2man -BuildRequires: kobo -BuildRequires: python2-devel -BuildRequires: python2-flask-migrate -BuildRequires: python2-funcsigs -BuildRequires: python2-futures -BuildRequires: python2-pdc-client -BuildRequires: python-enum34 -BuildRequires: python-flask-script -BuildRequires: python-httplib2 -BuildRequires: python-munch - -%if 0%{?rhel} && 0%{?rhel} <= 7 -BuildRequires: python-setuptools -BuildRequires: python-fedora -BuildRequires: python-flask -BuildRequires: python-flask-sqlalchemy -BuildRequires: python-mock -BuildRequires: python-nose -BuildRequires: python-psutil -BuildRequires: python-pytest -BuildRequires: pyOpenSSL -BuildRequires: python-six -BuildRequires: python-sqlalchemy -BuildRequires: koji -%else -BuildRequires: python2-setuptools -BuildRequires: python2-fedora -BuildRequires: python2-flask -BuildRequires: python2-flask-sqlalchemy -BuildRequires: python2-mock -BuildRequires: python2-nose -BuildRequires: python2-psutil -BuildRequires: python2-pytest -BuildRequires: python2-pyOpenSSL -BuildRequires: python2-six -BuildRequires: python2-sqlalchemy -BuildRequires: python2-koji -%endif - -BuildRequires: systemd -%{?systemd_requires} - -Requires: fedmsg-hub -Requires: systemd -Requires: kobo -Requires: python2-funcsigs -Requires: python2-futures -Requires: python2-koji -Requires: python2-openidc-client -Requires: python2-pdc-client -Requires: python-enum34 -Requires: python-flask-script -Requires: python-httplib2 -Requires: python-munch - -%if 0%{?rhel} && 0%{?rhel} <= 7 -Requires: python-fedora -Requires: python-flask -Requires: python-flask-migrate -Requires: python-flask-sqlalchemy -Requires: python-mock -Requires: python-psutil -Requires: pyOpenSSL -Requires: python-six -Requires: python-sqlalchemy -%else -Requires: python2-fedora -Requires: python2-flask -Requires: python2-flask-migrate -Requires: python2-flask-sqlalchemy -Requires: python2-mock -Requires: python2-psutil -Requires: python2-pyOpenSSL -Requires: python2-six -Requires: python2-sqlalchemy -Requires: python2-systemd -%endif - -%description -Freshmaker is a service scheduling rebuilds of artifacts as new content becomes available. - -%prep -%setup -q - - -%build -%py2_build - - -%install -%py2_install - -export PYTHONPATH=%{buildroot}%{python2_sitelib} -mkdir -p %{buildroot}%{_mandir}/man1 -for command in freshmaker-manager freshmaker-frontend freshmaker-gencert freshmaker-upgradedb ; do -FRESHMAKER_CONFIG_FILE=conf/config.py help2man -N --version-string=%{version} \ - %{buildroot}%{_bindir}/$command > \ - %{buildroot}%{_mandir}/man1/$command.1 -done - - -%check -nosetests-%{python2_version} -v - - -%files -%doc README.md -%license LICENSE -%{python2_sitelib}/freshmaker* -%{_bindir}/freshmaker-* -%{_mandir}/man1/freshmaker-*.1* -%dir %{_sysconfdir}/freshmaker -%{_sysconfdir}/fedmsg.d/* -%config(noreplace) %{_sysconfdir}/freshmaker/config.py -%exclude %{_sysconfdir}/freshmaker/*.py[co] -%exclude %{_sysconfdir}/fedmsg.d/*.py[co] -%exclude %{python2_sitelib}/conf/ - - -%changelog -* Tue Jul 04 2017 Qixiang Wan - 0.0.4-1 -- Initial version of spec file