On Wed, Jan 06, 2016 at 02:28:45PM +0200, Panu Matilainen wrote:
On 01/06/2016 01:59 PM, Richard W.M. Jones wrote:
>On Wed, Jan 06, 2016 at 11:54:06AM +0000, Richard W.M. Jones wrote:
>>On Tue, Jan 05, 2016 at 09:15:29PM +0200, Panu Matilainen wrote:
>>>On 01/05/2016 07:16 PM, Richard W.M. Jones wrote:
>>>>On Thu, Dec 24, 2015 at 03:01:02PM -0600, Jason L Tibbitts III wrote:
>>>>>mingw-freetype (rjones, lfarkas, epienbro)
>>>>
>>>>This uses:
>>>>
>>>>%{!?_with_subpixel_rendering: %{!?_without_subpixel_rendering: %define
_without_subpixel_rendering --without-subpixel_rendering}}
>>>>
>>>>_without_subpixel_rendering is not used anywhere else in the file.
>>>>No idea if that is right or not.
>>>
>>>Another case where %define is actually wrong. The whole construct
>>>looks like a workaround for %bcond related misunderstanding, but
>>>dunno.
>
>Actually in this second case, mingw-freetype.spec is just following
>the freetype.spec file. Which also looks wrong because it defines
>_without_subpixel_rendering which is never used anywhere.
>
>http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype.spec
Right. Freetype is old enough to actually predate rpm's
%bcond_with/without so custom variants have been implemented +
evolved by various packagers over the years, but this should've
really been using %bcond already:
http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/commit/freetype.spec...
This is what it should be changed to (untested but should be
"obviously correct"):
diff --git a/freetype.spec b/freetype.spec
index c6d492d..e479acf 100644
--- a/freetype.spec
+++ b/freetype.spec
@@ -1,6 +1,6 @@
# Patented subpixel rendering disabled by default.
# Pass '--with subpixel_rendering' on rpmbuild command-line to enable.
-%{!?_with_subpixel_rendering: %{!?_without_subpixel_rendering:
%define _without_subpixel_rendering --without-subpixel_rendering}}
+%bond_with subpixel_rendering
%{!?with_xfree86:%define with_xfree86 1}
@@ -37,7 +37,7 @@ BuildRequires: zlib-devel
BuildRequires: bzip2-devel
Provides: %{name}-bytecode
-%if %{?_with_subpixel_rendering:1}%{!?_with_subpixel_rendering:0}
+%if %{with subpixel_rendering}
Provides: %{name}-subpixel
%endif
@@ -78,7 +78,7 @@ FreeType.
%prep
%setup -q -b 1 -a 2
-%if %{?_with_subpixel_rendering:1}%{!?_with_subpixel_rendering:0}
+%if %{with subpixel_rendering}
%patch21 -p1 -b .enable-spr
%endif
If this seems backwards, see
http://rpm.org/wiki/PackagerDocs/ConditionalBuilds
Thanks - I'll follow what freetype-owner decides, because we want to
try to keep mingw packaging as close to the native packages as
possible.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v