-#
-# Conditional build
-%bcond_with verbose # verbose build (V=1)
-#
Summary: cgit - a fast webinterface to git
Summary(pl.UTF-8): cgit - szybki interfejs WWW do gita
Name: cgit
-Version: 0.8.3.1
+Version: 0.10
Release: 1
License: GPL v2
Group: Development/Tools
-Source0: http://hjemli.net/git/cgit/snapshot/%{name}-%{version}.tar.bz2
-# Source0-md5: cc61989f702ce77e56137be67e01f3ed
+Source0: http://git.zx2c4.com/cgit/snapshot/%{name}-%{version}.tar.xz
+# Source0-md5: 19944c17ecea1b1d1944718ce8ce6b61
Source1: %{name}.conf
Source2: %{name}-repo.conf
-Source3: %{name}-httpd.conf
+Source3: %{name}-apache.conf
Patch0: %{name}-system-git.patch
-Patch1: %{name}-override-cflags.patch
-URL: http://hjemli.net/git/cgit
-BuildRequires: git-core-devel >= 1.7.1-2
+URL: http://git.zx2c4.com/cgit/about/
+BuildRequires: git-core-devel >= 1.8.5
BuildRequires: openssl-devel
+BuildConflicts: zlib-devel = 1.2.5-1
Requires: webapps
+Conflicts: apache-base < 2.4.0-1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define webapp cgit
%define appdir %{_datadir}/%{webapp}
%define cgibindir %{_prefix}/lib/cgi-bin
+%define _noautoreqfiles %{_libdir}/cgit/filters
+
%description
Cgit is a CGI application implemented in C: it's basically (yet)
another git command, used to generate HTML. Cgit is not forking: all
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
+cp %{_includedir}/git-core/{Makefile,config.*} git
%build
%{__make} \
+ V=1 \
CC="%{__cc}" \
CFLAGS="%{rpmcflags} -I/usr/include/git-core" \
LDFLAGS="%{rpmldflags}" \
LIBDIR=%{_libdir} \
CGIT_CONFIG="%{webappdir}/%{webapp}.conf" \
- CGIT_SCRIPT_PATH="%{cgibindir}" \
- %{?with_verbose:V=1}
+ CGIT_SCRIPT_PATH="%{cgibindir}"
%install
rm -rf $RPM_BUILD_ROOT
+# The same CFLAGS as in %build stage has to be passed to avoid
+# "new build flags" logic in Makefile
%{__make} install \
+ V=1 \
DESTDIR=$RPM_BUILD_ROOT \
- CGIT_CONFIG="%{webappdir}/%{webapp.conf}" \
- CGIT_SCRIPT_PATH="%{cgibindir}" \
- %{?with_verbose:V=1}
-
-# css and logo
-install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
-mv $RPM_BUILD_ROOT%{cgibindir}/%{name}.{css,png} $RPM_BUILD_ROOT%{appdir}
+ prefix=%{_prefix} \
+ CFLAGS="%{rpmcflags} -I/usr/include/git-core" \
+ CGIT_CONFIG="%{webappdir}/%{webapp}.conf" \
+ CGIT_DATA_PATH="%{appdir}" \
+ CGIT_SCRIPT_PATH="%{cgibindir}"
# cache
install -d $RPM_BUILD_ROOT/var/cache/cgit
%triggerun -- apache1 < 1.3.37-3, apache1-base
%webapp_unregister apache %{webapp}
-%triggerin -- apache < 2.2.0, apache-base
+%triggerin -- apache-base
%webapp_register httpd %{webapp}
-%triggerun -- apache < 2.2.0, apache-base
+%triggerun -- apache-base
%webapp_unregister httpd %{webapp}
%files
%attr(755,root,root) %{cgibindir}/cgit.cgi
%attr(770,root,http) /var/cache/cgit
%{appdir}
+%dir %{_prefix}/lib/cgit
+%dir %{_prefix}/lib/cgit/filters
+%attr(755,root,root) %{_prefix}/lib/cgit/filters/about-formatting.sh
+%attr(755,root,root) %{_prefix}/lib/cgit/filters/commit-links.sh
+%attr(755,root,root) %{_prefix}/lib/cgit/filters/email-gravatar.lua
+%attr(755,root,root) %{_prefix}/lib/cgit/filters/email-gravatar.py
+%attr(755,root,root) %{_prefix}/lib/cgit/filters/simple-authentication.lua
+%attr(755,root,root) %{_prefix}/lib/cgit/filters/syntax-highlighting.py
+%attr(755,root,root) %{_prefix}/lib/cgit/filters/syntax-highlighting.sh
+%{_prefix}/lib/cgit/filters/html-converters