%define _default_patch_fuzz 2
%define tigervnc_src_dir %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}
-%define xorg_buildroot %{tigervnc_src_dir}/xorg.build
%{!?_self_signed: %define _self_signed 1}
+%{!?_bootstrap: %define _bootstrap 1}
+#%global scl_name %{name}$(echo %version | sed -e 's/\\.//;s/\\..*//')
+%define scl_name %{name}16
+%if %{_bootstrap}
+%define xorg_buildroot $RPM_BUILD_ROOT/opt/%{name}/%{scl_name}
+%else
+%define xorg_buildroot /opt/%{name}/%{scl_name}
+%endif
Name: tigervnc
Version: @VERSION@
BuildRequires: git, gperf, intltool, libtalloc-devel
BuildRequires: kernel-headers, libatomic_ops-devel
BuildRequires: xz
+%if !%{_bootstrap}
+BuildRequires: %{name}-static-devel == %{version}
+%endif
Requires(post): initscripts chkconfig coreutils
Requires(postun):coreutils
%description icons
This package contains icons for TigerVNC viewer
+%if %{_bootstrap}
+%package static-devel
+Summary: Static development files necessary to build TigerVNC
+Group: Development/Libraries
+
+%description static-devel
+This package contains static development files necessary to build TigerVNC
+%endif
+
%prep
+rm -rf $RPM_BUILD_ROOT
rm -rf %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}
%setup -q -n %{name}-%{version}%{?snap:-%{snap}}
%patch4 -p1 -b .cookie
%patch12 -p1 -b .static-build-fixes
+%if %{_bootstrap}
tar xzf %SOURCE11
pushd fltk-*
%patch15 -p1 -b .static-libs
tar xzf %SOURCE15
tar xzf %SOURCE16
xzcat %SOURCE17 | tar xf -
+%endif
mkdir xorg
pushd xorg
+%if %{_bootstrap}
tar xjf %SOURCE100
tar xjf %SOURCE101
tar xjf %SOURCE102
tar xjf %SOURCE156
tar xjf %SOURCE157
tar xjf %SOURCE158
+%endif
tar xjf %SOURCE159
+%if %{_bootstrap}
tar xjf %SOURCE160
tar xjf %SOURCE161
tar xjf %SOURCE162
tar xjf %SOURCE202
tar xjf %SOURCE203
tar xjf %SOURCE204
+%endif
pushd xorg-server-1*
%patch10000 -p1 -b .CVE-2014-mult
%patch10001 -p1 -b .CVE-regressions
chmod +r "$f"
done
popd
+%if %{_bootstrap}
tar xzf %SOURCE205
+%endif
popd
cp -a xorg/xorg-server-1*/* unix/xserver
export CXXFLAGS="$CFLAGS -static-libgcc"
export PYTHON=python26
+%if %{_bootstrap}
mkdir -p %{xorg_buildroot}%{_libdir}
pushd %{xorg_buildroot}%{_libdir}
-ln -s `g++44 -print-file-name=libz.a`
-ln -s `g++44 -print-file-name=libgcc.a`
-ln -s `g++44 -print-file-name=libexpat.a`
-ln -s `g++44 -print-file-name=libcrypto.a`
+ln -s `g++44 -print-file-name=libz.a` .
+ln -s `g++44 -print-file-name=libgcc.a` .
+ln -s `g++44 -print-file-name=libexpat.a` .
+ln -s `g++44 -print-file-name=libcrypto.a` .
popd
echo "*** Building libjpeg-turbo ***"
pushd libjpeg-turbo-*
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --disable-nls --enable-static --disable-shared
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --disable-nls --enable-static --disable-shared
make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
popd
echo "*** Building libsha1 ***"
pushd libsha1-*
autoreconf -fiv
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --disable-nls --enable-static --disable-shared
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --disable-nls --enable-static --disable-shared
make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
popd
popd
+%endif
export CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{xorg_buildroot}%{_includedir}"
export CXXFLAGS="$RPM_OPT_FLAGS -fPIC -I%{xorg_buildroot}%{_includedir} -static-libgcc"
export ACLOCAL="aclocal -I %{xorg_buildroot}%{_datadir}/aclocal"
export PKG_CONFIG_PATH="%{xorg_buildroot}%{_libdir}/pkgconfig:%{xorg_buildroot}%{_libdir}/tigervnc/pkgconfig:%{xorg_buildroot}%{_datadir}/pkgconfig:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig"
+%if %{_bootstrap}
echo "*** Building gmp ***"
pushd gmp-*
%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ABI=64 ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ABI=64 ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx
%else
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ABI=32 ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ABI=32 ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx
%endif
make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
echo "*** Building libtasn1 ***"
pushd libtasn1-*
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
echo "*** Building nettle ***"
pushd nettle-*
autoreconf -fiv
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --disable-openssl
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --disable-openssl
make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
echo "*** Building gnutls ***"
pushd gnutls-*
LDFLAGS="-L%{xorg_buildroot}%{_libdir} -lgmp $LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure \
+ --host=%{_host} \
+ --build=%{_build} \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--enable-static \
echo "*** Building freetype ***"
pushd freetype-*
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' builds/unix/libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' builds/unix/libtool
make DESTDIR=%{xorg_buildroot} install
echo "*** Building fontconfig ***"
pushd fontconfig-*
autoreconf -fiv
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" HASDOCBOOK=no ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --with-confdir=%{_sysconfdir}/fonts --with-cache-dir=%{_localstatedir}/cache/fontconfig --with-default-fonts=%{_datadir}/fonts --with-add-fonts="%{_datadir}/X11/fonts/Type1,%{_datadir}/X11/fonts/OTF,%{_datadir}/X11/fonts/TTF,%{_datadir}/X11/fonts/misc,%{_datadir}/X11/fonts/100dpi,%{_datadir}/X11/fonts/75dpi,%{_prefix}/local/share/fonts,~/.fonts"
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" HASDOCBOOK=no ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --with-confdir=%{_sysconfdir}/fonts --with-cache-dir=%{_localstatedir}/cache/fontconfig --with-default-fonts=%{_datadir}/fonts --with-add-fonts="%{_datadir}/X11/fonts/Type1,%{_datadir}/X11/fonts/OTF,%{_datadir}/X11/fonts/TTF,%{_datadir}/X11/fonts/misc,%{_datadir}/X11/fonts/100dpi,%{_datadir}/X11/fonts/75dpi,%{_prefix}/local/share/fonts,~/.fonts"
make %{?_smp_mflags}
make DESTDIR=%{xorg_buildroot} install
find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
pushd util-macros-*
echo "Building macros"
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
+LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
make DESTDIR=%{xorg_buildroot} install
find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
extraoptions="${extraoptions} --with-freetype-config=%{xorg_buildroot}%{_bindir}/freetype-config"
fi
if [ "${module}" = "libXScrnSaver" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
+ LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
elif [ "${module}" = "libxkbfile" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
+ LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
elif [ "${module}" = "pixman" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
+ LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
elif [ "${module}" = "libXt" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic --with-xfile-search-path="%{_sysconfdir}/X11/%%L/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%l/%%T/\%%N%%C%%S:%{_sysconfdir}/X11/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%L/%%T/%%N%%S:%{_sysconfdir}/X\11/%%l/%%T/%%N%%S:%{_sysconfdir}/X11/%%T/%%N%%S:%{_datadir}/X11/%%L/%%T/%%N%%C%%S:%{_datadir}/X1\1/%%l/%%T/%%N%%C%%S:%{_datadir}/X11/%%T/%%N%%C%%S:%{_datadir}/X11/%%L/%%T/%%N%%S:%{_datadir}/X11/%%\l/%%T/%%N%%S:%{_datadir}/X11/%%T/%%N%%S"
+ LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic --with-xfile-search-path="%{_sysconfdir}/X11/%%L/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%l/%%T/\%%N%%C%%S:%{_sysconfdir}/X11/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%L/%%T/%%N%%S:%{_sysconfdir}/X\11/%%l/%%T/%%N%%S:%{_sysconfdir}/X11/%%T/%%N%%S:%{_datadir}/X11/%%L/%%T/%%N%%C%%S:%{_datadir}/X1\1/%%l/%%T/%%N%%C%%S:%{_datadir}/X11/%%T/%%N%%C%%S:%{_datadir}/X11/%%L/%%T/%%N%%S:%{_datadir}/X11/%%\l/%%T/%%N%%S:%{_datadir}/X11/%%T/%%N%%S"
elif [ "${module}" = "libX11" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
+ LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
elif [ "${module}" = "libXtst" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
+ LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
elif [ "${module}" = "libXpm" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
+ LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
else
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
+ LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
fi
echo ======================
echo building ${module}
popd
done
+%else
+pushd xorg
+%endif
+%if %{_bootstrap}
# build mesa
echo "*** Building Mesa ***"
pushd Mesa-*
# link libGL statically against any xorg libraries built above
LDFLAGS="$LDFLAGS -Wl,-Bstatic -lxcb -lX11 -lXdmcp -lXau -lXext -lXxf86vm -ldrm -Wl,-Bdynamic -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \
PKG_CONFIG="pkg-config --static" ./configure %{common_flags} \
+ --host=%{_host} \
+ --build=%{_build} \
--prefix=%{_prefix} \
--libdir=%{_libdir}/tigervnc \
--disable-osmesa \
find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
popd
+%endif
popd
+%if %{_bootstrap}
echo "*** Building libpng ***"
pushd libpng-*
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
+ --host=%{_host} \
+ --build=%{_build} \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--disable-shared \
echo "*** Building fltk ***"
pushd fltk-*
+%endif
export CMAKE_PREFIX_PATH="%{xorg_buildroot}%{_prefix}:%{_prefix}"
export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS
export PKG_CONFIG="pkg-config --static"
-CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
+%if %{_bootstrap}
+./configure \
+ --host=%{_host} \
+ --build=%{_build} \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--enable-x11 \
make %{?_smp_mflags}
make DESTDIR=%{xorg_buildroot} install
popd
+%endif
echo "*** Building VNC ***"
export CFLAGS="$CFLAGS -fPIC"
autoreconf -fiv
chmod +x ./configure
# create a relocatable Xvnc so that we can bundle the custom libGL & swrast w/o overwriting existing libs
-GL_LIBS='-Wl,-Bdynamic -lGL' LDFLAGS="$LDFLAGS -L%{xorg_buildroot}%{_libdir}/tigervnc -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \
+GL_LIBS='-Wl,-Bdynamic -lGL' LDFLAGS="$LDFLAGS -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \
%configure \
--prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_datadir}/man \
--sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} \
popd
%install
-rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
pushd unix/xserver/hw/vnc
make install DESTDIR=$RPM_BUILD_ROOT
popd
-pushd xorg/Mesa-*
-make install DESTDIR=$RPM_BUILD_ROOT
-popd
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/tigervnc/dri
+install -m644 -p %{xorg_buildroot}%{_libdir}/tigervnc/dri/swrast_dri.so $RPM_BUILD_ROOT%{_libdir}/tigervnc/dri
+for f in `find %{xorg_buildroot}%{_libdir}/tigervnc -name "lib*" -print` ; do
+cp -a $f $RPM_BUILD_ROOT%{_libdir}/tigervnc
+done
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
%find_lang %{name} %{name}.lang
+%if %{_bootstrap}
+find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
+find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{xorg_buildroot}%{_libdir}|libdir=/opt/%{name}/%{scl_name}%{_libdir}|" {} \;
+find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{xorg_buildroot}%{_prefix}|prefix=/opt/%{name}/%{scl_name}%{_prefix}|" {} \;
+%endif
+
# remove unwanted files
rm -rf $RPM_BUILD_ROOT%{_libdir}/tigervnc/pkgconfig
rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig
%defattr(-,root,root,-)
%{_datadir}/icons/hicolor/*/apps/*
+%if %{_bootstrap}
+%files static-devel
+%defattr(-,root,root,-)
+/opt/%{name}/%{scl_name}%{_sysconfdir}/*
+/opt/%{name}/%{scl_name}%{_bindir}/*
+/opt/%{name}/%{scl_name}%{_datadir}/*
+/opt/%{name}/%{scl_name}%{_includedir}/*
+/opt/%{name}/%{scl_name}%{_libdir}/*
+%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
+/opt/%{name}/%{scl_name}%{_prefix}/lib/python2.6/*
+%endif
+%endif
+
%changelog
+* Fri Dec 11 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-3
+- Configure with --host and --build to avoid build host-specific compiler opts
+
+* Fri Nov 27 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-2
+- Split static pre-reqs into separate package
+
* Thu Nov 26 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-1
- Version bump for 1.6 release
- Update libjpeg-turbo, gnutls, libtasn1, libpng to latest upstream versions.
%{!?_self_signed: %define _self_signed 1}
+%{!?_bootstrap: %define _bootstrap 1}
+%define tigervnc_src_dir %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}
+%global scl_name %{name}16
+%if %{_bootstrap}
+%define static_lib_buildroot %{tigervnc_src_dir}/opt/%{name}/%{scl_name}
+%else
+%define static_lib_buildroot /opt/%{name}/%{scl_name}
+%endif
Name: tigervnc
Version: @VERSION@
BuildRequires: desktop-file-utils, java-devel, jpackage-utils
BuildRequires: libjpeg-turbo-devel, pam-devel
BuildRequires: cmake >= 2.8
+%if !%{_bootstrap}
+BuildRequires: %{name}-static-devel == %{version}
+%endif
%ifnarch s390 s390x
BuildRequires: xorg-x11-server-devel
%endif
%description icons
This package contains icons for TigerVNC viewer
+%if %{_bootstrap}
+%package static-devel
+Summary: Static development files necessary to build TigerVNC
+Group: Development/Libraries
+
+%description static-devel
+This package contains static development files necessary to build TigerVNC
+%endif
+
%prep
+rm -rf $RPM_BUILD_ROOT
%setup -q -n %{name}-%{version}%{?snap:-%{snap}}
-# sed -i -e 's/80/0/g' CMakeLists.txt
%patch4 -p1 -b .cookie
+%if %{_bootstrap}
tar xzf %SOURCE11
tar xjf %SOURCE13
tar xjf %SOURCE14
tar xzf %SOURCE15
tar xzf %SOURCE16
xzcat %SOURCE17 | tar xf -
+%endif
cp -r /usr/share/xorg-x11-server-source/* unix/xserver
pushd unix/xserver
%patch16 -p0 -b .man
%build
-%define tigervnc_src_dir %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}
-%define static_lib_buildroot %{tigervnc_src_dir}/build
+%if %{_bootstrap}
mkdir -p %{static_lib_buildroot}%{_libdir}
+%endif
%ifarch sparcv9 sparc64 s390 s390x
export CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{static_lib_buildroot}%{_includedir}"
export CPPFLAGS=$CXXFLAGS
export PKG_CONFIG_PATH="%{static_lib_buildroot}%{_libdir}/pkgconfig:%{static_lib_buildroot}%{_datadir}/pkgconfig:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig"
+%if %{_bootstrap}
echo "*** Building gmp ***"
pushd gmp-*
./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx --disable-assembly
echo "*** Building libtasn1 ***"
pushd libtasn1-*
-LDFLAGS="-L%{static_lib_buildroot}%{_libdir} $LDFLAGS" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
+LDFLAGS="-L%{static_lib_buildroot}%{_libdir} $LDFLAGS" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --host=%{_host} --build=%{_build}
make %{?_smp_mflags} DESTDIR=%{static_lib_buildroot} install
find %{static_lib_buildroot}%{_prefix} -type f -name "*.la" -delete
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{static_lib_buildroot}%{_libdir}|" {} \;
echo "*** Building nettle ***"
pushd nettle-*
autoreconf -fiv
-LDFLAGS="-L%{static_lib_buildroot}%{_libdir} -Wl,-Bstatic -ltasn1 -lgmp -Wl,-Bdynamic $LDFLAGS" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --disable-openssl
+LDFLAGS="-L%{static_lib_buildroot}%{_libdir} -Wl,-Bstatic -ltasn1 -lgmp -Wl,-Bdynamic $LDFLAGS" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --disable-openssl --host=%{_host} --build=%{_build}
make %{?_smp_mflags} DESTDIR=%{static_lib_buildroot} install
find %{static_lib_buildroot}%{_prefix} -type f -name "*.la" -delete
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{static_lib_buildroot}%{_libdir}|" {} \;
LDFLAGS="-L%{static_lib_buildroot}%{_libdir} -Wl,-Bstatic -lnettle -lhogweed -ltasn1 -lgmp -Wl,-Bdynamic $LDFLAGS" ./configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
+ --host=%{_host} \
+ --build=%{_build} \
--enable-static \
--disable-shared \
--without-p11-kit \
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
+ --host=%{_host} \
+ --build=%{_build} \
--disable-shared \
--enable-static
make %{?_smp_mflags}
echo "*** Building fltk ***"
pushd fltk-*
+%endif
export CMAKE_PREFIX_PATH="%{static_lib_buildroot}%{_prefix}:%{_prefix}"
export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS
export PKG_CONFIG="pkg-config --static"
+%if %{_bootstrap}
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="-L%{static_lib_buildroot}%{_libdir} -Wl,-Bstatic -lpng -Wl,-Bdynamic $LDFLAGS" ./configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
+ --host=%{_host} \
+ --build=%{_build} \
--enable-x11 \
--enable-gl \
--disable-shared \
make %{?_smp_mflags}
make DESTDIR=%{static_lib_buildroot} install
popd
+%endif
%{cmake} -G"Unix Makefiles" \
-DBUILD_STATIC=off \
popd
%install
-rm -rf $RPM_BUILD_ROOT
+%if %{_bootstrap}
+for l in gmp libtasn1 nettle gnutls libpng fltk; do
+pushd $l-*
+make install DESTDIR=$RPM_BUILD_ROOT/opt/%{name}/%{scl_name}
+popd
+done
+find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.la" -delete
+find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=/opt/%{name}/%{scl_name}%{_libdir}|" {} \;
+find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=/opt/%{name}/%{scl_name}%{_prefix}|" {} \;
+%endif
+
make install DESTDIR=$RPM_BUILD_ROOT
pushd unix/xserver/hw/vnc
%defattr(-,root,root,-)
%{_datadir}/icons/hicolor/*/apps/*
+%if %{_bootstrap}
+%files static-devel
+%defattr(-,root,root,-)
+/opt/%{name}/%{scl_name}%{_bindir}/*
+/opt/%{name}/%{scl_name}%{_includedir}/*
+/opt/%{name}/%{scl_name}%{_libdir}/*
+/opt/%{name}/%{scl_name}%{_datadir}/*
+%endif
+
%changelog
+* Fri Dec 11 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-3
+- Configure with --host and --build to avoid build host-specific compiler opts
+
+* Sun Nov 29 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-2
+- Split static pre-reqs into separate package
+
* Thu Nov 26 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-1
- Version bump for 1.6 release
- Update gnutls, libtasn1, libpng to latest upstream versions.