[bt-devel] bibletime.spec

Brook Humphrey bt-devel@crosswire.org
Sun, 13 May 2001 05:12:47 -0700


here is the spec file I use for bibletime to make the staic version. God bless.


%define 	name bibletime
%define 	version 1.0.beta
%define             release cvs.20010508.static.1mdk
%define		ostype Mandrake8.0
%define		buildarch i586
%define             SwordPath /usr/share/sword
%define		ModsPath %{SwordPath}/mods.d

Summary:           BibleTime %{version} is an easy to use Bible study tool for KDE2.
Name:		%{name}
Version:	            %{version}
Release:            %{release}
Icon:		bibletime.xpm
Copyright:          GPL
Vendor:             The team of BibleTime <info@bibletime.de>
Url:                    http://www.bibletime.de
Packager:          Brook Humphrey <bah@webmedic.net>, Joachim Ansorg <jansorg@gmx.de>
Group:               Graphical desktop/KDE
BuildArch:	%{buildarch}
Source0:            %{name}-%{version}.tar.bz2

# For use with mandrake menu system can be commented out if compileing for another distro
Source1:            bibletime_icons.tar.bz2

# next lines are experimental for making bibletime with static kde and qt
# it is not yet working do not uncomment unless you know what you are doing
#Source2:          Makef.tar.bz2

BuildRoot:          %{_tmppath}/%{name}-%{version}--root
Provides:           sword-base
Prefix:               %{_prefix}



%description
BibleTime %{version}%{release} is a free and easy to use bible study tool for UNIX systems.

BibleTime provides easy handling of digitalized texts (Bibles, commentaries and lexicons) and powerful features to work with these texts (search in texts, write own notes, save, print etc.). Bibletime is a frontend for the  SWORD Bible Framework.

 This is  a relocatable package, you can install it on different target with:
 rpm -Uvh bibletime-xxx.rpm --prefix /usr/local/opt/apps/noncommercial
 default is %{_prefix}

The SWORD Project is an effort to create an ever expanding software package for research and study of God and His Word.  The SWORD Bible Framework allows easy manipulation of Bible texts, commentaries, lexicons, dictionaries, etc.  Many frontends are build using this framework.  An installed module set may be shared between any frontend using the framework.

This rpm was compiled on a %{ostype} system for %{buildarch} class cpu's.

Although this binary no longer requires sword to run the source.rpm will not build correctly without the sword-devel package installed.

%prep
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_DIR/%{name}-%{version}

# For use with mandrake menu system can be commented out if compileing for another distro
mkdir -p $RPM_BUILD_ROOT%{_menudir}

mkdir -p $RPM_BUILD_ROOT/usr/share/config
mkdir -p $RPM_BUILD_ROOT%{SwordPath}
mkdir -p $RPM_BUILD_ROOT%{ModsPath}

# move the shared libs out of the way to make it static
# this one is for the sword libs if only the sword-devel package is installed
# this will not be necessary. But it is ok to leave it in.
if [ -f /usr/lib/libsword.so ] ; then mv /usr/lib/libsword.so /usr/lib/libsword.bak ; fi

# other optional libs for building static bibletime. Not yet working.
#########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!##########
# If you uncomment any of these lines make sure to also uncomment the
# coresponding lines in the clean section of this spec file.
#IF YOU DO NOT YOUR XFREE AND KDE WILL STOP WORKING.
#########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!##########
#if [ -f /usr/lib/libpthread.so ] ; then mv /usr/lib/libpthread.so /usr/lib/libpthread.sobak ; fi
#if [ -f /usr/X11R6/lib/libXext.so.6 ] ; then mv /usr/X11R6/lib/libXext.so.6 /usr/X11R6/lib/libXext.bak ; fi
#if [ -f /usr/X11R6/lib/libXext.so ] ; then mv /usr/X11R6/lib/libXext.so /usr/X11R6/lib/libXext.sobak ; fi
#if [ -f /usr/X11R6/lib/libXext.so.6.4 ] ; then mv /usr/X11R6/lib/libXext.so.6.4 /usr/X11R6/lib/libXext.so64bak ; fi

# kde libs for static compile. Not yet working.
#if [ -f /usr/lib/libkfile.so ] ; then mv /usr/lib/libkfile.so /usr/lib/libkfile.sobak ; fi
#if [ -f /usr/lib/libkfile.so.3 ] ; then mv /usr/lib/libkfile.so.3 /usr/lib/libkfile.so3bak ; fi
#if [ -f /usr/lib/libkfile.so.3.0.0 ] ; then mv /usr/lib/libkfile.so.3.0.0 /usr/lib/libkfile.so300bak ; fi


%setup -q
tar yxvf %{SOURCE1}

# Optional for compiling static kde libs. Not yet working.
#tar yxvf %{SOURCE2}

echo Using $KDEDIR as KDE2 directory
echo Using $QTDIR as QT 2.2.x directory.
echo If the directories are not correct please set them using\
 "export KDEDIR=<KDE2 directory> QTDIR=<QT2.2 directory>"
sleep 5
echo "I'll start now"
make -f Makefile.cvs
./configure

