%define majorver 1

Name: libfli
Summary: Library for FLI CCD Camera & Filter Wheels
Version: 1.7
Release: 10%{?_dist_release}

Group: System Environment/Libraries
# Code and LICENSE.LIB have different versions of the BSD license
# https://sourceforge.net/tracker2/?func=detail&aid=2568511&group_id=90275&atid=593019
License: BSD
URL: http://indi.sourceforge.net/index.php

Source0: http://downloads.sourceforge.net/indi/%{name}%{majorver}_%{version}.tar.gz
Patch0: libfli-suffix.patch

Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: cmake 

%description
Finger Lakes Instrument library is used by applications to control FLI 
line of CCDs and Filter wheels

%package devel
Summary: Libraries, includes, etc. used to develop an application with %{name}
Summary(ja): %{name} を用いるアプリケーションの開発に必要なファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
These are the header files needed to develop a %{name} application

%prep
%setup -q -n %{name}%{majorver}-%{version}
%patch0 -p1

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
CFLAGS="${CFLAGS:-%optflags}" \
CXXFLAGS="${CXXFLAGS:-%optflags}" \
FFLAGS="${FFLAGS:-%optflags}" \
%cmake \
    -DCMAKE_BUILD_TYPE=release \
    -DDATA_INSTALL_DIR:PATH=%{_datadir} \
    ..
popd

make VERBOSE=1 %{?_smp_mflags} -C %{_target_platform}

%install
rm -fr %{buildroot}
make install DESTDIR=%{buildroot} -C %{_target_platform}

%clean
rm -fr %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc LICENSE.BSD
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/*.so

%changelog
* Wed Feb 25 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 1.7-10
- rebuilt on current VineSeed

* Mon May 21 2012 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.7-9
- rebuild with rpm-4.8.1-3

* Sat Sep 05 2009 NAKAMURA Kenta <kenta@vinelinux.org> - 1.7-8
- use %%cmake macro

* Sun Aug 30 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.7-7
- Initial build for Vine Linux

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Feb 06 2009 Sergio Pascual <sergiopr at fedoraproject.org> -  1.7-4
- Adding disttag

* Thu Feb 05 2009 Sergio Pascual <sergiopr at fedoraproject.org> -  1.7-3
- Description lines wrapped around
- Consistent macros 
- Redownloaded source from upstream

* Mon Jan 28 2009 Sergio Pascual <sergiopr at fedoraproject.org> -  1.7-2
- Added patch to use LIB_SUFFIX

* Mon Jan 28 2009 Sergio Pascual <sergiopr at fedoraproject.org> -  1.7-1
- First specfile version

