File nas.spec of Package nas

#
# spec file for package nas
#
# Copyright (c) 2012 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:           nas
%define         libname   libaudio
%define         libsoname %{libname}2

Version:        1.9.3
Release:        0
Summary:        Network Audio System - a portable, network-transparent audio system
Group:          Productivity/Multimedia/Sound/Utilities
License:        MIT
Url:            http://www.radscan.com/nas.html
# http://prdownloads.sourceforge.net/nas/nas-%{version}.src.tar.gz
Source:         %{name}-%{version}.src.tar.gz
Source90:       %{name}-rpmlintrc
# FIX-from Fedora: AuErrorDB list of error messages. Non-executables should not reside in LIBDIR.
Patch0:         %{name}-1.9.3-Move-AuErrorDB-to-SHAREDIR.patch
# FIX-openSUSE: fix linking
Patch1:         %{name}-fix_linking.patch
# FIX-openSUSE: fix several compile errors
## I: Program is using implicit definitions of special functions.
## I: Function call needs to pass NULL-pointer as last argument
## I: Program returns random data in a function
Patch2:         %{name}-fixes.patch
# FIX-UpStream: fixes after TAG creation
Patch100:       %{name}-UpStream_After_TAG.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
BuildRequires:  xorg-x11-util-devel
BuildRequires:  xorg-x11-libXau-devel
BuildRequires:  zlib-devel
Requires:       %{name}-utils = %{version}

%description
The Network Audio System service is a network-transparent system
developed at Network Computing Devices for playing, recording, and
manipulating audio data over a network. It uses the client/server
model to separate application code from the software drivers needed
to control specific audio input and output devices.

%package -n %{libsoname}
Summary:        Network Audio System client library
Group:          System/Libraries

%description -n %{libsoname}
The Network Audio System service is a network-transparent system
developed at Network Computing Devices for playing, recording, and
manipulating audio data over a network. It uses the client/server
model to separate application code from the software drivers needed
to control specific audio input and output devices.

This package contains NAS client library.

%package -n %{libname}-devel
Summary:        NAS client library - development headers
Group:          Development/Languages/C and C++
Requires:       %{libsoname} = %{version}

%description -n %{libname}-devel
The Network Audio System service is a network-transparent system
developed at Network Computing Devices for playing, recording, and
manipulating audio data over a network. It uses the client/server
model to separate application code from the software drivers needed
to control specific audio input and output devices.

This package contains development headers for NAS client library.

%package utils
Summary:        Network Audio System utilities
Group:          Productivity/Multimedia/Sound/Utilities

%description utils
The Network Audio System service is a network-transparent system
developed at Network Computing Devices for playing, recording, and
manipulating audio data over a network. It uses the client/server
model to separate application code from the software drivers needed
to control specific audio input and output devices.

This package contains miscellaneous NAS client utilities.

%package examples
Summary:        Network Audio System examples
Group:          Productivity/Multimedia/Sound/Utilities

%description examples
The Network Audio System service is a network-transparent system
developed at Network Computing Devices for playing, recording, and
manipulating audio data over a network. It uses the client/server
model to separate application code from the software drivers needed
to control specific audio input and output devices.

%package doc
Summary:        Network Audio System documentation
Group:          Documentation/Other

%description doc
The Network Audio System service is a network-transparent system
developed at Network Computing Devices for playing, recording, and
manipulating audio data over a network. It uses the client/server
model to separate application code from the software drivers needed
to control specific audio input and output devices.

%prep
%setup -q
%patch0 -p1
%patch1
%patch2
%patch100

%build
xmkmf
# See HISTORY file how to modify CDEBUGFLAGS
%{__make} \
 WORLDOPTS='-k CDEBUGFLAGS="%{optflags}"' \
 EXTRA_LOAD_FLAGS="`pkg-config --libs xau`" \
%{?_smp_mflags} World

%install
%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/X11/xinit/xinitrc.d

%makeinstall
%{__make} install.man \
  DESTDIR=%{buildroot} \
  MANPATH=%{_mandir}

%{__mv} %{buildroot}%{_sysconfdir}/%{name}/nasd.conf.eg \
	%{buildroot}%{_sysconfdir}/%{name}/nasd.conf

%{__cat} > nasd.xinit << EOF
#! /bin/sh
[ -z "$DISABLE_NAS_DAEMON" ] && %{_bindir}/nasd -b
EOF
%{__install} -m 755 nasd.xinit \
	%{buildroot}%{_sysconfdir}/X11/xinit/xinitrc.d/nasd

