From 5038a3a6392e9881518e90ed75da0e8bb8308f01 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Sun, 18 Feb 2018 13:05:35 -0500 Subject: Use cgit.conf and config.mak for cgit/git build options Both cgit and git Makefiles allow build options to be set via a file. Use it and drop the %make_cgit macro. Use the %make_build and %make_install macros as well. --- cgit.spec | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/cgit.spec b/cgit.spec index defc189..d1d70a8 100644 --- a/cgit.spec +++ b/cgit.spec @@ -15,20 +15,6 @@ %endif %endif -%global make_cgit \ -export CFLAGS="%{optflags}" \ -export LDFLAGS="%{?__global_ldflags}" \ -make V=1 %{?_smp_mflags} \\\ - 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} - Name: cgit Version: 1.1 Release: 10%{?dist} @@ -79,7 +65,30 @@ Cgit is a fast web interface for git. It uses caching to increase performance. # setup the git dir rm -rf git mv git-%{gitver} git -sed -i 's|^\(CFLAGS = \).*|\1%{optflags}|' git/Makefile + +# 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. @@ -103,10 +112,10 @@ EOF %build -%{make_cgit} +%make_build # Something in the a2x chain doesn't like running in parallel. :/ -%{make_cgit} -j1 doc-man doc-html +make -j1 doc-man doc-html %if %{syntax_highlight} # el5 highlight doesn't know --print-style @@ -116,7 +125,7 @@ highlight --print-style --style-outfile=stdout >> cgit.css %install rm -rf %{buildroot} -%{make_cgit} install install-man +%make_install 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 @@ -146,6 +155,7 @@ install -d -m0755 %{buildroot}%{cachedir} * 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 * Wed Feb 07 2018 Fedora Release Engineering - 1.1-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild -- cgit