File erlang-sd_notify.spec of Package erlang-sd_notify

#
# spec file for package erlang-sd_notify
#
# 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/
#

%define app_name sd_notify

Name:           erlang-%{app_name}
Version:        0.1
%define app_ver {%version}
Release:        0
Summary:        Erlang interface to systemd notify subsystem
License:        MIT
Group:          Development/Libraries/Other
Url:            https://github.com/lemenkov/erlang-sd_notify
Source0:        https://github.com/lemenkov/erlang-sd_notify/archive/%{version}/erlang-%{app_name}-%{version}.tar.gz
BuildRequires:  erlang-rebar
BuildRequires:  systemd-devel
Requires:       erlang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Erlang interface to systemd notify subsystem

%prep
%setup -q

%build
%if 0%{?suse_version} > 1310  
export LDFLAGS=-lsystemd
%else
export LDFLAGS=-lsystemd-daemon
%endif
%rebar compile

%install
mkdir -p %{buildroot}%{erlang_libdir}/%{app_name}-%{app_ver}/{ebin,priv}
install -m 644 -p ebin/%{app_name}.app %{buildroot}%{erlang_libdir}/%{app_name}-%{app_ver}/ebin
install -m 644 -p ebin/%{app_name}.beam %{buildroot}%{erlang_libdir}/%{app_name}-%{app_ver}/ebin
install -m 755 -p priv/%{app_name}_drv.so %{buildroot}%{erlang_libdir}/%{app_name}-%{app_ver}/priv

%files
%defattr(-,root,root,-)
%doc LICENSE
%dir %{erlang_libdir}/%{app_name}-%{app_ver}
%dir %{erlang_libdir}/%{app_name}-%{app_ver}/ebin
%dir %{erlang_libdir}/%{app_name}-%{app_ver}/priv
%{erlang_libdir}/%{app_name}-%{app_ver}/ebin/%{app_name}.app
%{erlang_libdir}/%{app_name}-%{app_ver}/ebin/*.beam
%{erlang_libdir}/%{app_name}-%{app_ver}/priv/%{app_name}_drv.so

%changelog
openSUSE Build Service is sponsored by