File ossp.spec of Package ossp

#
# spec file for package ossp
#
# Copyright (c) 2015 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/
#


%{!?_udevrulesdir: %global _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d }
Name:           ossp
Version:        1.3.2
Release:        0
Summary:        CUSE Proxy for legacy OSS Audio Apps
License:        GPL-2.0
Group:          System/Utilities
Url:            http://sourceforge.net/projects/osspd/
Source:         http://http://downloads.sourceforge.net/project/osspd/ossp-%{version}.tar.gz
Source1:        osspd.service
Patch0:         ossp-fixes-20130128.patch
BuildRequires:  alsa-devel
BuildRequires:  fuse-devel
BuildRequires:  libpulse-devel
BuildRequires:  pkgconfig(udev)
BuildRequires:  pkgconfig(systemd)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}

%description
CUSE Proxy for legacy OSS Audio Apps

%prep
%setup -q
%patch0 -p1

%build
export CFLAGS="%optflags"
make %{?_smp_mflags} prefix=%{_prefix} UDEVDIR=%{_udevrulesdir}

%install
%make_install prefix=%{_prefix} UDEVDIR=%{_udevrulesdir}
install -D -m 0644 %{S:1} %{buildroot}%{_unitdir}/osspd.service

%post
%{?udev_rules_update:%udev_rules_update}
%service_add_post osspd.service

%postun
%service_del_postun osspd.service

%pre
%service_add_pre osspd.service

%preun
%service_del_preun osspd.service

%files
%defattr(-,root,root)
%doc LICENSE README
%{_sbindir}/osspd
%{_sbindir}/ossp-*
%{_udevrulesdir}/98-osscuse.rules
%{_unitdir}/osspd.service

%changelog
openSUSE Build Service is sponsored by