All pastes #57288 Raw Edit

PWLib SPEC with a manual make install

public text v1 · immutable
#57288 ·published 2006-05-20 10:46 UTC
rendered paste body
Name:		libpwlib
URL:		http://www.openh323.org
License:	MPL
Group:		Productivity/Networking/H323/Utilities
Packager:	&&PACKAGER
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
Autoreqprov:	on
Summary:	Portable Windows Library from Equivalence Pty. Ltd
Version:	&&VERSION
Release:	&&RELEASE

Source:		pwlib-%{version}.tar.gz

Distribution: &&DISTRIBUTION
%define _prefix /usr

%description
PWLib is a moderately large class library that has its genesis many years ago
as a method to product applications to run on both Microsoft Windows and the
X Window System. It also was to have a Macintosh port as well but this never
eventuated.

It is used for the OpenH323 project, see www.openh323.org for details.

Authors:
--------
    Equivalence Pty. Ltd. <support@equival.com.au>

%package devel
Summary:      pwlib package for developers (includes headers and scripts)
Group:        Development/Libraries/C and C++

%description -n %{name}-devel
This package includes header files and scripts needed for developers
using the PWLIB library.

%package plugins-alsa
Summary:      alsa plugin for pwlib
Group:        Development/Libraries/C and C++

%description plugins-alsa
This package contains the alsa plugin for pwlib

%package plugins-oss
Summary:      pwlib plugin for oss
Group:        Development/Libraries/C and C++

%description plugins-oss
This package contains the oss plugin for pwlib

%package plugins-avc
Summary:      avc plugin for pwlib
Group:        Development/Libraries/C and C++

%description plugins-avc
This package contains the avc plugin for pwlib

#%package plugins-dc
#Summary:      dc plugin for pwlib
#Group:        Development/Libraries/C and C++
#
#%description plugins-dc
#This package contains the dc plugin for pwlib

%package plugins-v4l
Summary:      v4l plugin for pwlib
Group:        Development/Libraries/C and C++

%description plugins-v4l
This package contains the v4l plugin for pwlib

Authors:
--------
    Equivalence Pty. Ltd. <support@equival.com.au>


# for DEBUG! no stripping
#%define __os_install_post /usr/share/spec-helper/spec-helper -s || :

%prep
### pwlib extraction
%setup -q -n pwlib
### now, apply pwlib plugins patch
#export PWLIBDIR=`pwd`
#echo "PWLIBDIR is $PWLIBDIR"
#echo "applying patch for plugins"
#patch --batch -p1 <../release-latest/pwlib.patch
#mv include/ptbuildopts.h.in include/ptbuildopts.h.in.in
#cp ../release-latest/manager/plugins.h include/ptlib
#cp ../release-latest/manager/plugins_pdynalink.cxx src/ptlib/common
#cp -R ../release-latest/plugins/ plugins/
autoconf
### patch should be applied now

#%setup 
# %patch1
# %patch2
# %patch3
# %patch4
#autoconf

%build
export PWLIBDIR=`pwd`
#export CFLAGS="-g"
./configure --prefix=/usr --enable-plugins
make optshared
# ARGH! Craig!!!
make optshared -C tools/asnparser

%install
# get the version from version.h
MAJ_VERSION=`sed -n -e 's/^#define MAJOR_VERSION \([[:digit:]]\{1,2\}\).*$/\1/p' version.h`
MIN_VERSION=`sed -n -e 's/^#define MINOR_VERSION \([[:digit:]]\{1,2\}\).*$/\1/p' version.h`
BUILD_NUMBER=`sed -n -e 's/^#define BUILD_NUMBER \([[:digit:]]\{1,2\}\).*$/\1/p' version.h`
export MAJ_VERSION MIN_VERSION BUILD_NUMBER
echo "++++++++ MAJ_VERSION.MIN_VERSION.BUILD_NUMBER: ${MAJ_VERSION}.${MIN_VERSION}.${BUILD_NUMBER}"

mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/include
mkdir -p $RPM_BUILD_ROOT/usr/include/ptlib
mkdir -p $RPM_BUILD_ROOT/usr/include/ptclib
mkdir -p $RPM_BUILD_ROOT/usr/lib/pwlib
mkdir -p $RPM_BUILD_ROOT/usr/share/pwlib
chmod a+r lib/*so*
rm -rf lib/libpt.so
cd lib
ln -s libpt_linux_x86_r.so.${MAJ_VERSION}.${MIN_VERSION}.${BUILD_NUMBER} libpt.so
cd ../
cp -df lib/*so* $RPM_BUILD_ROOT/usr/lib/
cp -rf include/ptclib/ $RPM_BUILD_ROOT/usr/include/
cp -rf include/ptlib/ $RPM_BUILD_ROOT/usr/include/
cp -rf include/ptbuildopts.h $RPM_BUILD_ROOT/usr/include/
cp -rf include/ptlib.h $RPM_BUILD_ROOT/usr/include/
cp tools/asnparser/obj*/asnparser $RPM_BUILD_ROOT/usr/bin/
pwd
### copy those audio plugins
cp -rf plugins/pwlib/device/sound/*.so $RPM_BUILD_ROOT/usr/lib/pwlib/
### copy those video input plugins
cp -rf plugins/pwlib/device/videoinput/*.so $RPM_BUILD_ROOT/usr/lib/pwlib/
mkdir -p $RPM_BUILD_ROOT/usr/share/pwlib/make/
cp -rf make/*.mak $RPM_BUILD_ROOT/usr/share/pwlib/make/
cp make/ptlib-config $RPM_BUILD_ROOT/usr/bin/
rm -rf $RPM_BUILD_ROOT/usr/include/ptlib/CVS/
rm -rf $RPM_BUILD_ROOT/usr/include/ptlib/unix/CVS/
rm -rf $RPM_BUILD_ROOT/usr/include/ptlib/unix/ptlib/CVS/
rm -rf $RPM_BUILD_ROOT/usr/include/ptclib/CVS/

%clean
# Clear up the mess
### cleaning up disabled here for test reasons.
#[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;

%files
%defattr(0755,root,root)
%{_prefix}/lib/libpt.so
%{_prefix}/lib/libpt_*.so.*

%files devel
%defattr(0755,root,root)
%{_prefix}/lib/libpt.so
%{_prefix}/lib/libpt_*.so
%attr(0644,root,root) %{_prefix}/include/ptlib.h
%attr(0644,root,root) %{_prefix}/include/ptbuildopts.h
%attr(0644,root,root) %{_prefix}/include/ptclib
%attr(0644,root,root) %{_prefix}/include/ptlib
#%attr(0644,root,root) %{_prefix}/include/*/*/*/*.inl
%{_prefix}/bin/*
%attr(0644,root,root) %{_prefix}/share/pwlib/make/*.mak

%files plugins-alsa
%{_prefix}/lib/pwlib/alsa.so

%files plugins-oss
%{_prefix}/lib/pwlib/oss.so

%files plugins-avc
%{_prefix}/lib/pwlib/avc.so

%files plugins-v4l
%{_prefix}/lib/pwlib/v4l.so

#%files plugins-dc
#%{_prefix}/lib/pwlib/dc.so


%post
echo -n "running ldconfig..."
/sbin/ldconfig
echo "done"

%changelog -n pwlib
* Sun Jan 18 2004 Jan Schampera <jan.schampera@web.de>
- update to 1.6.1
* Fri Dec 26 2003 Jan Schampera <jan.schampera@web.de>
- removed patch for plugins (it's pwlib's stuff now)
* Sat Aug 31 2003 Jan Schampera <jan.schampera@web.de>
- added patch functionality for plugins patch, fixed some depencies and other stuff
* Sun Aug 24 2003 Sebastian Fischer <fischer82@gmx.de>
  Adapted for use with Mandrake 9.1
  Used for pwlib-1.5.2
* Tue Aug 19 2003 - iason@antipariotis.gr
- adapted to the cvs version
* Fri Jun 20 2003 - lurchi@kawo1.rwth-aachen.de
- recreated package, pwlib features autoconf now