From 077063ba4ba3dbf0a7a43c58c73bc906ed4684d2 Mon Sep 17 00:00:00 2001
From: Reto Brunner <reto@labrat.space>
Date: Sun, 7 Feb 2021 19:25:06 +0100
Subject: Makefile: use git version string if we can

Some packagers overwrote the version we embed in aerc, we really don't want that.
Hence we force clear the variable at the beginning of the makefile.
If git is available and returns a useful info we now use that version instead
of the hardcoded version
---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'Makefile')

diff --git a/Makefile b/Makefile
index 9ad5e29..661acef 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,13 @@
 .SUFFIXES:
 .SUFFIXES: .1 .5 .7 .1.scd .5.scd .7.scd
 
+override undefine VERSION # don't allow local overrides, we want our version
+_git_version=$(shell git describe --long --tags --dirty 2>/dev/null | sed 's/-/.r/;s/-/./')
+ifeq ($(strip $(_git_version)),)
 VERSION=0.5.2
+else
+VERSION=$(_git_version)
+endif
 
 VPATH=doc
 PREFIX?=/usr/local
-- 
cgit 1.4.1-2-gfad0

ass='sub'>Unnamed repository; edit this file 'description' to name the repository.</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/runxiyu/www/'>summary</a> <a href='/runxiyu/www/refs/?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>refs</a> <a href='/runxiyu/www/log/other-articles/guerilla.txt'>log</a> <a class='active' href='/runxiyu/www/tree/other-articles/guerilla.txt?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>tree</a> <a href='/runxiyu/www/commit/other-articles/guerilla.txt?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>commit</a> <a href='/runxiyu/www/diff/other-articles/guerilla.txt?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>diff</a> <a href='/runxiyu/www/stats/other-articles/guerilla.txt'>stats</a></td><td class='form'><form class='right' method='get' action='/runxiyu/www/log/other-articles/guerilla.txt'>
<input type='hidden' name='id' value='c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/runxiyu/www/tree/?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>root</a>/<a href='/runxiyu/www/tree/other-articles?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>other-articles</a>/<a href='/runxiyu/www/tree/other-articles/guerilla.txt?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>guerilla.txt</a></div><div class='content'>blob: 97e8404b96d400acc8abb9b3d87a332830829e7d (<a href='/runxiyu/www/plain/other-articles/guerilla.txt?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>plain</a>) (<a href='/runxiyu/www/blame/other-articles/guerilla.txt?id=c5be7bab3b6abbf4b071370540bc9c7aeba6ef0d'>blame</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
<a id='n6' href='#n6'>6</a>
<a id='n7' href='#n7'>7</a>
<a id='n8' href='#n8'>8</a>
<a id='n9' href='#n9'>9</a>
<a id='n10' href='#n10'>10</a>
<a id='n11' href='#n11'>11</a>
<a id='n12' href='#n12'>12</a>
<a id='n13' href='#n13'>13</a>
<a id='n14' href='#n14'>14</a>
<a id='n15' href='#n15'>15</a>
<a id='n16' href='#n16'>16</a>
<a id='n17' href='#n17'>17</a>
<a id='n18' href='#n18'>18</a>
<a id='n19' href='#n19'>19</a>
<a id='n20' href='#n20'>20</a>
<a id='n21' href='#n21'>21</a>
<a id='n22' href='#n22'>22</a>
<a id='n23' href='#n23'>23</a>
<a id='n24' href='#n24'>24</a>
<a id='n25' href='#n25'>25</a>
<a id='n26' href='#n26'>26</a>
<a id='n27' href='#n27'>27</a>
</pre></td>
<td class='lines'><pre><code>