add packaging
[platform/upstream/gdbm.git] / packaging / gdbm.spec
1 %define keepstatic 1
2
3 Name:           gdbm
4 %define lname   libgdbm
5 Url:            http://directory.fsf.org/GNU/gdbm.html
6 Version:        1.10
7 Release:        0
8 License:        GPL-2.0+
9 Summary:        GNU dbm key/data database
10 Group:          System/Libraries
11 Source:         ftp://prep.ai.mit.edu/gnu/gdbm/gdbm-%{version}.tar.gz
12 Source2:        baselibs.conf
13 # FIX-FOR-UPSTREAM i@marguerite.su - remove the build date from src/version.c
14 BuildRequires:  libtool
15
16 %description
17 GNU dbm is a library of database functions that use extensible
18 hashing and work similar to the standard UNIX dbm. These routines are
19 provided to a programmer needing to create and manipulate a hashed
20 database.
21
22 The basic use of GDBM is to store key/data pairs in a data file. Each
23 key must be unique and each key is paired with only one data item.
24
25 The library provides primitives for storing key/data pairs, searching
26 and retrieving the data by its key and deleting a key along with its
27 data. It also supports sequential iteration over all key/data pairs in
28 a database.
29
30 For compatibility with programs using old UNIX dbm functions, the
31 package also provides traditional dbm and ndbm interfaces.
32
33 %package -n %lname
34 License:        GPL-2.0+
35 Summary:        GNU dbm key/data database
36 Group:          System/Libraries
37 # O/P added in 12.2
38 Obsoletes:      gdbm < %{version}-%{release}
39 Provides:       gdbm = %{version}-%{release}
40
41 %description -n %lname
42 GNU dbm is a library of database functions that use extensible
43 hashing and work similar to the standard UNIX dbm. These routines are
44 provided to a programmer needing to create and manipulate a hashed
45 database.
46
47 The basic use of GDBM is to store key/data pairs in a data file. Each
48 key must be unique and each key is paired with only one data item.
49
50 The library provides primitives for storing key/data pairs, searching
51 and retrieving the data by its key and deleting a key along with its
52 data. It also supports sequential iteration over all key/data pairs in
53 a database.
54
55 For compatibility with programs using old UNIX dbm functions, the
56 package also provides traditional dbm and ndbm interfaces.
57
58 %package devel
59 License:        GPL-2.0+ ; LGPL-2.1+
60 Summary:        Include Files and Libraries mandatory for Development
61 Group:          Development/Libraries/C and C++
62 Requires:       gdbm = %{version}
63 Provides:       gdbm:/usr/lib/libgdbm.so
64
65 %description devel
66 This package contains all necessary include files and libraries needed
67 to develop applications that require these.
68
69 %prep
70 %setup -q
71
72 %build
73 aclocal
74 autoreconf --force --install
75 export CFLAGS="%{optflags} -Wa,--noexecstack"
76 %configure --enable-libgdbm-compat
77 make %{?_smp_mflags};
78
79 %install
80 %make_install
81 echo "/* GNU ld script
82    Use the shared library, but some functions are only in
83    the static library, so try that secondarily.  */
84 GROUP ( %{_libdir}/libgdbm.so %{_libdir}/libgdbm_compat.so )" > %{buildroot}/%{_libdir}/libndbm.so
85 echo "/* GNU ld script
86    Use the shared library, but some functions are only in
87    the static library, so try that secondarily.  */
88 GROUP ( %{_libdir}/libgdbm.a %{_libdir}/libgdbm_compat.a )" > %{buildroot}/%{_libdir}/libndbm.a
89
90 mkdir -p %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/
91 cp -r %{SOURCE3} %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/%{name}.mo
92 %find_lang %{name}
93
94 %post -n %lname -p /sbin/ldconfig
95
96 %postun -n %lname -p /sbin/ldconfig
97
98 %defattr(-,root,root)
99 %doc COPYING
100 %{_libdir}/libgdbm.so.4
101 %{_libdir}/libgdbm.so.4.0.0
102 %{_libdir}/libgdbm_compat.so.4
103 %{_libdir}/libgdbm_compat.so.4.0.0
104
105 %files devel
106 %defattr(-,root,root)
107 %{_bindir}/testgdbm
108 %{_includedir}/dbm.h
109 %{_includedir}/gdbm.h
110 %{_includedir}/ndbm.h
111 %{_infodir}/gdbm.info.gz
112 %{_libdir}/libgdbm.a
113 %{_libdir}/libgdbm.so
114 %{_libdir}/libgdbm_compat.a
115 %{_libdir}/libgdbm_compat.so
116 %{_libdir}/libndbm.a
117 %{_libdir}/libndbm.so
118 %{_mandir}/man3/gdbm.3.gz
119