# remirepo spec file for cgit, from: # # Fedora spec file for cgit # # License: MIT # http://opensource.org/licenses/MIT # # Please preserve changelog entries # # Review bug: https://bugzilla.redhat.com/479723 %global gitver 2.10.2 %global cachedir %{_localstatedir}/cache/%{name} %global filterdir %{_libexecdir}/%{name}/filters %global scriptdir %{_localstatedir}/www/cgi-bin %global cgitdata %{_datadir}/%{name} %global syntax_highlight 1 # Temporarily -- in epel-7-ppc64 is not highlight package currently, #1117261 %if 0%{?rhel} == 7 %ifarch ppc64 %global syntax_highlight 0 %endif %endif Name: cgit Version: 1.1 Release: 11%{?dist} Summary: A fast web interface for git Group: Development/Tools License: GPLv2 URL: https://git.zx2c4.com/cgit/ Source0: https://git.zx2c4.com/cgit/snapshot/%{name}-%{version}.tar.xz Source1: https://www.kernel.org/pub/software/scm/git//git-%{gitver}.tar.xz Source2: cgitrc Source3: README.SELinux # https://git.zx2c4.com/cgit/commit/?id=53efaf30b Patch0: 0001-clone-fix-directory-traversal.patch # Security guys might try to repoquery for this. Provides: bundled(git) = %gitver %if %{syntax_highlight} # All supported releases use hightlight version 3. Patch1: cgit-0.9.1-highlightv3.patch BuildRequires: highlight %endif BuildRequires: asciidoc BuildRequires: gcc %if 0%{?fedora} || 0%{?rhel} >= 6 BuildRequires: libcurl-devel %else BuildRequires: curl-devel %endif BuildRequires: openssl-devel BuildRequires: lua-devel BuildRequires: make %if 0%{?fedora} # just to be able to install httpd configuration correctly, FC21+ Requires: httpd-filesystem %endif Requires: webserver %description Cgit is a fast web interface for git. It uses caching to increase performance. %prep %setup -q -a 1 %patch0 -p1 %if %{syntax_highlight} %patch1 -p1 %endif # setup the git dir rm -rf git mv git-%{gitver} git # Use the same options for every invocation of 'make'. # Otherwise it will rebuild in %%install due to flags changes. cat << \EOF > cgit.conf V = 1 CFLAGS = %{optflags} LDFLAGS = %{?__global_ldflags} DESTDIR = %{buildroot} INSTALL = install -p CACHE_ROOT = %{cachedir} CGIT_SCRIPT_PATH = %{scriptdir} CGIT_SCRIPT_NAME = cgit CGIT_DATA_PATH = %{cgitdata} docdir = %{docdir} filterdir = %{filterdir} prefix = %{_prefix} EOF # git build flags cat << \EOF > git/config.mak V = 1 CFLAGS = %{optflags} LDFLAGS = %{?__global_ldflags} EOF # I tried to use matchpathcon, but we would need to require # selinux-policy-targeted probably. build_dist=%{?fedora:fedora}%{?rhel:rhel} build_ver=%{?fedora}%{?rhel} cgit_context=git_sys_content_t sed -e "s|@CGIT_CONTEXT@|$cgit_context|g" \ %{SOURCE3} > README.SELinux cat > httpd.conf <= 19 || 0%{?rhel} >= 7 Require all granted %endif EOF %build make %{?_smp_mflags} # Something in the a2x chain doesn't like running in parallel. :/ make -j1 doc-man doc-html %if %{syntax_highlight} # el5 highlight doesn't know --print-style highlight --print-style --style-outfile=stdout >> cgit.css %endif %install make DESTDIR=%{buildroot} install install-man install -d -m0755 %{buildroot}%{_sysconfdir}/httpd/conf.d install -p -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/cgitrc install -p -m0644 httpd.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/cgit.conf install -d -m0755 %{buildroot}%{cachedir} %files %doc COPYING README* *.html %config(noreplace) %{_sysconfdir}/cgitrc %if 0%{?rhel} && 0%{?rhel} <= 7 # Keep those two httpd-owned directories listed here until httpd-filesystem # becomes part of EPEL. See rhbz#1138599 for more details. %dir %{_sysconfdir}/httpd %dir %{_sysconfdir}/httpd/conf.d %endif %config(noreplace) %{_sysconfdir}/httpd/conf.d/cgit.conf %dir %attr(-,apache,root) %{cachedir} %{cgitdata} %{filterdir} %{scriptdir}/* %{_mandir}/man*/* %changelog * Fri Aug 24 2018 Remi Collet - 1.1-11 - rebuild for remirepo, synced with EPEL-7: * Fri Aug 03 2018 Todd Zullinger - 1.1-11 - Fix directory traversal vulnerability * Sun Feb 18 2018 Todd Zullinger - 1.1-10 - Use https for source URLs - Remove el5 conditionals - Use cgit.conf and config.mak for cgit/git build options - Drop obsolete %%{buildroot} cleanup - Add gcc and make BuildRequires * Mon Jul 24 2017 Todd Zullinger - 1.1-5 - Require webserver on all dists (#1468839) * Mon Jul 24 2017 Kevin Fenzi - 1.1-4 - Fix httpd requirements on epel7. Fixes bug #1468839 * Tue Mar 07 2017 Pavel Raiskup - 1.1-3 - suggest using correct selinux context (rhbz#1429790) * Fri Feb 10 2017 Fedora Release Engineering - 1.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Nov 23 2016 Kevin Fenzi - 1.1-1 - Update to 1.1. Fixes bug #1397820 * Mon Sep 19 2016 Pavel Raiskup - 1.0-2 - ensure we inform about git bundling appropriately * Tue Jun 07 2016 Kevin Fenzi - 1.0-1 - Update to 1.0 * Wed Feb 03 2016 Fedora Release Engineering - 0.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Sat Jan 16 2016 Kevin Fenzi - 0.12-1 - Update to 0.12. Fixes bug #1298912 - Fixes CVE-2016-1899 CVE-2016-1900 CVE-2016-1901 * Sat Sep 05 2015 Kevin Fenzi 0.11.2-3 - Fix up logic around webserver and httpd. - On Fedora require webserver and httpd-filesystem - On EPEL require httpd. * Wed Jun 17 2015 Fedora Release Engineering - 0.11.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat Mar 14 2015 Kevin Fenzi 0.11.2-1 - Update to 0.11.2 * Tue Mar 10 2015 Kevin Fenzi 0.11.1-1 - Update to 0.11.1 * Mon Feb 16 2015 Kevin Fenzi 0.11.0-1 - Update to 0.11.0 * Mon Feb 09 2015 Pavel Raiskup - 0.10.2-5 - require "any" 'webserver' instead of concrete 'httpd' (#1138599) * Fri Aug 15 2014 Fedora Release Engineering - 0.10.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Tue Jul 08 2014 Pavel Raiskup - 0.10.2-3 - currently epel-7-ppc64 does not have highlight package (#1117261) * Tue Jul 08 2014 Pavel Raiskup - 0.10.2-2 - install README.SELinux documentation again (#1036123) - generate cgit.conf for httpd >= 2.4 when needed * Tue Jul 01 2014 Kevin Fenzi 0.10.2-1 - Update to 0.10.2. Fixes bug #1114970 * Wed Jun 11 2014 Kevin Fenzi 0.10.1-4 - Add patch to fix raw patch handling * Sat Jun 07 2014 Fedora Release Engineering - 0.10.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Thu Mar 20 2014 Ville Skyttä - 0.10.1-2 - Include highlight styles in cgit.css * Thu Feb 27 2014 Kevin Fenzi 0.10.1-1 - Update to 0.10.1 - Correctly enable lua filters. * Wed Feb 19 2014 Kevin Fenzi 0.10-1 - Update to 0.10 * Sat Aug 03 2013 Fedora Release Engineering - 0.9.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Mon May 27 2013 Todd Zullinger - 0.9.2-1 - Update to 0.9.2, fixes CVE-2013-2117 * Wed Feb 13 2013 Fedora Release Engineering - 0.9.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Wed Nov 21 2012 Kevin Fenzi 0.9.1-3 - Fixed ldflags. Fixes bug 878611 * Sat Nov 17 2012 Kevin Fenzi 0.9.1-2 - Add patch to use correct version of highlight for all branches except epel5 * Thu Nov 15 2012 Kevin Fenzi 0.9.1-1 - Update to 0.9.1 - Fixes bug #870714 - CVE-2012-4548 - Fixes bug #820733 - CVE-2012-4465 * Wed Jul 18 2012 Fedora Release Engineering - 0.9.0.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Thu Jan 12 2012 Fedora Release Engineering - 0.9.0.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Fri Jul 22 2011 Todd Zullinger - 0.9.0.2-2 - Fix potential XSS vulnerability in rename hint * Thu Jul 21 2011 Todd Zullinger - 0.9.0.2-1 - Update to 0.9.0.2 * Sun Mar 06 2011 Todd Zullinger - 0.9-1 - Update to 0.9 - Fixes: CVE-2011-1027 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-1027 - Generate and install man page and html docs - Use libcurl-devel on RHEL >= 6 - Include example filter scripts - Update example cgitrc * Tue Feb 08 2011 Fedora Release Engineering - 0.8.2.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Mon Sep 27 2010 Todd Zullinger - 0.8.2.1-4 - Appy upstream git patch for CVE-2010-2542 (#618108) * Fri Aug 21 2009 Tomas Mraz - 0.8.2.1-3 - rebuilt with new openssl * Fri Jul 24 2009 Fedora Release Engineering - 0.8.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sun Mar 15 2009 Todd Zullinger - 0.8.2.1-1 - Update to 0.8.2.1 * Mon Feb 23 2009 Fedora Release Engineering - 0.8.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sun Feb 01 2009 Todd Zullinger - 0.8.2-1 - Update to 0.8.2 - Drop upstreamed Makefile patch * Sun Jan 18 2009 Todd Zullinger - 0.8.1-2 - Rebuild with new openssl * Mon Jan 12 2009 Todd Zullinger - 0.8.1-1 - Initial package