summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2018-02-18 13:05:35 -0500
committerTodd Zullinger <tmz@pobox.com>2018-02-18 13:10:53 -0500
commit5038a3a6392e9881518e90ed75da0e8bb8308f01 (patch)
treece3c82eb9f83fe447c587ad0f383c536fcfcce85
parent99d5ca6f649683379d2df7fc4ed57280ee5e6356 (diff)
downloadcgit_EL6-5038a3a6392e9881518e90ed75da0e8bb8308f01.tar.gz
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.
-rw-r--r--cgit.spec46
1 files 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 <tmz@pobox.com> - 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 <releng@fedoraproject.org> - 1.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild