summaryrefslogtreecommitdiffstats
path: root/libcgif.spec
blob: 13401c469209db4f1899c8a2c989c3b4152b67d9 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# remirepo/fedora spec file for libcgif
#
# Copyright (c) 2021 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%global gh_commit   e698ff1d03c3ddea4f67d5ec8b2cb23faf785680
%global gh_short    %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date     20211001
%global gh_owner    dloebl
%global gh_project  cgif
%global libname     libcgif
%global soname      0

Name:          %{libname}
Summary:       A fast and lightweight GIF encoder
Version:       0.0.1
Release:       1%{?dist}
License:       MIT

URL:           https://github.com/%{gh_owner}/%{gh_project}
Source0:       https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz

BuildRequires: gcc
BuildRequires: meson


%description
A fast and lightweight GIF encoder that can create GIF animations and images.

Summary of the main features:

- user-defined global or local color-palette with up to 256 colors
  (limit of the GIF format)
- size-optimizations for GIF animations:
  - option to set a pixel to transparent if it has identical color in the
    previous frame (transparency optimization)
  - do encoding just for the rectangular area that differs from the previous
    frame (width/height optimization)
- fast: a GIF with 256 colors and 1024x1024 pixels can be created in below
  50 ms even on a minimalistic system
- MIT license (permissive)
- different options for GIF animations: static image, N repetitions, infinite
  repetitions
- additional source-code for verifying the encoder after making changes
- user-defined delay time from one frame to the next (can be set independently
  for each frame)
- source-code conforms to the C99 standard


%package devel
Summary:    Header files and development libraries for %{libname}
Requires:   %{name}%{?_isa} = %{version}-%{release}

%description devel
This package contains the header files and development libraries
for %{libname}.


%prep
%setup -q -n %{gh_project}-%{gh_commit}


%build
%meson
%meson_build


%install
%meson_install

# https://github.com/dloebl/cgif/issues/24
grep ^Version %{buildroot}%{_libdir}/pkgconfig/%{gh_project}.pc
sed -e 's/undefined/%{version}/' -i %{buildroot}%{_libdir}/pkgconfig/%{gh_project}.pc


%check
%meson_test


%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%{_libdir}/%{libname}.so.%{soname}*

%files devel
%doc README.md
%{_libdir}/pkgconfig/%{gh_project}.pc
%{_libdir}/%{libname}.so
%{_includedir}/%{gh_project}.h


%changelog
* Mon Nov  8 2021 Remi Collet <remi@remirepo.net> - 0.0.1-1
- initial package