add packaging
[platform/upstream/tiff.git] / packaging / tiff.spec
1 Name:           tiff
2 #BuildRequires:  libjbig-devel
3 Version:        4.0.2
4 Release:        0
5 License:        HPND
6 Summary:        Tools for Converting from and to the Tiff Format
7 Url:            http://www.remotesensing.org/libtiff
8 Group:          Productivity/Graphics/Convertors
9 Source:         tiff-%{version}.tar.bz2
10 Source3:        baselibs.conf
11 Patch2:         tiff-%{version}-seek.patch
12 Patch3:         tiff-%{version}-tiff2pdf-colors.patch
13 Patch9:         tiff-%{version}-dont-fancy-upsampling.patch
14 Patch10:        tiff-bigendian.patch
15 Patch11:        tiff-%{version}-CVE-2012-3401.patch
16 BuildRequires:  gcc-c++
17 BuildRequires:  libjpeg8-devel
18 BuildRequires:  libtool
19 BuildRequires:  lzma-devel
20 BuildRequires:  pkg-config
21 BuildRequires:  pkgconfig(zlib)
22 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
23
24 %description
25 This package contains the library and support programs for the TIFF
26 image format.
27
28 %package -n libtiff
29 Summary:        The Tiff Library (with JPEG and compression support)
30 Group:          System/Libraries
31
32 %description -n libtiff
33 This package includes the tiff libraries. To link a program with
34 libtiff, you will have to add -ljpeg and -lz to include the necessary
35 libjpeg and libz in the linking process.
36
37 %package -n libtiff-devel
38 Summary:        Development Tools for Programs which will use the libtiff Library
39 Group:          Development/Libraries/C and C++
40 Requires:       glibc-devel
41 Requires:       libstdc++-devel
42 Requires:       libtiff = %{version}
43
44 %description -n libtiff-devel
45 This package contains the header files and static libraries for
46 developing programs which will manipulate TIFF format image files using
47 the libtiff library.
48
49 %prep
50 %setup -q
51 %patch2 -p1
52 %patch3 -p1
53 %patch9 -p1
54 %patch10 -p1
55 %patch11
56
57 %build
58 %configure --disable-static --with-pic
59 make %{?_smp_mflags}
60
61 %install
62 mkdir -p %{buildroot}/{%{_mandir}/{man1,man3},usr/{bin,lib,include}}
63 %make_install
64 for f in `find %{buildroot}/%{_mandir} -type f -print ` ; do
65   if [ `wc -l <$f` -eq 1 ] && grep -q "^\.so " $f ; then
66     linkto=`sed -e "s|^\.so ||" $f`
67     [ -f "`dirname $f`/$linkto" ] && ln -sf "$linkto" $f
68   fi
69 done
70
71 rm -rf %{buildroot}%{_datadir}/doc/tiff*
72 rm -f %{buildroot}/%{_libdir}/*.la
73 find html -name "Makefile*" | xargs rm
74
75
76 %docs_package
77
78 %post -n libtiff -p /sbin/ldconfig
79
80 %postun -n libtiff -p /sbin/ldconfig
81
82 %files
83 %defattr(-,root,root)
84 %{_bindir}/*
85
86 %files -n libtiff
87 %doc COPYRIGHT
88 %{_libdir}/*.so.*
89
90 %files -n libtiff-devel
91 %{_includedir}/*
92 %{_libdir}/*.so
93 %{_libdir}/pkgconfig/*.pc
94
95 %changelog