From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=maxchernoff.ca Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=maxchernoff.ca header.i=@maxchernoff.ca header.a=rsa-sha256 header.s=key1 header.b=XQowCeKb; dkim-atps=neutral Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) by passt.top (Postfix) with ESMTPS id 38B7D5A0280 for ; Sat, 24 May 2025 09:07:13 +0200 (CEST) Message-ID: <81a4ca4a36342affc942486e7adb3b03b20112da.camel@maxchernoff.ca> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maxchernoff.ca; s=key1; t=1748070431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sCsDKmugjy7/8iOhF06LnyraYpVQ5Dhxqjbe5iWWDl0=; b=XQowCeKbSdI8TueNASfEfJ0NOizI40+LA6El+BJ0AMo8h+kiM9Yl2P15GqvQUe5LLEKyKY nPQheklo16AFWuMhE+tozopFCjNWs9SKKShsc5+g3YB8yj+g8zr8WzT+CkgPhbyYPRcPTW S1A2WClWEyt8M4aETO5ixXJom6cI8NgIVmpe5ad/gJ0isRbwlL9z1PmzzzNUYzjjYoD7eN Zm84UBrVfc5K+LzX6K8Sxu090kWGhTVE5dAWO9/hirGA7e1XOBOXRwhBKJPMEmyvVG5n5L kfUckDZvMj3NGmM/+xE2xYs3efvWm6QmhOjNiixDlZH8Iv/ZJxOn6UsAYfM86g== Subject: Re: [PATCH] fedora: Separately restore context for /run/user in %posttrans selinux X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Max Chernoff To: Stefano Brivio , Max Chernoff Date: Sat, 24 May 2025 01:07:01 -0600 In-Reply-To: <20250523141907.74aff624@elisabeth> References: <20250522211331.3904674-1-sbrivio@redhat.com> <20250523141907.74aff624@elisabeth> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-MailFrom: git@maxchernoff.ca X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: NXICJ5ZEF25A6KGIZ6HILEP7YUQ2QH4O X-Message-ID-Hash: NXICJ5ZEF25A6KGIZ6HILEP7YUQ2QH4O X-Mailman-Approved-At: Sat, 24 May 2025 10:00:28 +0200 CC: passt-dev@passt.top, Paul Holzinger X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi Stefano, On Fri, 2025-05-23 at 14:19 +0200, Stefano Brivio wrote: > For one-off builds: > > > but I was eventually able to get the following to work: > > > > $ git archive --prefix=3Dpasst-$(git rev-parse @)/ @ > ./passt-$(gi= t rev-parse @).tar > > $ xz passt-*.tar > > $ mv *.tar.xz contrib/fedora/ > > $ cd contrib/fedora/ > > $ rpkg local --outdir $(realpath .) > > I actually do something like this, but uglier. I didn't think of using > git-archive: > > $ mkdir passt-679cb68455a9ae40cc72233abf218c20527500a6/ > $ cp -Rpd *.c *.h Makefile seccomp.sh passt.1 passt-repair.1 qrap.1 READM= E.md doc/ contrib/ LICENSES/ passt-679cb68455a9ae40cc72233abf218c20527500a6= / > $ tar Jcvf /home/sbrivio/rpmbuild/SOURCES/passt-679cb68455a9ae40cc72233ab= f218c20527500a6.tar.xz passt-679cb68455a9ae40cc72233abf218c20527500a6/ > $ cd contrib/fedora > $ rpkg spec > /tmp/rpkg/passt-1-djdq6cud/passt.spec > $ rpmbuild -ba /tmp/rpkg/passt-1-djdq6cud/passt.spec Ah, I've never built an rpm package before, so I figured that I was just missing something obvious. > We would need to replace %prep with a simple copy from the current > directory. I didn't really think this through, but perhaps we could > make it conditional, like this: > > diff --git a/contrib/fedora/passt.spec b/contrib/fedora/passt.spec > index 745cf01..f1973ee 100644 > --- a/contrib/fedora/passt.spec > +++ b/contrib/fedora/passt.spec > @@ -47,7 +47,13 @@ Requires(preun): policycoreutils > This package adds SELinux enforcement to passt(1), pasta(1), passt-repai= r(1). > > %prep > +%if "%(ls passt.c)" =3D=3D "passt.c" > +# Hack for local build from source tree > +cp -a %(pwd)/* . > +%else > +# The usual process with an upstream tarball > %setup -q -n passt-%{git_hash} > +%endif > > %build > %set_build_flags I also needed to add "touch ../passt-%{git_hash}.tar.xz" (which is an awful hack) for it to work properly: diff --git a/contrib/fedora/passt.spec b/contrib/fedora/passt.spec index 5aaf7ac..02dab93 100644 --- a/contrib/fedora/passt.spec +++ b/contrib/fedora/passt.spec @@ -47,7 +47,14 @@ Requires(preun): policycoreutils This package adds SELinux enforcement to passt(1), pasta(1), passt-repair(= 1). %prep +%if "%(ls passt.c)" =3D=3D "passt.c" +# Hack for local build from source tree +cp -a %(pwd)/* . +touch ../passt-%{git_hash}.tar.xz +%else +# The usual process with an upstream tarball %setup -q -n passt-%{git_hash} +%endif %build %set_build_flags Thanks, -- Max