LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File openmotif.spec of Package openmotif (Project home:derselbst)

# spec file for package openmotif
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/

Name:           openmotif
%{expand:%%global _prefix %(pkg-config --variable prefix x11 || echo /usr/X11R6)}
%if "%_prefix" == "/usr/X11R6"
%define _mandir %_prefix/man
%define _datadir %_prefix/lib
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  freetype2-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtool
BuildRequires:  lzma
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
Version:        2.3.4
Release:        0
PreReq:         sed grep
Conflicts:      lestif2
Summary:        Open Motif
License:        LGPL-2.1
Group:          System/Libraries
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://sourceforge.net/projects/motif
Source:         motif-%{version}-src.tar.bz2
Source1:        mwm.desktop
Source2:        baselibs.conf
Patch:          openmotif-%{version}.diff
Patch1:         warn.patch
Patch3:         strcmp.diff
Patch4:         openmotif-xpm.diff
Patch5:         sentinel.diff
Patch6:         openmotif-uil.diff
Patch7:         openmotif-unaligned.diff
Patch8:         mwm.diff
Patch9:         openmotif-editres.diff
Patch11:        openmotif-editres-prototype.patch

This is the Open Motif runtime environment.  It includes the Motif
shared libraries.  Open Motif is a freely available version of the well
known Motif user interface toolkit for Open Source operating systems. 
This package was built with the Metro Link sources.

%package libs
Summary:        Open Motif Runtime Libraries
Group:          System/Libraries
# bug437293
%ifarch ppc64
Obsoletes:      openmotif-libs-64bit
Provides:       openmotif:/usr/X11R6/%_lib/libXm.so.3

%description libs
This is the Open Motif runtime environment.  It includes the Motif
shared libraries.  Open Motif is a freely available version of the well
known user interface toolkit Motif for Open Source operating systems. 
This package was built with the sources from Metro Link.

%package devel
Summary:        Include Files and Libraries mandatory for Development.
Group:          Development/Libraries/X11
# bug437293
%ifarch ppc64
Obsoletes:      openmotif-devel-64bit
Requires:       libjpeg-devel
Requires:       libpng-devel
Requires:       openmotif-libs = %{version}
Requires:       xorg-x11-devel
Requires:       zlib-devel
Conflicts:      lesstifd lestif2d lesstif-devel
PreReq:         coreutils

%description devel
This is the Open Motif development environment.  It includes the Motif
header files and static libraries, plus the Motif UIL (User Interface
Language) compiler and the manual pages for the Motif widgets and
library functions.

%setup -q -n motif-%{version}
# remove all files that have strange licenses
rm lib/Xm/regexp.c
rm lib/Xm/regexpI.h
rm localized/util/mkcatdefs.c
rm tests/doc/Output/draft/ps/title.ps
rm tests/doc/title.sm 
sed -e '/regexpI.h/d' -i lib/Xm/Makefile.am
%patch -p1
%patch9 -p1
%patch11 -p1

autoreconf --force --install
%ifarch %arm
# miscompilation?
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" YACC=yacc
%configure --disable-static --with-pic
rm -f tools/wml/Uil.[ch] tools/wml/wmlparse.[ch]
# Not parallel safe
make MWMRCDIR=/etc/X11

make install DESTDIR="$RPM_BUILD_ROOT" MWMRCDIR=/etc/X11
mkdir -p $RPM_BUILD_ROOT%{_datadir}/X11/config
cp config/cf/Motif.rules $RPM_BUILD_ROOT%{_datadir}/X11/config/Motif.rules.openmotif
cp config/cf/Motif.tmpl $RPM_BUILD_ROOT%{_datadir}/X11/config/Motif.tmpl.openmotif
# install kdm/gdm entry
install -m 0755 -d $RPM_BUILD_ROOT/usr/share/xsessions/
install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/usr/share/xsessions/
%suse_update_desktop_file $RPM_BUILD_ROOT/usr/share/xsessions/mwm.desktop
%{__rm} -f %{buildroot}%{_libdir}/*.la

%triggerin devel -- xdevel
# Replace Motif.tmpl and Motif.rules with our versions
[ ! -f $MOTIFTMPL ] || mv -f $MOTIFTMPL $MOTIFTMPL.orig
ln -sf $MOTIFTMPL.openmotif $MOTIFTMPL
ln -sf $MOTIFRULES.openmotif $MOTIFRULES
# Set TopLevelProject to Motif in site.def.
if ! grep "^\#define TopLevelProject Motif" $SITEDEF > /dev/null 2>&1; then
	[ -f $SITEDEF.orig ] || mv -f $SITEDEF $SITEDEF.orig
	sed -e '/^\#ifdef BeforeVendorCF$/a\
\#define TopLevelProject Motif\
' < $SITEDEF.orig > $SITEDEF
	chmod a+r $SITEDEF

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%postun devel
if [ "$1" = 0 ]; then
    # Restore original versions of Motif.tmpl, Motif.rules, and site.def
    rm -f $MOTIFTMPL
    [ ! -f $MOTIFTMPL.orig ] || mv -f $MOTIFTMPL.orig $MOTIFTMPL
    rm -f $MOTIFRULES
    [ ! -f $MOTIFRULES.orig ] || mv -f $MOTIFRULES.orig $MOTIFRULES
    [ ! -f $SITEDEF.orig ] || mv -f $SITEDEF.orig $SITEDEF

%defattr(-, root, root)
%dir %{_prefix}/include/X11/bitmaps
%config /etc/X11/system.mwmrc

%files libs
%defattr(-, root, root)

%files devel
%defattr(-, root, root)