Bug 148936

Summary: Patch to spec file to conditionally deactivate X11 support
Product: [Fedora] Fedora Reporter: Philip Gwyn <bugzilla>
Component: VFlib2Assignee: Akira TAGOH <tagoh>
Status: CLOSED RAWHIDE QA Contact: Bill Huang <bhuang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3Keywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.25.6-27 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-02-23 06:57:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Philip Gwyn 2005-02-17 01:31:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040914

Description of problem:
This patch adds %define use_X to the spec file.  This define is then
used to conditionnaly turn functionnaly that needs X11 on or off.

Deactivating X11 is useful for servers.

VFlib2 without X11 will not have disol, fmtest, kban, vfperf, vftest.

Version-Release number of selected component (if applicable):
2.25.6-25

How reproducible:
Always

Steps to Reproduce:
1. Do a default install of FC3
2. rpm -e xorg-x11-libs
Step 2 fails, because, amoungst others, VFlib2 requires the X11 libraries

Additional info:

--- SPECS/VFlib2.spec   2004-10-04 06:22:17.000000000 -0400
+++ SPECS.noX/VFlib2.spec   2005-02-16 19:29:51.162990239 -0500
@@ -1,10 +1,20 @@
+# set to 0 to disable X11 bits
+%define use_X 0
+
 Name:      VFlib2
 Version:   2.25.6
+%if %{use_X} 
 Release:   25
+%else
+Release:   25.noX
+%endif
 License:   GPL
 URL:       http://TypeHack.aial.hiroshima-u.ac.jp/VFlib/
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
-BuildPreReq:   freetype-devel XFree86-devel
+BuildPreReq:   freetype-devel
+%if %{use_X}
+BuildPreReq: XFree86-devel
+%endif
 
 ## re-compressed bzip2 instead of gzip
 # Source: 
ftp://TypeHack.aial.hiroshima-u.ac.jp/pub/TypeHack/%{name}-%{version}.tar.gz
@@ -108,7 +118,11 @@
 autoconf
 
 %build
-OPTS="--with-x --with-freetype --enable-shared --enable-static"
+%if %{use_X}
+   OPTS="--with-x --with-freetype --enable-shared --enable-static"
+%else 
+   OPTS="--without-x --with-freetype --enable-shared --enable-static"
+%endif
 if [ -d %{_includedir}/freetype1 ]; then
 %configure ${OPTS}
--with-freetype-includedir=%{_includedir}/freetype1/freetype
 else
@@ -130,11 +144,13 @@
 (cd $RPM_BUILD_ROOT%{_sysconfdir} ; ln -fs
..%{_datadir}/VFlib/%{version}/vfontcap .)   
 (cd $RPM_BUILD_ROOT%{_sysconfdir} ; ln -fs
..%{_datadir}/VFlib/%{version}/vfontcap.ja .)
+%if %{use_X}
 install -c -m 0755 tools/.libs/disol  $RPM_BUILD_ROOT%{_bindir}
 install -c -m 0755 tools/.libs/fmtest $RPM_BUILD_ROOT%{_bindir}
 install -c -m 0755 tools/.libs/kban   $RPM_BUILD_ROOT%{_bindir}
 install -c -m 0755 tools/.libs/vfperf $RPM_BUILD_ROOT%{_bindir}
 install -c -m 0755 tools/.libs/vftest $RPM_BUILD_ROOT%{_bindir}
+%endif
 
 cp -ar jTeX $RPM_BUILD_ROOT%{_datadir}/VFlib/VFjfm
 cp -ar dynafont $RPM_BUILD_ROOT%{_datadir}/VFlib/VFjfm
@@ -168,12 +184,14 @@
 %{_bindir}/ttindex  
 %{_bindir}/bdfindex 
 %{_bindir}/fwindex  
+%if %{use_X}
 %{_bindir}/disol
 %{_bindir}/fmtest
 %{_bindir}/kban  
 %{_bindir}/ktest 
 %{_bindir}/vfperf
 %{_bindir}/vftest
+%endif
 %{_libdir}/lib*.so.*
 %{_datadir}/VFlib/%{version}/vfontcap
 %{_datadir}/VFlib/%{version}/vfontcap.bdf

Comment 1 Akira TAGOH 2005-02-17 09:13:15 UTC
Well, what do you want to do? if you don't just want to install
xorg-x11 by VFlib2, I'd recommend to separate out the binaries which
depends on X to the sub package. does it make sense?

Comment 2 Philip Gwyn 2005-02-17 19:50:12 UTC
Yes.  In fact, it's a better idea then having with-X and without-X
packages.  Is there any chance this would make it into the distro?

Comment 3 Akira TAGOH 2005-02-18 08:05:22 UTC
Yes, will do soon.

Comment 4 Akira TAGOH 2005-02-23 06:57:22 UTC
Fixed in 2.25.6-27 and VFlib2-xtools contains the utilities which depends on X