File xephem.spec of Package xephem
#
# spec file for package xephem
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Lots of modifications since then (c) M.Homann <admin@eregion.de>
#
# 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: xephem
Url: http://www.clearskyinstitute.com/xephem/
Version: 3.7.6
Release: 0
Summary: A complete planetarium/observatory package for X11/Motif
License: SUSE-Firmware
Group: Productivity/Graphics/Visualization/Other
Source0: xephem-%{version}.tar.bz2
Source1: xephem_suse.tar.bz2
Patch0: rpmpackage.diff
Patch1: 64bit.diff
#Patch2: motif32.diff
#Patch3: motif64.diff
#Patch4: lx200.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: flex
BuildRequires: freetype2-devel
BuildRequires: groff
BuildRequires: openmotif-devel
BuildRequires: xorg-x11
BuildRequires: xorg-x11-devel
BuildRequires: xorg-x11-libs
%if %suse_version < 1120
BuildRequires: update-desktop-files
%endif
%description
XEphem \eks-i-'fem\ n. [X Windows + ephemeris]
(1990) : The accurate and reliable interactive astronomy
software tool for all UNIX-like systems including Linux,
FreeBSD and Solaris.
Astronomical software, like TheSky or SkyMap Pro, just better!
Now with LX 200 control daemon included (32bit systems only).
%prep
%setup -n xephem-%{version} -T -b 0 -a 1 #-a 3
%patch0 -p1
%ifarch x86_64
%patch1 -p1
#%patch -P 3 -p0
#%else
#%patch -P 2 -p0
%endif
#%patch -P 4 -p0
%build
#-------------------#
# prepare openmotif #
#-------------------#
rm -rf ${RPM_BUILD_DIR}/%{name}-%{version}/libXm/*
#cd ${RPM_BUILD_DIR}/%{name}-%{version}/openMotif-2.2.3
#CFLAGS=$RPM_OPT_FLAGS
#LANG="" ./configure --prefix=${RPM_BUILD_DIR}/%{name}-%{version}/libXm \#
# --enable-static --disable-shared --without-demos --without-programs --without-tools
#( LANG="" make; true )
#( LANG="" make install; true )
#-------------------#
# build xephem GUI #
#-------------------#
CFLAGS=$RPM_OPT_FLAGS
cd ${RPM_BUILD_DIR}/%{name}-%{version}/GUI/xephem
make MOTIF=/usr/lib
#make MOTIFL=../../libXm/lib MOTIFI=../../libXm/include
#%ifarch x86_84
# MOTIFL=${MOTIFL}64
#%endif
#---------------------#
# build xephem tools #
#---------------------#
cd ${RPM_BUILD_DIR}/%{name}-%{version}/GUI/xephem/fifos
make
#cd ${RPM_BUILD_DIR}/%{name}-%{version}/GUI/xephem/tools/xephemdbd
#make
#echo "#!"$(type -p perl)" -w" > tmp.pl
#cat cgi-lib.pl >> tmp.pl
#mv tmp.pl cgi-lib.pl
#cd ${RPM_BUILD_DIR}/%{name}-%{version}/GUI/xephem/tools/indi
#make
#%ifnarch x86_64
#cd ${RPM_BUILD_DIR}/%{name}-%{version}/GUI/xephem/tools/lx200xed
#make
#%endif
#cd ${RPM_BUILD_DIR}/%{name}-%{version}/GUI/xephem/tools/xedb
#make
# Ok just install the stuff... :-)
# ---------------------------------
%install
# install GUI
# -----------
cd ${RPM_BUILD_DIR}/%{name}-%{version}/GUI/xephem
install -d -m 755 $RPM_BUILD_ROOT/usr/bin
install -d -m 755 $RPM_BUILD_ROOT/usr/share/man/man1
install -m 755 xephem $RPM_BUILD_ROOT/usr/bin
install -m 644 xephem.man $RPM_BUILD_ROOT/usr/share/man/man1/xephem.1x
gzip -f $RPM_BUILD_ROOT/usr/share/man/man1/xephem.1x
#
# create appdefault file
#
install -d -m 755 $RPM_BUILD_ROOT/usr/share/X11/app-defaults
echo "XEphem.ShareDir: /usr/lib/xephem" > $RPM_BUILD_ROOT/usr/share/X11/app-defaults/XEphem
#
# install data from work dir
#
cd ${RPM_BUILD_DIR}/%{name}-%{version}/GUI/xephem
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/xephem/auxil
cp -a auxil/* $RPM_BUILD_ROOT/usr/lib/xephem/auxil
# ( cd $RPM_BUILD_ROOT/usr/lib/xephem && \
# chown -R root.root auxil && \
# cd auxil && find -name "*" -type f -exec chmod 644 {} \; )
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/xephem/catalogs
cp -a catalogs/* $RPM_BUILD_ROOT/usr/lib/xephem/catalogs
cp $RPM_SOURCE_DIR/UB313.edb $RPM_BUILD_ROOT/usr/lib/xephem/catalogs
# ( cd $RPM_BUILD_ROOT/usr/lib/xephem && \
# chown -R root.root catalogs && \
# cd catalogs && find -name "*" -type f -exec chmod 644 {} \; )
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/xephem/fifos
cp -a fifos/* $RPM_BUILD_ROOT/usr/lib/xephem/fifos
( cd $RPM_BUILD_ROOT/usr/lib/xephem && cd fifos && find -name "*" -type p -exec chmod 644 {} \; )
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/xephem/fits
cp -a fits/* $RPM_BUILD_ROOT/usr/lib/xephem/fits
# ( cd $RPM_BUILD_ROOT/usr/lib/xephem && \
# chown -R root.root fits && \
# cd fits && find -name "*" -type f -exec chmod 644 {} \; )
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/xephem/help
cp -a help/* $RPM_BUILD_ROOT/usr/lib/xephem/help
# ( cd $RPM_BUILD_ROOT/usr/lib/xephem && \
# chown -R root.root help && \
# cd help && find -name "*" -type f -exec chmod 644 {} \; )
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/xephem/gallery
cp -a gallery/* $RPM_BUILD_ROOT/usr/lib/xephem/gallery
# ( cd $RPM_BUILD_ROOT/usr/lib/xephem && \
# chown -R root.root gallery && \
# cd gallery && find -name "*" -type f -exec chmod 644 {} \; )
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/xephem/lo
cp -a lo/* $RPM_BUILD_ROOT/usr/lib/xephem/lo
# ( cd $RPM_BUILD_ROOT/usr/lib/xephem && \
# chown -R root.root lo && \
# cd lo && find -name "*" -type f -exec chmod 644 {} \; )
# install -d -m 755 $RPM_BUILD_ROOT/usr/lib/xephem/tools
# cp -ar tools/* $RPM_BUILD_ROOT/usr/lib/xephem/tools
# ( cd $RPM_BUILD_ROOT/usr/lib/xephem && \
# chown -R root.root tools )
#)
#--------------------------
# install suse stuff
#--------------------------
cd ${RPM_BUILD_DIR}/%{name}-%{version}
install -d -m 755 $RPM_BUILD_ROOT/usr/share/applications/
install -m 644 xephem.desktop $RPM_BUILD_ROOT/usr/share/applications/
install -d -m 755 $RPM_BUILD_ROOT/usr/share/pixmaps
install -m 644 xephem.png $RPM_BUILD_ROOT/usr/share/pixmaps
%if %suse_version < 1120
%suse_update_desktop_file xephem
%endif
#--------------------------
# make perl scripts executable
#--------------------------
find $RPM_BUILD_ROOT -iname \*.pl -exec chmod a+x {} \;
find $RPM_BUILD_ROOT -iname \*.c -exec rm {} \;
find $RPM_BUILD_ROOT -iname \*.o -exec rm {} \;
find $RPM_BUILD_ROOT -iname \*.h -exec rm {} \;
%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,0755)
%doc Copyright INSTALL README
%dir /usr/lib/xephem
%dir /usr/lib/xephem/catalogs
/usr/bin/xephem
/usr/lib/xephem/auxil
/usr/lib/xephem/catalogs/SKY2k65.edb
/usr/lib/xephem/catalogs/Messier.edb
/usr/lib/xephem/catalogs/UB313.edb
/usr/lib/xephem/fits
/usr/lib/xephem/gallery
/usr/lib/xephem/help
/usr/lib/xephem/lo
/usr/share/applications/xephem.desktop
/usr/share/pixmaps/xephem.png
/usr/share/man/man1/xephem.1x.gz
/usr/share/X11/app-defaults/XEphem
/usr/lib/xephem/fifos
%changelog