]> git.pld-linux.org Git - packages/c-ares.git/blob - c-ares.spec
add static_libs bcond
[packages/c-ares.git] / c-ares.spec
1 #
2 # Conditional build:
3 %bcond_without  static_libs     # static library
4
5 Summary:        A library that performs asynchronous DNS operations
6 Summary(pl.UTF-8):      Biblioteka do wykonywania asynchronicznych zapytań DNS
7 Name:           c-ares
8 Version:        1.22.0
9 Release:        1
10 License:        MIT
11 Group:          Libraries
12 #Source0Download: https://c-ares.haxx.se/
13 Source0:        https://c-ares.haxx.se/download/%{name}-%{version}.tar.gz
14 # Source0-md5:  0f9e7f16ddb6526e202e5e45b39253c7
15 Patch0:         %{name}-resolv.conf-reading-is-not-fatal.patch
16 URL:            https://c-ares.haxx.se/
17 BuildRequires:  autoconf >= 2.60
18 BuildRequires:  automake >= 1:1.9.6
19 # for tests
20 #BuildRequires: libstdc++-devel >= 6:4.7
21 BuildRequires:  libtool >= 2:2
22 BuildRequires:  rpmbuild(macros) >= 1.527
23 BuildRequires:  sed >= 4.0
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %description
27 c-ares is a C library that performs DNS requests and name resolves
28 asynchronously. c-ares is a fork of the library named 'ares', written
29 by Greg Hudson at MIT.
30
31 %description -l pl.UTF-8
32 c-ares jest napisaną w C biblioteką do asynchronicznego wykonywania
33 zapytań DNS. c-ares jest to fork biblioteki 'ares' napisanej przez
34 Grega Hudsona w MIT.
35
36 %package devel
37 Summary:        Development files for c-ares library
38 Summary(pl.UTF-8):      Pliki nagłówkowe dla biblioteki c-ares
39 Group:          Development/Libraries
40 Requires:       %{name} = %{version}-%{release}
41
42 %description devel
43 Header files for c-ares library.
44
45 %description devel -l pl.UTF-8
46 Pliki nagłówkowe biblioteki c-ares.
47
48 %package static
49 Summary:        Static c-ares library
50 Summary(pl.UTF-8):      Statyczna biblioteka c-ares
51 Group:          Development/Libraries
52 Requires:       %{name}-devel = %{version}-%{release}
53
54 %description static
55 Static c-ares library.
56
57 %description static -l pl.UTF-8
58 Statyczna biblioteka c-ares.
59
60 %prep
61 %setup -q
62 %patch0 -p1
63
64 # we want our own debug flags, if any
65 %{__sed} -i -e 's/flags_dbg_off=".*"/flags_dbg_off="%{rpmcflags}"/' m4/cares-compilers.m4
66 %{__sed} -i -e 's/flags_opt_yes=".*"/flags_opt_yes="%{rpmcflags}"/' m4/cares-compilers.m4
67
68 %build
69 %{__libtoolize}
70 %{__aclocal} -I m4
71 %{__autoconf}
72 %{__autoheader}
73 %{__automake}
74 cd test
75 %{__libtoolize}
76 %{__aclocal} -I ../m4
77 %{__autoconf}
78 %{__autoheader}
79 %{__automake}
80 cd ..
81 %configure \
82         --disable-silent-rules \
83         %{__enable_disable static_libs static} \
84         --disable-tests \
85         --enable-optimize="%{rpmcflags}" \
86         --enable-shared
87
88 %{__make}
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92
93 %{__make} install \
94         DESTDIR=$RPM_BUILD_ROOT
95
96 # no external dependencies + obsoleted by pkg-config
97 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libcares.la
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %post   -p /sbin/ldconfig
103 %postun -p /sbin/ldconfig
104
105 %files
106 %defattr(644,root,root,755)
107 %doc AUTHORS CHANGES LICENSE.md NEWS README.cares README.md RELEASE-NOTES TODO
108 %attr(755,root,root) %{_libdir}/libcares.so.*.*.*
109 %attr(755,root,root) %ghost %{_libdir}/libcares.so.2
110
111 %files devel
112 %defattr(644,root,root,755)
113 %attr(755,root,root) %{_libdir}/libcares.so
114 %{_includedir}/ares.h
115 %{_includedir}/ares_build.h
116 %{_includedir}/ares_dns.h
117 %{_includedir}/ares_dns_record.h
118 %{_includedir}/ares_nameser.h
119 %{_includedir}/ares_rules.h
120 %{_includedir}/ares_version.h
121 %{_mandir}/man3/ares_*.3*
122 %{_pkgconfigdir}/libcares.pc
123
124 %if %{with static_libs}
125 %files static
126 %defattr(644,root,root,755)
127 %{_libdir}/libcares.a
128 %endif
This page took 0.092365 seconds and 3 git commands to generate.