File libieee1284.spec of Package libieee1284

#
# spec file for package libieee1284
#
# Copyright (c) 2013 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:           libieee1284
BuildRequires:  fdupes
BuildRequires:  python-devel
# bug437293
%ifarch ppc64
Obsoletes:      libieee1284-64bit
%endif
#
Summary:        A Library for Interfacing IEEE 1284-Compatible Devices
License:        GPL-2.0+ and MIT
Group:          System/Libraries
Version:        0.2.11
Release:        0
Url:            http://sourceforge.net/projects/libieee1284/
# Source0 is the main source
Source0:        http://cyberelk.net/tim/data/libieee1284/stable/%{name}-%{version}.tar.bz2
# Source1 is the documentation
Source1:        http://cyberelk.net/tim/libieee1284/interface.pdf
Source2:        baselibs.conf
Patch1:         libieee1284-strict-aliasing.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This library is intended to be used by applications that need to
communicate with (or at least identify) devices that are attached via a
parallel port.

For Linux, there are some wrinkles in communicating with devices on
parallel ports (see /usr/share/doc/packages/libieee1284/README). The
aim of this library is to take all the worry about these wrinkles from
the application.  It figures out which method is appropriate for the
currently running kernel.  For instance, if the application wants to
know the device ID of a device on a particular port, it asks the
library for the the device ID.	The library then figures out if it is
available via /proc (in any of the possible locations) and, if not,
tries asking the device itself.  If /dev/parport0 is not available for
use, it tries ioperm; if that fails, it tries /dev/port.  The
application does not have to care.

%package devel
Requires:       %{name} = %{version}
Summary:        Development files for libieee1284
Group:          Development/Libraries/C and C++

%description devel
Development files for libieee1284, a Library for Interfacing IEEE
1284-Compatible Devices.

%prep
%setup -q
%patch1 -p1
# copy the documentation into the BUILD directory
cp %{SOURCE1} .

%build
# set our preferred architecture-specific flags for the compiler and linker
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
%configure --disable-static --with-pic
make %{?_smp_mflags}

%check
# run a self-test ... its not doing anything, so leave it out
# make check 

%install
make install DESTDIR=${RPM_BUILD_ROOT}
# remove pointless libtool .la file
rm ${RPM_BUILD_ROOT}/%{_libdir}/libieee1284.la
# remove useless .a and .la files of python module
rm ${RPM_BUILD_ROOT}/%{_libdir}/python%{py_ver}/site-packages/ieee1284module.la
# create symbolic links to the actual library
ln -sf ${RPM_BUILD_ROOT}/%{_libdir}/libieee1284.so.3.2.1 libieee1284.so.3
ln -sf ${RPM_BUILD_ROOT}/%{_libdir}/libieee1284.so.3.2.1 libieee1284.so
%fdupes -s $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
/usr/bin/libieee1284_test
%{_libdir}/libieee1284.so.3.2.2
%{_libdir}/libieee1284.so.3
%{_libdir}/python%{py_ver}/site-packages/ieee1284module.so
%doc AUTHORS COPYING ChangeLog NEWS README TODO

%files devel
%defattr(-,root,root)
/usr/include/ieee1284.h
%{_libdir}/libieee1284.so
%{_mandir}/man3/*
%doc interface.pdf

%changelog
openSUSE Build Service is sponsored by