add packaging
[platform/upstream/gdbm.git] / packaging / gdbm.spec
1 #
2 # spec file for package gdbm
3 #
4 # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 #
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
14
15 # Please submit bugfixes or comments via http://bugs.opensuse.org/
16 #
17
18
19 Name:           gdbm
20 Version:        1.8.3
21 Release:        0
22 License:        GPL-2.0+
23 Summary:        GNU dbm key/data database
24 %define lname   libgdbm
25 Url:            http://directory.fsf.org/GNU/gdbm.html
26 Group:          System/Libraries
27 Source:         %{name}-%{version}.tar.bz2
28 Source2:        baselibs.conf
29 Patch0:         gdbm-%{version}.dif
30 Patch1:         gdbm-protoize_dbm_headers.patch
31 Patch2:         gdbm-prototype_static_functions.patch
32 Patch3:         gdbm-fix_testprogs.patch
33 Patch4:         gdbm-1.8.3-no-build-date.patch
34 BuildRequires:  libtool
35 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
36
37 %description
38 GNU dbm is a library of database functions that use extensible
39 hashing and work similar to the standard UNIX dbm. These routines are
40 provided to a programmer needing to create and manipulate a hashed
41 database.
42
43 The basic use of GDBM is to store key/data pairs in a data file. Each
44 key must be unique and each key is paired with only one data item.
45
46 The library provides primitives for storing key/data pairs, searching
47 and retrieving the data by its key and deleting a key along with its
48 data. It also supports sequential iteration over all key/data pairs in
49 a database.
50
51 For compatibility with programs using old UNIX dbm functions, the
52 package also provides traditional dbm and ndbm interfaces.
53
54 %package -n %lname
55 License:        GPL-2.0+
56 Summary:        GNU dbm key/data database
57 Group:          System/Libraries
58 # O/P added in 12.2
59 Obsoletes:      gdbm < %{version}-%{release}
60 Provides:       gdbm = %{version}-%{release}
61
62 %description -n %lname
63 GNU dbm is a library of database functions that use extensible
64 hashing and work similar to the standard UNIX dbm. These routines are
65 provided to a programmer needing to create and manipulate a hashed
66 database.
67
68 The basic use of GDBM is to store key/data pairs in a data file. Each
69 key must be unique and each key is paired with only one data item.
70
71 The library provides primitives for storing key/data pairs, searching
72 and retrieving the data by its key and deleting a key along with its
73 data. It also supports sequential iteration over all key/data pairs in
74 a database.
75
76 For compatibility with programs using old UNIX dbm functions, the
77 package also provides traditional dbm and ndbm interfaces.
78
79 %package devel
80 License:        GPL-2.0+ ; LGPL-2.1+
81 Summary:        Include Files and Libraries mandatory for Development
82 Group:          Development/Libraries/C and C++
83 Requires:       gdbm = %{version}
84 Provides:       gdbm:/usr/lib/libgdbm.so
85
86 %description devel
87 This package contains all necessary include files and libraries needed
88 to develop applications that require these.
89
90 %prep
91 %setup -q
92 %patch0
93 %patch1
94 %patch2
95 %patch3
96 %patch4
97
98 %build
99 aclocal
100 autoreconf --force --install
101 %ifarch sparc64
102 export CC="gcc -m64"
103 %endif
104 export CFLAGS="%{optflags} -Wa,--noexecstack"
105 %configure
106 make %{?_smp_mflags};
107
108 %install
109 make install INSTALL_ROOT=%{buildroot}
110 make install-compat INSTALL_ROOT=%{buildroot}
111 echo "/* GNU ld script
112    Use the shared library, but some functions are only in
113    the static library, so try that secondarily.  */
114 GROUP ( %{_libdir}/libgdbm.so %{_libdir}/libgdbm_compat.so )" > %{buildroot}/%{_libdir}/libndbm.so
115 echo "/* GNU ld script
116    Use the shared library, but some functions are only in
117    the static library, so try that secondarily.  */
118 GROUP ( %{_libdir}/libgdbm.a %{_libdir}/libgdbm_compat.a )" > %{buildroot}/%{_libdir}/libndbm.a
119
120 %post -n %lname -p /sbin/ldconfig
121
122 %postun -n %lname -p /sbin/ldconfig
123
124 %files -n %lname
125 %defattr(-,root,root)
126 %doc COPYING README NEWS
127 %{_libdir}/libgdbm.so.3
128 %{_libdir}/libgdbm.so.3.0.0
129 %{_libdir}/libgdbm_compat.so.3
130 %{_libdir}/libgdbm_compat.so.3.0.0
131
132 %files devel
133 %defattr(-,root,root)
134 %{_includedir}/dbm.h
135 %{_includedir}/gdbm.h
136 %{_includedir}/ndbm.h
137 %{_infodir}/gdbm.info.gz
138 %{_libdir}/libgdbm.a
139 %{_libdir}/libgdbm.so
140 %{_libdir}/libgdbm_compat.a
141 %{_libdir}/libgdbm_compat.so
142 %{_libdir}/libndbm.a
143 %{_libdir}/libndbm.so
144 %{_mandir}/man3/gdbm.3.gz
145 %exclude %{_libdir}/*.la
146
147
148 %changelog