cant build libXpm - buildscripts broken.

Stefan Dirsch sndirsch at suse.de
Thu Jun 2 07:55:46 PDT 2005


On Thu, Jun 02, 2005 at 04:19:05PM +0200, Enrico Weigelt wrote:
>
> When trying to build libXpm in a sysroot, for some strange 
> reason ./configure it's not able to use correct (sysroot'ed) 
> ld search path, although it gets correct data from (filtered)
> pkg-config.
> 
> This ends up in corrupt libXpm.la, which tries adds /usr/lib/
> to LDPATH, which is obviously wrong, and so some sed call 
> cannot find /usr/lib/libXau.la.

I attach my current specfile, which might be of help in your situation
(use the stuff in %prep/%install, security hole!). The clean way when
using "sysroot" would be to build each subdir in lib/ serarately,
create a package for it and install this package before building the
next subdir in /lib. I will do this in the end.

Stefan

Public Key available
------------------------------------------------------
Stefan Dirsch (Res. & Dev.)   SUSE LINUX Products GmbH
Tel: 0911-740 53 0            Maxfeldstraße 5
FAX: 0911-740 53 479          D-90409 Nürnberg
http://www.suse.de            Germany 
------------------------------------------------------
-------------- next part --------------
#
# spec file for package xorg-modular (Version 050528)
#
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#

# norootforbuild
# neededforbuild  ed expat flex fontconfig fontconfig-devel freetype2 freetype2-devel ghostscript-mini gpp libgpp libjpeg libpng-devel-packages libusb pam-devel pkgconfig resmgr update-desktop-files utempter

BuildRequires: aaa_base acl attr bash bind-utils bison bzip2 coreutils cpio cpp cracklib cvs cyrus-sasl db devs diffutils e2fsprogs file filesystem fillup findutils flex gawk gdbm-devel gettext-devel glibc glibc-devel glibc-locale gpm grep groff gzip info insserv klogd less libacl libattr libcom_err libgcc libnscd libselinux libstdc++ libxcrypt libzio m4 make man mktemp module-init-tools ncurses ncurses-devel net-tools netcfg openldap2-client openssl pam pam-modules patch permissions popt procinfo procps psmisc pwdutils rcs readline sed strace sysvinit tar tcpd texinfo timezone unzip util-linux vim zlib zlib-devel autoconf automake binutils ed expat fontconfig fontconfig-devel freetype2 freetype2-devel gcc gcc-c++ gdbm gettext ghostscript-mini libjpeg libjpeg-devel libpng libpng-devel libstdc++-devel libtool libusb pam-devel perl pkgconfig resmgr rpm update-desktop-files utempter

Name:         xorg-modular
Url:          xorg.freedesktop.org
License:      X11/MIT
Group:        System/X11/Utilities
Autoreqprov:  on
Version:      050528
Release:      3
Summary:      X.Org modularized
Source:       %{name}-%{version}.tar.bz2
Source1:      xorg-%{version}.tar.bz2
Patch:        %{name}-%{version}.diff
# get rid of brp-check-buildroot/brp-rpath, which complains about
# BuildRoot references in libs ==> Danger: Security hole !!!
%define __os_install_post %{suse_check}; /usr/lib/rpm/brp-compress; /usr/lib/rpm/brp-strip-debug; /usr/lib/rpm/brp-check-la; /usr/lib/rpm/brp-symlink; /usr/lib/rpm/brp-desktop; %{nil}
BuildRoot:    %{_tmppath}/%{name}-%{version}-build

%description
X.Org modularized



%prep
%setup -n %{name} -a1
util/modular/symlink.sh xc .
%patch

%build

%install
for dir in proto/*; do
  pushd $dir
  autoreconf -fi
  ./configure --prefix=/usr --libdir=%{_libdir}
  make
  make install DESTDIR=$RPM_BUILD_ROOT
  popd
done
pushd lib
  export PKG_CONFIG_PATH=$RPM_BUILD_ROOT/%{_libdir}/pkgconfig
  export XPROTO_CFLAGS=-I$RPM_BUILD_ROOT/usr/include/
  export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -I$RPM_BUILD_ROOT/usr/include -I$RPM_BUILD_ROOT/usr/include/X11/Xtrans/"
  export LDFLAGS=-L$RPM_BUILD_ROOT/%{_libdir}
  # Xcomposite/Xevie/dmx not autotooled yet
  for dir in xtrans Xau Xdmcp X11 FS ICE SM Xt Xext Xmu Xpm Xp Xaw Xfixes Xdamage Xfont Xi Xrender; do
    pushd $dir
    if [ -d $RPM_BUILD_ROOT/usr/share/aclocal ]; then
      aclocal --force -I /usr/share/aclocal -I $RPM_BUILD_ROOT/usr/share/aclocal
      libtoolize --copy --force
      autoconf --force
      autoheader --force
      automake --add-missing --copy --force-missing
    else
      autoreconf -fi
    fi
    ./configure --prefix=/usr \
                --libdir=%{_libdir} \
                --mandir=%{_datadir}/man \
                --disable-rpath
    make
    make install DESTDIR=$RPM_BUILD_ROOT
    for file in $RPM_BUILD_ROOT/%{_libdir}/*.la; do
      if [ -f $file ]; then 
        cp $file $file.orig
        sed s+\ /usr/%{_lib}/lib+\ $RPM_BUILD_ROOT/usr/%{_lib}/lib+g $file.orig > $file
      fi
    done
    popd
  done
popd
for file in $RPM_BUILD_ROOT/%{_libdir}/*.la; do
  cp $file $file.orig 
  sed s+\ $RPM_BUILD_ROOT/usr/%{_lib}/lib+\ /usr/%{_lib}/lib+g $file.orig > $file
done
for file in $RPM_BUILD_ROOT/%{_libdir}/*.la; do
  cp $file $file.orig
  sed s+-L$RPM_BUILD_ROOT/%{_libdir}++g $file.orig > $file
done
for file in $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/*.pc; do
  cp $file $file.orig
  sed s+-I$RPM_BUILD_ROOT/usr/include++g $file.orig > $file
done
rm $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/*.pc.orig
rm $RPM_BUILD_ROOT/%{_libdir}/*.la.orig

%clean
#rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%dir /usr/include/X11
/usr/bin/cxpm
/usr/bin/sxpm
%{_libdir}/pkgconfig/*
/usr/include/X11/*
%{_libdir}/*.a
%{_libdir}/*.la
%{_libdir}/*.so
%{_libdir}/*.so.*
%{_mandir}/man3/*
%{_datadir}/X11/
%{_datadir}/aclocal/

%changelog -n xorg-modular
* Wed Jun 01 2005 - sndirsch at suse.de
- added $RPM_BUILD_ROOT/usr/share/aclocal to aclocal search list
  for .m4 files
* Wed Jun 01 2005 - sndirsch at suse.de
- added build of some more libs (FS, ICE, SM, Xt, Xext, Xmu, Xpm)
* Tue May 31 2005 - sndirsch at suse.de
- added build of libXau, libXdmcp, libX11
* Sat May 28 2005 - sndirsch at suse.de
- updated to current CVS (05-05-28)
  * obsoletes xorg-modular-050525.diff
* Wed May 25 2005 - sndirsch at suse.de
- created package


More information about the xorg-modular mailing list