tizen 2.3.1 release
[external/popt.git] / packaging / popt.spec
1 Name:       popt
2 Summary:    C library for parsing command line parameters
3 Version:    1.16
4 Release:    3
5 Group:      System/Libraries
6 License:    MIT
7 URL:        http://www.rpm5.org/
8 Source0:    http://www.rpm5.org/files/%{name}/%{name}-%{version}.tar.gz
9 Source1001: %{name}.manifest
10 Patch1:     popt-pkgconfig-lib64.patch
11 Requires(post): /sbin/ldconfig
12 Requires(postun): /sbin/ldconfig
13
14
15 %description
16 Popt is a C library for parsing command line parameters. Popt was
17 heavily influenced by the getopt() and getopt_long() functions, but
18 it improves on them by allowing more powerful argument expansion.
19 Popt can parse arbitrary argv[] style arrays and automatically set
20 variables based on command line arguments. Popt allows command line
21 arguments to be aliased via configuration files and includes utility
22 functions for parsing arbitrary strings into argv[] arrays using
23 shell-like rules.
24
25
26
27 %package devel
28 Summary:    Development files for the popt library
29 Group:      Development/Libraries
30 Requires:   %{name} = %{version}-%{release}
31
32 %description devel
33 The popt-devel package includes header files and libraries necessary
34 for developing programs which use the popt C library. It contains the
35 API documentation of the popt library, too.
36
37
38
39 %prep
40 %setup -q -n %{name}-%{version}
41 %ifarch x86_64
42 %patch1 -p1
43 %endif
44
45 %build
46 cp %{SOURCE1001} .
47 %configure --disable-static \
48     --libdir=/%{_lib} \
49     --disable-nls
50
51 make %{?jobs:-j%jobs}
52
53 %install
54 rm -rf %{buildroot}
55 %make_install
56
57 # Move libpopt.{so,a} to %{_libdir}
58 rm -f $RPM_BUILD_ROOT/%{_lib}/libpopt.{la,so}
59 pushd $RPM_BUILD_ROOT/%{_lib}
60 mkdir -p $RPM_BUILD_ROOT%{_libdir}
61 ln -sf ../../%{_lib}/$(ls libpopt.so.?.?.?) $RPM_BUILD_ROOT%{_libdir}/libpopt.so
62 popd
63
64 # Multiple popt configurations are possible
65 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/popt.d
66
67 mkdir -p $RPM_BUILD_ROOT%{_datadir}/license
68 for keyword in LICENSE COPYING COPYRIGHT;
69 do
70         for file in `find %{_builddir} -name $keyword`;
71         do
72                 cat $file >> $RPM_BUILD_ROOT%{_datadir}/license/%{name};
73                 echo "";
74         done;
75 done
76
77 %post -p /sbin/ldconfig
78
79 %postun -p /sbin/ldconfig
80
81
82 %files
83 %defattr(-,root,root,-)
84 %manifest %{name}.manifest
85 %doc COPYING
86 %{_datadir}/license/%{name}
87 %{_sysconfdir}/popt.d
88 /%{_lib}/libpopt.so.*
89
90
91 %files devel
92 %defattr(-,root,root,-)
93 %doc README
94 #%doc doxygen/html
95 %{_libdir}/libpopt.so
96 %{_libdir}/pkgconfig/popt.pc
97 %{_includedir}/popt.h
98 %doc %{_mandir}/man3/popt.3*