summaryrefslogtreecommitdiff
path: root/packaging/gflags.spec
blob: c9dc83ef639180f9d0fddbca6edffa7df4dadc08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Name: gflags
Summary: A commandline flags library that allows for distributed flags
Version: 2.2.1
Release: 1
Group: Development/Libraries
URL: http://code.google.com/p/gflags
License: BSD
Vendor: Google Inc. and others
Packager: Google Inc. and others <google-gflags@googlegroups.com>
Source0: %{name}-%{version}.tar.gz
Source1: %{name}.manifest
Distribution: Redhat 7 and above.

BuildRequires: cmake
Requires(post):   /sbin/ldconfig
Requires(postun): /sbin/ldconfig

%description
The %name package contains a library that implements commandline flags
processing.  As such it's a replacement for getopt().  It has increased
flexibility, including built-in support for C++ types like string, and
the ability to define flags in the source file in which they're used.

%package devel
Summary: A commandline flags library that allows for distributed flags
Group: Development/Libraries
Requires: %{name} = %{version}

%description devel
The %name-devel package contains static and debug libraries and header
files for developing applications that use the %name package.

%prep
%setup -q
cp %{SOURCE1} .

%build
mkdir -p build
cd build
%cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_LIBDIR=%{_libdir}
make %{?_smp_mflags}

%install
cd build
make DESTDIR=%{buildroot} install

# Remove unnecessary files
rm -rf %{buildroot}%{_libdir}/cmake
rm -rf %{buildroot}/home/abuild

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%manifest %{name}.manifest
%{_libdir}/*.so.*
%{_bindir}/gflags_completions.sh

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