File crossguid.spec of Package crossguid
#
# spec file for package crossguid
#
# Copyright (c) 2015 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/
#
%define git_version b56957ac453575e91ca1b63a80c0077c2b0d011a
Name: crossguid
Version: 0.1+git0.b56957a
Release: 0
Summary: Lightweight cross platform C++ GUID/UUID library
License: MIT
Group: Development/Languages/C and C++
Url: https://github.com/graeme-hill/crossguid
Source0: https://github.com/graeme-hill/crossguid/archive/%{git_version}.tar.gz
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: gcc-c++ >= 4.7
BuildRequires: pkg-config
BuildRequires: pkgconfig(uuid)
BuildRequires: fdupes
%description
%package devel
Summary: Lightweight cross platform C++ GUID/UUID library
Group: Development/Languages/C and C++
Provides: %{name}-devel = %{git_version}
%description devel
%prep
%setup -q -n %{name}-%{git_version}
%build
./clean.sh
g++ -c guid.cpp -o guid.o -Wall -std=c++11 -DGUID_LIBUUID
g++ -c test.cpp -o test.o -Wall -std=c++11
g++ -c testmain.cpp -o testmain.o -Wall
g++ test.o guid.o testmain.o -o test -luuid
chmod +x test
ar rvs lib%{name}.a guid.o
%install
ls -al
mkdir -p %{buildroot}%{_libdir} && install -m 644 lib%{name}.a %{buildroot}%{_libdir}/
mkdir -p %{buildroot}%{_includedir} && install -m 644 guid.h %{buildroot}%{_includedir}/
%fdupes -s %{buildroot}
%check
./test
%files devel
%defattr(-,root,root)
%license LICENSE
%doc README.md
%{_libdir}/lib%{name}.a
%{_includedir}/guid.h
%changelog