# menu-entry
%{__cat} > aupanel.desktop << EOF
[Desktop Entry]
#Encoding=UTF-8
Comment=Network Audio System device configuration panel
Name=Network Audio System - configuration panel
GenericName=Network Audio System - configuration panel
Type=Application
Exec=aupanel
#Icon=
Categories=AudioVideo;Music;
EOF
%suse_update_desktop_file -i aupanel AudioVideo Music

%{__cat} > audemo.desktop << EOF
[Desktop Entry]
#Encoding=UTF-8
Comment=Network Audio System record and play demo
Name=Network Audio System - record and play demo
GenericName=Network Audio System - record and play demo
Type=Application
Exec=audemo
#Icon=
Categories=AudioVideo;Music;
EOF
%suse_update_desktop_file -i audemo AudioVideo Music

%{__cat} > auedit.desktop << EOF
[Desktop Entry]
#Encoding=UTF-8
Comment=Network Audio System sound recording and editing program
Name=Network Audio System - Editor
GenericName=Network Audio System - Editor
Type=Application
Exec=auedit
#Icon=
Categories=AudioVideo;Music;
EOF
%suse_update_desktop_file -i auedit AudioVideo Music

%{__cat} > auphone.desktop << EOF
[Desktop Entry]
#Encoding=UTF-8
Comment=Network Audio System simple telephone client
Name=Network Audio System - telephone client
GenericName=Network Audio System - telephone client
Type=Application
Exec=auphone
#Icon=
Categories=AudioVideo;Music;
EOF
%suse_update_desktop_file -i auphone AudioVideo Music

%{__cat} > auwave.desktop << EOF
[Desktop Entry]
#Encoding=UTF-8
Comment=Network Audio System wave generator
Name=Network Audio System - wave generator
GenericName=Network Audio System - wave generator
Type=Application
Exec=auwave
#Icon=
Categories=AudioVideo;Music;
EOF
%suse_update_desktop_file -i auwave AudioVideo Music

# icon
#%__install -dm 755 %{buildroot}%{_datadir}/pixmaps
#%__install -m 644 xxx.png \
#	%{buildroot}%{_datadir}/pixmaps/%{name}.png

# remove satic lib
%{__rm} %{buildroot}%{_libdir}/*.a

%post   -n %{libsoname} -p /sbin/ldconfig
%postun -n %{libsoname} -p /sbin/ldconfig

%post utils
%if 0%{?suse_version} >= 1140
%desktop_database_post
%endif

%postun utils
%if 0%{?suse_version} >= 1140
%desktop_database_postun
%endif

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README
%doc %{_mandir}/man1/nasd.1*
%doc %{_mandir}/man5/nasd.conf.5*
%dir %{_sysconfdir}/nas
%config(noreplace) %{_sysconfdir}/nas/nasd.conf
%dir %{_sysconfdir}/X11/xinit
%dir %{_sysconfdir}/X11/xinit/xinitrc.d
%{_sysconfdir}/X11/xinit/xinitrc.d/nasd
%{_bindir}/nasd
%{_datadir}/X11/AuErrorDB

%files -n %{libsoname}
%defattr(-,root,root)
%{_libdir}/%{libname}.so.*

%files -n %{libname}-devel
%defattr(-,root,root)
%doc %{_mandir}/man3/*
%{_includedir}/audio
%{_libdir}/%{libname}.so

%files utils
%defattr(-,root,root)
%doc %{_mandir}/man1/au*
%doc %{_mandir}/man1/%{name}.1*
%{_bindir}/au*
%{_datadir}/applications/*.desktop
#%{_datadir}/pixmaps/%{name}.png

%files examples
%defattr(-,root,root)
%doc %{_mandir}/man1/checkmail.1*
%doc %{_mandir}/man1/issndfile.1*
%doc %{_mandir}/man1/playbucket.1*
%doc %{_mandir}/man1/soundtoh.1*
%{_bindir}/checkmail
%{_bindir}/issndfile
%{_bindir}/playbucket
%{_bindir}/soundtoh

%files doc
%defattr(-,root,root)
%doc BUILDNOTES FAQ HISTORY README.CYGWIN RELEASE TODO
%doc doc/actions doc/protocol.txt
%doc doc/*.ps
%doc doc/html
%doc doc/pdf

%changelog

openSUSE Build Service is sponsored by