[License] set FTL license to avoid license conflict
[platform/upstream/freetype2.git] / packaging / freetype2.spec
1 Name:           freetype2
2 Summary:        A free and portable font rendering engine
3 Version:        2.10.4
4 Release:        1
5 Group:          Graphics/Font Management
6 License:        FTL
7 Url:            http://www.freetype.org
8 Source0:        http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-%{version}.tar.gz
9 Source1001:     packaging/freetype2.manifest
10 BuildRequires:  pkgconfig(libpng)
11 Requires(post): /sbin/ldconfig
12 Requires(postun): /sbin/ldconfig
13 Provides:       %{name}-bytecode
14
15 %description
16 The FreeType engine is a free and portable font rendering
17 engine, developed to provide advanced font support for a variety of
18 platforms and environments. FreeType is a library which can open and
19 manages font files as well as efficiently load, hint and render
20 individual glyphs. FreeType is not a font server or a complete
21 text-rendering library.
22
23 %package -n libfreetype
24 Summary:        A TrueType Font Library
25 Group:          Graphics/Font Management
26
27 %description -n libfreetype
28 This library features TrueType fonts for open source projects. This
29 version also contains an autohinter for producing improved output.
30
31 %package devel
32 Summary:        FreeType development libraries and header files
33 Group:          Development/Libraries
34 Requires:       libfreetype = %{version}
35 Requires:       zlib-devel
36 Requires:       pkgconfig
37 Provides:       freetype-devel
38
39 %description devel
40 The freetype-devel package includes the static libraries and header files
41 for the FreeType font rendering engine.
42
43 Install freetype-devel if you want to develop programs which will use
44 FreeType.
45
46
47
48 %prep
49 %setup -q -n freetype-%{version} 
50
51 %build
52 cp %{SOURCE1001} .
53 export CFLAGS+=" -fstack-protector-strong -D_FORTIFY_SOURCE=2"
54 export LDFLAGS+=" -Wl,-z,relro"
55
56 %configure --disable-static --enable-freetype-config
57 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' builds/unix/libtool
58 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' builds/unix/libtool
59 make %{?_smp_mflags}
60
61 %install
62 rm -rf %{buildroot}
63
64 %makeinstall gnulocaledir=$RPM_BUILD_ROOT%{_datadir}/locale
65
66 # fix multilib issues
67 %ifarch x86_64 s390x ia64 ppc64 alpha sparc64 aarch64
68 %define wordsize 64
69 %else
70 %define wordsize 32
71 %endif
72
73 mv $RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig.h \
74 $RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig-%{wordsize}.h
75 cat >$RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig.h <<EOF
76 #ifndef __FTCONFIG_H__MULTILIB
77 #define __FTCONFIG_H__MULTILIB
78
79 #include <bits/wordsize.h>
80
81 #if __WORDSIZE == 32
82 # include "ftconfig-32.h"
83 #elif __WORDSIZE == 64
84 # include "ftconfig-64.h"
85 #else
86 # error "unexpected value for __WORDSIZE macro"
87 #endif
88
89 #endif
90 EOF
91
92 # Don't package static a or .la files
93 rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
94
95
96 %post -n libfreetype -p /sbin/ldconfig
97
98 %postun -n libfreetype -p /sbin/ldconfig
99
100 %files -n libfreetype
101 %manifest %{name}.manifest
102 %defattr(-,root,root,-)
103 %{_libdir}/libfreetype.so.*
104 %license docs/FTL.TXT
105
106 %files devel
107 %manifest %{name}.manifest
108 %defattr(-,root,root,-)
109 %dir %{_includedir}/freetype2
110 %{_datadir}/aclocal/freetype2.m4
111 %{_includedir}/freetype2/*
112 %{_libdir}/libfreetype.so
113 %{_bindir}/freetype-config
114 %{_libdir}/pkgconfig/*.pc
115 %{_datadir}/man/man1/*