# Optional for compiling static kde libs. Not yet working.
#rm -v $RPM_BUILD_DIR/%{name}-%{version}/bibletime/Makefile
#mv -vf $RPM_BUILD_DIR/%{name}-%{version}/Makef $RPM_BUILD_DIR/%{name}-%{version}/bibletime/Makefile

make -j4

%install
make prefix=$RPM_BUILD_ROOT%{prefix} install

# Create Sword globals.conf for using bibletime without sword installed.
cat << EOF >$RPM_BUILD_ROOT%{ModsPath}/globals.conf
 [Globals]
EOF

# For use with mandrake menu system can be commented out if compileing for another distro
cat << EOF > $RPM_BUILD_ROOT%{_menudir}/%{name}
?package(bibletime):command="/usr/bin/bibletime" icon="bibletime.xpm" \
                needs="X11" section="Applications/Bible Study/" title="Bibletime" \
                longtitle="An easy to use Bible study tool."
EOF

# For use with mandrake menu system can be commented out if compileing for another distro
# icons: this is for the mandrake menu system
mkdir -p $RPM_BUILD_ROOT%{_liconsdir}
mkdir -p $RPM_BUILD_ROOT%{_iconsdir}
mkdir -p $RPM_BUILD_ROOT%{_miconsdir}
cd $RPM_BUILD_DIR/%{name}-%{version}
install -m 644 %{name}_16.xpm $RPM_BUILD_ROOT%{_miconsdir}/%{name}.xpm
install -m 644 %{name}_32.xpm $RPM_BUILD_ROOT%{_iconsdir}/%{name}.xpm
install -m 644 %{name}_48.xpm $RPM_BUILD_ROOT%{_liconsdir}/%{name}.xpm

%post
# this is for creation of the sword.conf for systems that are using bibletime withour sword installed.
if [ -f /etc/sword.conf ] ; then
         echo "sword.conf already exists skiping sword.conf creation." ;
else
cat << EOF >/etc/sword.conf
[Install]
DataPath=%{SwordPath}
EOF
fi

/sbin/ldconfig

# For use with mandrake menu system can be commented out if compileing for another distro
%{update_menus}

%postun
 if [ $1 = 0 ]; then
     /bin/rm -f /etc/sword.conf
fi

# For use with mandrake menu system can be commented out if compileing for another distro
%{clean_menus}

/sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

# move the shared libs back to where they belong
if [ -f /usr/lib/libsword.bak ] ; then mv /usr/lib/libsword.bak /usr/lib/libsword.so ; fi
#if [ -f /usr/lib/libpthread.sobak ] ; then mv /usr/lib/libpthread.sobak /usr/lib/libpthread.so ; fi
#if [ -f /usr/X11R6/lib/libXext.so64bak ] ; then mv /usr/X11R6/lib/libXext.so64bak /usr/X11R6/lib/libXext.so.6.4 ; fi
#if [ -f /usr/X11R6/lib/libXext.bak ] ; then mv /usr/X11R6/lib/libXext.bak /usr/X11R6/lib/libXext.so.6 ; fi
#if [ -f /usr/X11R6/lib/libXext.sobak ] ; then mv /usr/X11R6/lib/libXext.sobak /usr/X11R6/lib/libXext.so ; fi
#if [ -f /usr/lib/libkfile.so300bak ] ; then mv /usr/lib/libkfile.so300bak /usr/lib/libkfile.so.3.0.0 ; fi
#if [ -f /usr/lib/libkfile.sobak ] ; then mv /usr/lib/libkfile.sobak /usr/lib/libkfile.so ; fi
#if [ -f /usr/lib/libkfile.so3bak ] ; then mv /usr/lib/libkfile.so3bak /usr/lib/libkfile.so.3 ; fi



%files
%defattr(-,root,root)
%doc %{prefix}/share/doc/HTML/de/bibletime/*
%doc %{prefix}/share/doc/HTML/en/bibletime/*
%config %{ModsPath}/globals.conf
%config %{prefix}/share/config/bt-printing
%{prefix}/bin/bibletime
%{prefix}/share/applnk/Applications/*
%{prefix}/share/apps/bibletime/*
%{prefix}/share/icons/*
%{prefix}/share/locale/*/LC_MESSAGES/bibletime.mo

# For use with mandrake menu system can be commented out if compileing for another distro
%{_menudir}/%{name}


%changelog
 * Sun May 13 2001 Brook Humphrey <bah@webmedic.net>
- cleaned up spec file and added more comments for easier reading.
- changed sword.conf instelation to check for previous versions of sword.conf
- If found a new sword.conf is not created
* Tue May 8 2001 Brook Humphrey <bah@webmedic.net>
- Updated package to be relocatable
- added sword directories and sword.conf to install
* Mon Apr 30 2001 Brook Humphrey <bah@webmedic.net>
- Changed to build staticly
- added more mandrake macros to spec file
* Mon Apr 23 2001 Brook Humphrey <bah@webmedic.net>
- made changes to enable compile of cvs tree
* Wed Mar 14 2001 Brook Humphrey <bah@webmedic.net>
- updated to use mandrake menu sysem

-- 

-----------------------------------------------------
Brook Humphrey
Mobile PC Medic
509-235-9107
http://www.webmedic.net
bah@webmedic.net
-----------------------------------------------------
My posting or sending this is NOT an invitation for spammers to say that
I've asked to be put on a mailing list.
-----------------------------------------------------