From nobody Wed May 8 23:10:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1603750760; cv=none; d=zohomail.com; s=zohoarc; b=hPKYA0d3uL+EvJxMBKYtPMbMpmHFcuGXWeTQKgp5g3D9Fb2saeb215XgwH7O98N6U57f72ulbe8NLYicLFPihURj5yiKG2SifjEe09+dtCkqG49J2BPFkeRLOQJRvAUimH59h4xWEPsPpuX6d/su4PyXrZ/37ZcPWgTCI6JglWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603750760; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=nWXivzp7zb65iHphshA7g/TyPSBJBUTv7iJMhe6PvLg=; b=ku2ze47XkwtNTa6wv+wVMpxDUc0Hdu3dhi1ZfkzgjPUTkuLJiOxK3fQj5TrcDAY/qXUmXKxxwCFZhYj2LVpCCSgw5GnA6iBoc6WuIoUYG9ninAiSH1VD456r4wfARUxnG1BrtumJjReUnjNR5bT+vvzjVifMVFAOVE34D8quGyM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603750760586968.7924955980068; Mon, 26 Oct 2020 15:19:20 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-531-A2uO1dFYNbert-Xad4Mv4A-1; Mon, 26 Oct 2020 18:19:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDBD3804B66; Mon, 26 Oct 2020 22:19:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97B985D9CA; Mon, 26 Oct 2020 22:19:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 809A69231E; Mon, 26 Oct 2020 22:19:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09QM8gp9006623 for ; Mon, 26 Oct 2020 18:08:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 48217114B309; Mon, 26 Oct 2020 22:08:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 43D08114B308 for ; Mon, 26 Oct 2020 22:08:39 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3D8B81021F82 for ; Mon, 26 Oct 2020 22:08:39 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-cNNiicnkOgexjcPGTBEjKA-1; Mon, 26 Oct 2020 18:08:36 -0400 Received: by mail-qt1-f194.google.com with SMTP id c5so7965970qtw.3 for ; Mon, 26 Oct 2020 15:08:35 -0700 (PDT) Received: from localhost.localdomain (ool-18e49371.dyn.optonline.net. [24.228.147.113]) by smtp.gmail.com with ESMTPSA id d7sm7549647qkg.29.2020.10.26.15.08.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 15:08:35 -0700 (PDT) X-MC-Unique: A2uO1dFYNbert-Xad4Mv4A-1 X-MC-Unique: cNNiicnkOgexjcPGTBEjKA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nWXivzp7zb65iHphshA7g/TyPSBJBUTv7iJMhe6PvLg=; b=nJTsvwRlG7qOvJsG702lAUpnFlPFThawE7e7EtshL1Cdp/i/PnnzjHmwGcAsGC3WbO oFlZ9V8lNrGS655BjxO8dUGCcXOGoves1vjUhx14hJVWa29/W2x8LB46ssyVhl2JWxYk Bu9yiQWhx8HzHWf3nncRlQUpofuLquawZcEVCw4xfu1VQASPSaLxq/PwZaQsPSKVBfwA wynJzXEc05n9D+e2zhq6Q6r8+meAVfSmZjR1lYzVMuP/u24FALLP7hsifHT2sngeBp2F 8EG8uv58bE+nifAvrXi8SfHiAQKM11Rq4fatdxiP+7VpBHQX7ntTZG4BmpTy8bUPCp4M +J1g== X-Gm-Message-State: AOAM532Cy6Chu6dV/kbVYVlIChcQ9kgn9xcbdzcPTlu0dMEXSRls613E kjO3EY0gNqihiiInx5x6RJoLwsgbhU3xsg== X-Google-Smtp-Source: ABdhPJxWzoDQsg+EE2Ncu9HIdkvzCg3rEkovmhKCcNBFqGUKjNhVvxJ+rwgZkbLNKL0vWdYoqIZnEw== X-Received: by 2002:ac8:70d6:: with SMTP id g22mr17586335qtp.199.1603750115339; Mon, 26 Oct 2020 15:08:35 -0700 (PDT) From: Neal Gompa To: libvir-list@redhat.com Subject: [PATCH] rpm: Fix handling of SOURCE_DATE_EPOCH Date: Mon, 26 Oct 2020 18:08:20 -0400 Message-Id: <20201026220820.60737-1-ngompa13@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Neal Gompa X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Contemporary versions of Fedora automatically set SOURCE_DATE_EPOCH based on the changelog entry date stamp. In scenarios where it already is defined, we do not want to redefine it. Additionally, when building the libvirt package in an Open Build Service instance, the spec file is not present in %_specdir, but instead in %_sourc= edir. Signed-off-by: Neal Gompa --- libvirt.spec.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 2a4324b974..eb0fba4b5a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1128,7 +1128,16 @@ exit 1 =20 # place macros above and build commands below this comment =20 -export SOURCE_DATE_EPOCH=3D$(stat --printf=3D'%Y' %{_specdir}/%{name}.spec) +if [ -z "${SOURCE_DATE_EPOCH}" ]; then +# If SOURCE_DATE_EPOCH is not defined, set it based on spec file + if [ ! -f "%{_specdir}/%{name}.spec" ]; then + # OBS does not install the spec file into the specdir + SPECFILE_PATH=3D"%{_sourcedir}/%{name}.spec" + else + SPECFILE_PATH=3D"%{_specdir}/%{name}.spec" + fi + export SOURCE_DATE_EPOCH=3D$(stat --printf=3D'%Y' ${SPECFILE_PATH}) +fi =20 %meson \ -Drunstatedir=3D%{_rundir} \ --=20 2.28.0