File schily-libs.spec of Package schily-libs.15000

#
# spec file for package schily-libs
#
# Copyright (c) 2017 SUSE LINUX 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:           schily-libs
Version:        3.02~a09
Release:        0
%define rver	3.02a09
Summary:        A collection of libraries to support cdrtools
License:        CDDL-1.0 and GPL-2.0 and GPL-2.0+ and BSD-2-Clause and BSD-3-Clause and HPND and ISC
Group:          Development/Libraries/C and C++
Url:            http://cdrtools.sourceforge.net/private/cdrecord.html

Source:         http://downloads.sf.net/cdrtools/cdrtools-%rver.tar.bz2
Source1:        cdrecord.easy
Source2:        cdrecord.secure
Source3:        cdrecord.paranoid
Source4:        cdda2wav.easy
Source5:        cdda2wav.secure
Source6:        cdda2wav.paranoid
Source7:        pre_checkin.sh
Patch1:         gcc48wa.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} >= 1220
BuildRequires:  makedepend
%else
# makedepend was formerly included in xorg-x11-util-devel
BuildRequires:  xorg-x11-util-devel
%endif

%description
The "Schily" Tool Box is a set of tools written or managed by Jörg
Schilling. This source package is currently only used to produce the
libschily and libscg shared libraries.

%package -n libscg1_0
Summary:        An OS-independent SCSI transport library
License:        CDDL-1.0
Group:          System/Libraries

%description -n libscg1_0
libscg is a portable SCSI transport library, providing an abstraction
layer from operating systems' mechanisms to issue SCSI commands.

%package -n libscg-devel
Summary:        Development files for libscg, an OS-independent SCSI transport library
License:        CDDL-1.0
Group:          Development/Libraries/C and C++
Requires:       libscg1_0 = %version

%description -n libscg-devel
libscg is a portable SCSI transport library, providing an abstraction
layer from operating systems' mechanisms to issue SCSI commands.

This subpackage contains libraries and header files for developing
applications that want to make use of libcerror.

%package -n libschily1_0
Summary:        Support library for SING utilities
License:        CDDL-1.0
Group:          System/Libraries

%description -n libschily1_0
libschily contains many portability functions used by the Schily tools.

%package -n libschily-devel
Summary:        Development files for libschily
License:        CDDL-1.0
Group:          Development/Libraries/C and C++
Requires:       libschily1_0 = %version

%description -n libschily-devel
libschily contains many portability functions used by the Schily tools.

This subpackage contains libraries and header files for developing
applications that want to make use of libcerror.

%package -n libschily-devel-doc
Summary:        Manual pages for libschily
License:        CDDL-1.0
Group:          Development/Libraries/C and C++
%if 0%{?opensuse_version} >= 1140
BuildArch:      noarch
%endif

%description -n libschily-devel-doc
libschily contains many portability functions used by the Schily tools.

This subpackage contains the manual pages to the library's functions.

%prep
%setup -qn cdrtools-3.02
%patch -P 1 -p1

%build
%define targets conf inc include libschily libscg libscg/scg

# Fix up symbol order for GNU ld
for i in $(find . -type f -name "*-mapvers"); do
	mv "$i" "$i.old"
	perl -e '$_=join"",<>;s{\\\n}{}gs;print' <"$i.old" | \
	grep -v '^#' | \
	perl -e '$_=join"",<>;while(m{\S+\s*\{.*?\}.*?;}gs)
		{unshift@x,$&};print@x' >"$i"
done

for i in %targets; do
	pushd "$i"
	# not fully parallel safe, so stick to default
	gmake GMAKE_NOWARN=true LINKMODE=dynamic RUNPATH="" \
		CCCC=cc LDCC=cc DYNLD=cc \
Ldoptx='$(_mapvers:%=-Wl,--version-script=%)' \
		COPTX="%optflags -fno-strict-aliasing -fno-omit-frame-pointer \
			-finput-charset=ISO-8859-1"
	popd
done;

%install
b="%buildroot"
for i in %targets; do
	pushd "$i"
	# D'oh… not parallel safe
	gmake GMAKE_NOWARN=true LINKMODE=dynamic RUNPATH="" \
		CCCC=cc LDCC=cc DYNLD=cc \
		Ldoptx='$(_mapvers:%=-Wl,--version-script=%)' \
		DESTDIR="$b" INS_BASE="%_prefix" \
		install -j1
	popd
done
if [ "%_lib" != "lib" ]; then
	mkdir -p "$b/%_libdir"
	mv "$b/%_prefix/lib"/* "$b/%_libdir/"
fi
rm -Rf "$b/%_libdir/profiled" "$b/%_libdir"/*.a
pushd "$b/%_mandir/man3/"
# avoid conflict with strlen.3 from man-pages
for f in *.3; do
	mv "$f" "${f}schily"
done
popd

%post   -p /sbin/ldconfig -n libscg1_0
%postun -p /sbin/ldconfig -n libscg1_0
%post   -p /sbin/ldconfig -n libschily1_0
%postun -p /sbin/ldconfig -n libschily1_0

%files -n libscg1_0
%defattr(-,root,root)
%_libdir/libscg.so.1*
%doc COPYING

%files -n libscg-devel
%defattr(-,root,root)
%_libdir/libscg.so
%_includedir/scg/

%files -n libschily1_0
%defattr(-,root,root)
%_libdir/libschily.so.1*
%doc COPYING

%files -n libschily-devel
%defattr(-,root,root)
%_libdir/libschily.so
%_includedir/schily/

%files -n libschily-devel-doc
%defattr(-,root,root)
%_mandir/man3/*.3schily*

%changelog
openSUSE Build Service is sponsored by