File erlang-gettext.spec of Package erlang-gettext

%def_disable debug

%define bname gettext
Name: erlang-%bname
Version: 2.1.0
%define Release 6
Release: 6
Summary: gettext handling for Erlang
License: MIT
Group: Development/Libraries/Other
URL: https://github.com/etnt/%bname/
Source: %name.tar.xz
#Patch: %name-%version-cx.patch
BuildArch: noarch
Requires: erlang-otp
Buildroot: %buildroot
 
BuildRequires: xz tar >= 1.23
%define __find_provides %erlang_provides
%define __find_requires %erlang_requires
BuildRequires: rpm-build-erlang
BuildRequires: erlang symlinks

%description
The '%bname' application makes it possible to internationalize your
application.
The name '%bname' comes from the GNU package with the same name.
However, the only thing they have in common is the format of the
PO-files, i.e the files containing the text that can be translated.


%package devel
Summary: Headers for %name
Group: Development/Libraries/Other

%description devel
The '%bname' application makes it possible to internationalize your
application.
This package contains headers for %name.


%package doc
Summary: Headers for %name
Group: Documentation/HTML

%description doc
The '%bname' application makes it possible to internationalize your
application.
This package contains HTML documentation for %name.


%prep
%setup -q -n %name
#patch -p1


%build
%if_enabled debug
%define eoptflags -W +inline +debug_info
%else
%define eoptflags -W +inline +compressed +slim
%endif
%make_build ERLC_FLAGS="%{?eoptflags:%eoptflags}" all docs


%install
for d in ebin include; do
	install -d -m 0755 %buildroot%_otplibdir/%bname-%version/$d
	install -m 0644 $d/* %buildroot%_otplibdir/%bname-%version/$d/
done
install -d -m 0755 %buildroot{%_otplibdir/%bname-%version/doc,%_docdir/%name-%version}
install -m 0644 doc/*.{css,html,png} %buildroot%_otplibdir/%bname-%version/doc/
install -m 0644 README test/* %buildroot%_docdir/%name-%version
ln -s %buildroot%_otplibdir/%bname-%version/doc %buildroot%_docdir/%name-%version/html
symlinks -csd %buildroot%_docdir/%name-%version


%files
%defattr(-,root,root)
%dir %_otplibdir/*
%_otplibdir/*/ebin


%files devel
%defattr(-,root,root)
%_otplibdir/*/include


%files doc
%defattr(-,root,root)
%doc %dir %_otplibdir/*
%doc %_otplibdir/*/doc
%doc %_docdir/%name-%version


%changelog
* Tue Apr 03 2012 Led <led@massivesolutions.co.uk> 2.1.0-6
- reverted to db886f7
- cleaned up requires of %%name-devel
 
* Tue Mar 27 2012 Led <led@massivesolutions.co.uk> 2.1.0-5
 - revert *.app file
 
* Sat Mar 03 2012 Led <led@massivesolutions.co.uk> 2.1.0-4
- spec:
  + added Buildroot
  + updated BuildRequires

* Sat Feb 11 2012 Led <led@massivesolutions.co.uk> 2.1.0-3
- used %%erlang_requires

* Sat Feb 11 2012 Led <led@massivesolutions.co.uk> 2.1.0-2
- used %%erlang_provides

* Wed Feb 08 2012 Led <led@massivesolutions.co.uk> 2.1.0-1
- cleaned up odd Provides
- added compile flags
- fixed License
- added doc subpackage

* Mon Feb 06 2012 Led <led@massivesolutions.co.uk> 2.1.0-0
- initial build for openSUSE