From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <io-uring-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 8F6E2C433F5
	for <io-uring@archiver.kernel.org>; Fri, 21 Jan 2022 18:26:59 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1382095AbiAUS05 (ORCPT <rfc822;io-uring@archiver.kernel.org>);
        Fri, 21 Jan 2022 13:26:57 -0500
Received: from dcvr.yhbt.net ([64.71.152.64]:51034 "EHLO dcvr.yhbt.net"
        rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
        id S1382084AbiAUS0w (ORCPT <rfc822;io-uring@vger.kernel.org>);
        Fri, 21 Jan 2022 13:26:52 -0500
Received: from localhost (dcvr.yhbt.net [127.0.0.1])
        by dcvr.yhbt.net (Postfix) with ESMTP id 16B951FA19;
        Fri, 21 Jan 2022 18:26:36 +0000 (UTC)
From:   Eric Wong <e@80x24.org>
To:     io-uring@vger.kernel.org
Cc:     Stefan Metzmacher <metze@samba.org>,
        Liu Changcheng <changcheng.liu@aliyun.com>,
        Eric Wong <e@80x24.org>
Subject: [PATCH v3 6/7] make-debs: use version from RPM .spec
Date:   Fri, 21 Jan 2022 18:26:34 +0000
Message-Id: <20220121182635.1147333-7-e@80x24.org>
In-Reply-To: <20220121182635.1147333-1-e@80x24.org>
References: <20220121182635.1147333-1-e@80x24.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Precedence: bulk
List-ID: <io-uring.vger.kernel.org>
X-Mailing-List: io-uring@vger.kernel.org

git tags may be behind the .spec file during development, so
favor the .spec file as in commit c0b43df28a982747
(src/Makefile: use VERSION variable consistently, 2021-11-15).
This brings us one step closer to being able to build Debian
packages without git.

Signed-off-by: Eric Wong <e@80x24.org>
---
 Makefile     | 5 ++++-
 make-debs.sh | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 28c0fd8..48fb48a 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,10 @@ all:
 	@$(MAKE) -C test
 	@$(MAKE) -C examples
 
-.PHONY: all install default clean test
+print-version:
+	@echo $(VERSION)
+
+.PHONY: all install default clean test print-version
 .PHONY: FORCE cscope
 
 partcheck: all
diff --git a/make-debs.sh b/make-debs.sh
index aea05f0..0913c47 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -32,7 +32,7 @@ src_dir=$(readlink -e `basename $0`)
 liburing_dir=$(dirname $src_dir)
 basename=$(basename $liburing_dir)
 dirname=$(dirname $liburing_dir)
-version=$(git describe --match "lib*" | cut -d '-' -f 2)
+version=$(make print-version | tail -n1)
 outfile="liburing-$version"
 orgfile=$(echo $outfile | tr '-' '_')