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