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