Tizen 2.1 base
[external/libgpg-error.git] / packaging / libgpg-error.spec
1 Summary: Library for error values used by GnuPG components
2 Name: libgpg-error
3 Version: 1.7
4 Release: 1
5 URL: ftp://ftp.gnupg.org/gcrypt/libgpg-error/
6 Source0: ftp://ftp.gnupg.org/gcrypt/libgpg-error/%{name}-%{version}.tar.bz2
7 Group: System/Libraries
8 License: LGPLv2+
9 BuildRequires: gawk, gettext-tools
10 Requires(post): /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12
13 %description
14 This is a library that defines common error values for all GnuPG
15 components.  Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
16 pinentry, SmartCard Daemon and possibly more in the future.
17
18 %package devel
19 Summary: Development files for the %{name} package
20 Group: Development/Libraries
21 Requires: %{name} = %{version}-%{release}
22
23 %description devel
24 This is a library that defines common error values for all GnuPG
25 components.  Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
26 pinentry, SmartCard Daemon and possibly more in the future. This package
27 contains files necessary to develop applications using libgpg-error.
28
29 %prep
30 %setup -q
31 # The config script already suppresses the -L if it's /usr/lib, so cheat and
32 # set it to a value which we know will be suppressed.
33 sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib|g' src/gpg-error-config.in
34
35 %build
36 %configure --disable-static --enable-malloc0returnsnull
37 make
38
39 %install
40 rm -fr $RPM_BUILD_ROOT
41 %make_install
42 rm -rf $RPM_BUILD_ROOT/%{_datadir}/common-lisp
43
44 %find_lang %{name}
45
46 # Relocate the shared libraries to /%{_lib}.
47 mkdir -p $RPM_BUILD_ROOT/%{_lib}
48 for shlib in $RPM_BUILD_ROOT/%{_libdir}/*.so* ; do
49         if test -L "$shlib" ; then
50                 rm "$shlib"
51         else
52                 mv "$shlib" $RPM_BUILD_ROOT/%{_lib}/
53         fi
54 done
55 # Figure out where /%{_lib} is relative to %{_libdir}.
56 touch $RPM_BUILD_ROOT/root_marker
57 relroot=..
58 while ! test -f $RPM_BUILD_ROOT/%{_libdir}/$relroot/root_marker ; do
59         relroot=$relroot/..
60 done
61 # Overwrite development symlinks.
62 pushd $RPM_BUILD_ROOT/%{_libdir}
63 for shlib in $relroot/%{_lib}/lib*.so.* ; do
64         shlib=`echo "$shlib" | sed -e 's,//,/,g'`
65         target=`basename "$shlib" | sed -e 's,\.so.*,,g'`.so
66         ln -sf $shlib $target
67 done
68 popd
69 # Add the soname symlink.
70 /sbin/ldconfig -n $RPM_BUILD_ROOT/%{_lib}/
71 rm -f $RPM_BUILD_ROOT/root_marker
72
73 %check
74 make check
75
76 %clean
77 rm -fr $RPM_BUILD_ROOT
78
79 %post -p /sbin/ldconfig
80
81 %postun -p /sbin/ldconfig
82
83 %files -f %{name}.lang
84 %defattr(-,root,root)
85 %{_bindir}/gpg-error
86 /%{_lib}/libgpg-error.so.*
87
88 %files devel
89 %defattr(-,root,root)
90 %{_bindir}/gpg-error-config
91 %{_libdir}/libgpg-error.so
92 %{_includedir}/gpg-error.h
93 %{_datadir}/aclocal/gpg-error.m4
94