diff --git a/.gitignore b/.gitignore index a0c60c3..9788944 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ -/dist-git-*.tar.gz +/dist-git-0.10.tar.gz +/dist-git-0.11.tar.gz +/dist-git-1.0.tar.gz +/dist-git-1.1.tar.gz +/dist-git-1.2.tar.gz +/dist-git-1.3.tar.gz +/dist-git-1.4.tar.gz +/dist-git-1.5.tar.gz diff --git a/dist-git.spec b/dist-git.spec index b9bec9d..10105e0 100644 --- a/dist-git.spec +++ b/dist-git.spec @@ -3,12 +3,12 @@ %global installdir /var/lib/dist-git Name: dist-git -Version: 1.20 -Release: 2%{?dist} +Version: 1.5 +Release: 1%{?dist} Summary: Package source version control system # upload.cgi uses GPLv1 -License: MIT AND GPL-1.0-only +License: MIT and GPLv1 URL: https://github.com/release-engineering/dist-git # Source is created by # git clone https://github.com/release-engineering/dist-git.git @@ -17,40 +17,28 @@ URL: https://github.com/release-engineering/dist-git Source0: %{name}-%{version}.tar.gz BuildArch: noarch +Patch0: ensure_gitrepo_namespaced.patch + BuildRequires: systemd Requires: httpd Requires: perl(Sys::Syslog) -Requires: (dist-git-selinux if selinux-policy-targeted) Requires: git Requires: git-daemon +Requires: python-requests +Requires: python-configparser Requires: mod_ssl +Requires: fedmsg Requires: crudini -%if 0%{?rhel} && 0%{?rhel} < 10 +Requires: moreutils Requires(pre): shadow-utils + +%if 0%{?fedora} +Suggests: python-grokmirror %endif -Requires: python3-requests -Recommends: python3-grokmirror -Suggests: python3-fedmsg -Suggests: fedora-messaging - -BuildRequires: python3-devel -BuildRequires: python3-pytest -BuildRequires: python3-requests - -# this should be Requires but see https://bugzilla.redhat.com/show_bug.cgi?id=1833810 -Recommends: moreutils - -%if 0%{?fedora} && 0%{?fedora} >= 41 -# The `cgi` module was removed from the Python 3.13 standard library -BuildRequires: python3-legacy-cgi -Requires: python3-legacy-cgi -%endif - - %description -DistGit is a Git repository specifically designed to hold RPM +Dist Git is a remote Git repository specifically designed to hold RPM package sources. @@ -58,11 +46,16 @@ package sources. Summary: SELinux support for dist-git BuildRequires: checkpolicy +BuildRequires: policycoreutils +BuildRequires: selinux-policy-devel BuildRequires: hardlink Requires: %name = %version-%release -BuildRequires: selinux-policy-devel -%{?selinux_requires} +%if "%{_selinux_policy_version}" != "" +Requires: selinux-policy >= %{_selinux_policy_version} +%endif +Requires(post): /usr/sbin/semodule, /sbin/restorecon +Requires(postun): /usr/sbin/semodule, /sbin/restorecon %description selinux @@ -74,7 +67,7 @@ This package includes SELinux support. %prep %setup -q - +%patch0 -p1 %build # ------------------------------------------------------------------------------ @@ -91,17 +84,12 @@ cd - %pre -%if 0%{?rhel} && 0%{?rhel} < 10 # ------------------------------------------------------------------------------ # Users and Groups # ------------------------------------------------------------------------------ getent group packager > /dev/null || \ groupadd -r packager exit 0 -%endif - -%check -%pytest -vv . %install @@ -123,8 +111,6 @@ cp -a configs/httpd/dist-git.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/ cp -a configs/httpd/dist-git/* %{buildroot}%{_sysconfdir}/httpd/conf.d/dist-git/ cp -a configs/systemd/* %{buildroot}%{_unitdir}/ -install -m0644 -D configs/sysusers.d/dist-git.conf %{buildroot}%{_sysusersdir}/dist-git.conf - # ------------------------------------------------------------------------------ # /var/lib/ ...... dynamic persistent files # ------------------------------------------------------------------------------ @@ -137,20 +123,6 @@ install -d %{buildroot}%{installdir}/web cp -a scripts/httpd/upload.cgi %{buildroot}%{installdir}/web/ -%if 0%{?rhel} && 0%{?rhel} < 8 - sed -i '1 s|#.*|#!/usr/bin/python2|' %{buildroot}%{installdir}/web/upload.cgi -%endif - -# ------------------------------------------------------------------------------ -# /usr/bin/ ...... links to executable files -# ------------------------------------------------------------------------------ -install -d %{buildroot}%{_bindir} -ln -s %{_datadir}/dist-git/setup_git_package %{buildroot}%{_bindir}/setup_git_package -ln -s %{_datadir}/dist-git/mkbranch %{buildroot}%{_bindir}/mkbranch -ln -s %{_datadir}/dist-git/mkbranch_branching %{buildroot}%{_bindir}/mkbranch_branching -ln -s %{_datadir}/dist-git/remove_unused_sources %{buildroot}%{_bindir}/remove_unused_sources -mv %{buildroot}%{_datadir}/dist-git/dist-git-gc %{buildroot}%{_bindir}/dist-git-gc - # ------------------------------------------------------------------------------ # SELinux # ------------------------------------------------------------------------------ @@ -163,7 +135,7 @@ do done cd - -hardlink -cv %{buildroot}%{_datadir}/selinux +/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux %post selinux for selinuxvariant in %{selinux_variants} @@ -211,8 +183,6 @@ fi %{_unitdir}/dist-git@.service %{_unitdir}/dist-git.socket -%{_unitdir}/dist-git-gc.service -%{_unitdir}/dist-git-gc.timer # ------------------------------------------------------------------------------ # /var/lib/ ...... dynamic persistent files @@ -234,105 +204,25 @@ fi %dir %{_datadir}/dist-git %attr (775, -, -) %{_datadir}/dist-git/* -%{_bindir}/dist-git-gc -# TODO: move _datadir executables to _libexecdir, and drop these symlinks -%{_bindir}/mkbranch -%{_bindir}/mkbranch_branching -%{_bindir}/remove_unused_sources -%{_bindir}/setup_git_package -%{_sysusersdir}/dist-git.conf %files selinux +%defattr(-,root,root,0755) %doc selinux/* %{_datadir}/selinux/*/%{modulename}.pp %changelog -* Wed Jul 15 2026 Fedora Release Engineering - 1.20-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Tue Jul 07 2026 Miroslav Suchý 1.20-1 -- Fix tests for Python 3.15: replace removed CGIHTTPRequestHandler - -* Fri Feb 13 2026 Pavel Raiskup 1.19-1 -- Avoid using parameterized and nose -- Add sysusers.d config file to allow rpm to create users/groups automatically - -* Fri Sep 27 2024 Pavel Raiskup 1.18-1 -- replace test on _selinux_policy_version by macro that does it all -- handle situation when _selinux_policy_version is not defined -- silence pylint -- remove rhel7 specific code -- Move %%_bindir symlinks out from dist-git-selinux -- Depend on python3-legacy-cgi for F41+ -- licensing: update the project's COPYING file -- dist-git: move the code into sub-directory - -* Wed Jan 04 2023 Miroslav Suchý 1.17-1 -- use spdx license -- use pytest instead of nose test - -* Mon Oct 5 2020 clime - 1.16-1 -- fixed exceptions for fedora-messaging -- fixed topic for fedora-messaging (to git.lookaside.new) -- spec tweak not to require distgit-selinux in containers -- only Suggests fedmsg -- garbage collection (git gc) script and systemd timer - for its periodic run added - -* Fri Jun 12 2020 clime - 1.15-1 -- added support for fedora-messaging - -* Thu May 21 2020 clime - 1.14-1 -- disable unit tests temporarily as they do not pass - with network disabled during build - -* Thu May 21 2020 clime - 1.13-1 -- fedmsg made an optional (recommnended) dependency -- slight refactoring of upload.cgi script -- tests added and documented - -* Tue May 28 2019 Miroslav Suchy - 1.12-1 -- remove old changelog entries -- do not specify full path for hardlink [RHBZ#1714637] -- add script for removing unused source tarballs in lookaside cache - -* Tue Apr 30 2019 clime 1.11-1 -- remove python3-configparser require -- move scripts to bindir - -* Mon Mar 11 2019 clime 1.10-1 -- python3 support -- fix post-receive hook in case post.receive.d is empty - -* Fri Nov 23 2018 clime 1.9-1 -- do not create sources file when creating a repo -- set umask 0002 in all available dist-git scripts -- Use REMOTE_USER as fallback for GSS_NAME -- add support for setting mtime for an uploaded file - -* Tue Aug 14 2018 clime 1.8-1 -- add disable group check option -- add lookaside_dir option -- deprecate cache_dir -- fix python-grokmirror dep - -* Mon Feb 26 2018 clime 1.7-1 -- move 'fedmsgs', 'old_paths', 'nomd5' options to optional upload section - -* Mon Feb 19 2018 clime 1.6-1 -- add 'fedmsgs', 'old_paths', and 'default_namespace' config options -- remove domain_read_all_domains_state SELinux rule -- require dist-git-selinux -- give optional map permission to git_system_t on git_user_content_t -- update requires to work for all environments -- make the package completely distribution-agnostic - * Mon Dec 18 2017 clime 1.5-1 - make selinux policy build on f27+ - add optional map SELinux permission for httpd_t +* Thu Oct 26 2017 clime 1.4-3 +- add ensure_gitrepo_namespaced patch + +* Wed Jul 26 2017 Fedora Release Engineering 1.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Tue Jul 25 2017 clime 1.4-1 - disable md5 uploading by default @@ -347,3 +237,62 @@ fi * Wed May 03 2017 clime 1.1-1 - fix default config value for email - fix name/email switch + +* Mon Apr 10 2017 clime 1.0-1 +- big redo of the package +- gitolite dropped from the package (but can be installed additionally) +- pkgdb integration dropped +- upload.cgi updated from FedoraInfra state +- git repos are stored one level higher in fs hiearchy (default: /var/lib/dist-git/git/) +- dist-git.conf completely new +- updated setup_git_package, mkbranch, mkbranch_branching +- updated SELinux policy +- configurable paths to cache dir and git repos +* Wed Aug 05 2015 Adam Samalik 0.13-1 +- optional cgit_pkg_list.sh parameter (asamalik@redhat.com) +- change mv to cp + rm (asamalik@redhat.com) +- update config to not be Fedora specific (asamalik@redhat.com) +- Change: lookaside dir perms + cgit_pkg_list.sh (asamalik@redhat.com) + +* Mon Jul 20 2015 Adam Samalik 0.12-1 +- config update (asamalik@redhat.com) +- Upload files to new and old paths + remove email (asamalik@redhat.com) + +* Tue May 05 2015 Adam Samalik 0.11-1 +- SELinux subpackage + +* Mon Apr 27 2015 Adam Samalik 0.10-1 +- perl require and files update (asamalik@redhat.com) + +* Thu Apr 23 2015 Adam Samalik 0.9-1 +- update hook update (asamalik@redhat.com) + +* Thu Apr 23 2015 Adam Samalik 0.8-1 +- review update (asamalik@redhat.com) + +* Wed Apr 22 2015 Adam Samalik 0.7-1 +- git hooks permissions (asamalik@redhat.com) +- noreplace configs (asamalik@redhat.com) +- fixes after rpmlint (asamalik@redhat.com) + +* Wed Apr 22 2015 Adam Samalik 0.6-1 +- license + description (asamalik@redhat.com) +- cron files fix (asamalik@redhat.com) + +* Wed Apr 15 2015 Adam Samalik 0.5-1 +- git hook: update-block-push-origin (asamalik@redhat.com) +- lookaside-upload config comments (asamalik@redhat.com) +- gen-acls user fix (asamalik@redhat.com) +- ssl httpd configs as examples (asamalik@redhat.com) + +* Fri Apr 10 2015 Adam Samalik 0.4-1 +- spec and config fix +- systemd services + +* Tue Mar 31 2015 Adam Samalik 0.3-1 +- alpha package (asamalik@redhat.com) + +* Mon Mar 30 2015 Adam Samalik 0.2-1 +- new package built with tito + + diff --git a/ensure_gitrepo_namespaced.patch b/ensure_gitrepo_namespaced.patch new file mode 100644 index 0000000..e440166 --- /dev/null +++ b/ensure_gitrepo_namespaced.patch @@ -0,0 +1,39 @@ +From 15ec38ca2cb761ca02eb75d6a31565f894bf2f00 Mon Sep 17 00:00:00 2001 +From: clime +Date: Thu, 26 Oct 2017 17:06:04 +0200 +Subject: [PATCH] patch for Fedora + +--- + scripts/httpd/upload.cgi | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/scripts/httpd/upload.cgi b/scripts/httpd/upload.cgi +index 1de12a3..78f3ba9 100644 +--- a/scripts/httpd/upload.cgi ++++ b/scripts/httpd/upload.cgi +@@ -91,6 +91,13 @@ def makedirs(dir_, username, mode=02755): + send_error(str(e)) + + ++def ensure_namespaced(name): ++ name_parts = name.split('/') ++ if len(name_parts) == 1: ++ return 'rpms/'+name ++ return name ++ ++ + def main(): + config = ConfigParser() + config.read('/etc/dist-git/dist-git.conf') +@@ -165,7 +172,7 @@ def main(): + msgpath = os.path.join(name, filename, hash_type, checksum, filename) + + # first test if the module really exists +- git_dir = os.path.join(config['dist-git']['gitroot_dir'], '%s.git' % name) ++ git_dir = os.path.join(config['dist-git']['gitroot_dir'], '%s.git' % ensure_namespaced(name)) + if not os.path.isdir(git_dir): + sys.stderr.write('[username=%s] Unknown module: %s' % (username, name)) + send_error('Module "%s" does not exist!' % name, +-- +2.9.5 + diff --git a/packit.yaml b/packit.yaml deleted file mode 100644 index 0b8d165..0000000 --- a/packit.yaml +++ /dev/null @@ -1,24 +0,0 @@ -upstream_project_url: https://github.com/release-engineering/dist-git -upstream_tag_template: dist-git-{version}-1 -issue_repository: https://github.com/release-engineering/dist-git -copy_upstream_release_description: false - -jobs: -- job: pull_from_upstream - trigger: release - dist_git_branches: - - rawhide - - epel9 - -- job: koji_build - trigger: commit - allowed_committers: ['packit'] - dist_git_branches: - - fedora-all - - epel9 - -- job: bodhi_update - trigger: commit - dist_git_branches: - - fedora-all - - epel9 diff --git a/sources b/sources index 02a6f8a..1badd0e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (dist-git-1.20.tar.gz) = f68aa733a2d0e0faa8973ced5260a1c5b0f6892c5ebfca977ac17ca3bfbda33225d866bb1c16abe761452d17594399a75815a49f5d941dd2e0c5404a69a1f3be +SHA512 (dist-git-1.5.tar.gz) = d5278ecfb498c0da0965932a1ed3e9e4893763d6dcf07c1732dbfdcf5ab2d5ba8b60fde8ebe723fd5157ec920abf9171c5a26739800e7ab1eb692b592f39b1f1