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
%endif
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

%description
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
%endif
#
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
%endif
#
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.

%prep
%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
%patch1
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9 -p1
%patch11 -p1

%build
autoreconf --force --install
%ifarch %arm
# miscompilation?
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -O1"
%endif
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

%install
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
MOTIFTMPL="%{_datadir}/X11/config/Motif.tmpl"
[ ! -f $MOTIFTMPL ] || mv -f $MOTIFTMPL $MOTIFTMPL.orig
ln -sf $MOTIFTMPL.openmotif $MOTIFTMPL
MOTIFRULES="%{_datadir}/X11/config/Motif.rules"
[ ! -f $MOTIFRULES ] || mv -f $MOTIFRULES $MOTIFRULES.orig
ln -sf $MOTIFRULES.openmotif $MOTIFRULES
# Set TopLevelProject to Motif in site.def.
SITEDEF="%{_datadir}/X11/config/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
fi

%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
    MOTIFTMPL="%{_datadir}/X11/config/Motif.tmpl"
    rm -f $MOTIFTMPL
    [ ! -f $MOTIFTMPL.orig ] || mv -f $MOTIFTMPL.orig $MOTIFTMPL
    MOTIFRULES="%{_datadir}/X11/config/Motif.rules"
    rm -f $MOTIFRULES
    [ ! -f $MOTIFRULES.orig ] || mv -f $MOTIFRULES.orig $MOTIFRULES
    SITEDEF="%{_datadir}/X11/config/site.def"
    [ ! -f $SITEDEF.orig ] || mv -f $SITEDEF.orig $SITEDEF
fi

%files
%defattr(-, root, root)
%dir %{_prefix}/include/X11/bitmaps
%{_prefix}/include/X11/bitmaps/xm_*
%{_datadir}/X11/bindings
%{_prefix}/bin/mwm
%{_prefix}/bin/xmbind
%config /etc/X11/system.mwmrc
%{_mandir}/man1/mwm.1.gz
%{_mandir}/man1/xmbind.1.gz
%{_mandir}/man4/*.gz
/usr/share/xsessions/*

%files libs
%defattr(-, root, root)
%{_libdir}/*.so.*

%files devel
%defattr(-, root, root)
%{_prefix}/bin/uil
%{_prefix}/include/Mrm
%{_prefix}/include/uil
%{_prefix}/include/Xm
%{_libdir}/*.so
%{_datadir}/X11/config/Motif.rules.openmotif
%{_datadir}/X11/config/Motif.tmpl.openmotif
%{_mandir}/man1/uil.1.gz
%{_mandir}/man3/*.gz
%{_mandir}/man5/*.gz

%changelog