diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-04 20:50:58 -0800 |
---|---|---|
committer | Kévin THIERRY <kevin.thierry@open.eurogiciel.org> | 2014-11-04 13:13:52 +0100 |
commit | bae53d337ec60bb0b7c4811712c79ecb57aa647f (patch) | |
tree | 92370d2dba99119fa1566bfbc9a7ea4a890c00f0 | |
parent | 701680f0be7ed7224eff28e7fb5c567647611dfe (diff) | |
download | gdbm-bae53d337ec60bb0b7c4811712c79ecb57aa647f.tar.gz gdbm-bae53d337ec60bb0b7c4811712c79ecb57aa647f.tar.bz2 gdbm-bae53d337ec60bb0b7c4811712c79ecb57aa647f.zip |
add packaging
-rw-r--r-- | packaging/baselibs.conf | 4 | ||||
-rw-r--r-- | packaging/gdbm-1.8.3-no-build-date.patch | 14 | ||||
-rw-r--r-- | packaging/gdbm-fix_testprogs.patch | 138 | ||||
-rw-r--r-- | packaging/gdbm-protoize_dbm_headers.patch | 114 | ||||
-rw-r--r-- | packaging/gdbm-prototype_static_functions.patch | 11 | ||||
-rw-r--r-- | packaging/gdbm.spec | 65 |
6 files changed, 20 insertions, 326 deletions
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf index c468cd5..0cd2ead 100644 --- a/packaging/baselibs.conf +++ b/packaging/baselibs.conf @@ -1,4 +1,4 @@ -libgdbm3 +libgdbm gdbm-devel requires -gdbm-<targettype> - requires "libgdbm3-<targettype> = <version>" + requires "libgdbm-<targettype> = <version>" diff --git a/packaging/gdbm-1.8.3-no-build-date.patch b/packaging/gdbm-1.8.3-no-build-date.patch deleted file mode 100644 index 5b44fd9..0000000 --- a/packaging/gdbm-1.8.3-no-build-date.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: version.c -=================================================================== ---- version.c.orig 2002-10-16 00:00:42.000000000 +0200 -+++ version.c 2010-08-30 01:41:23.653696000 +0200 -@@ -29,8 +29,4 @@ - #include "autoconf.h" - - /* Keep a string with the version number in it! */ --const char * gdbm_version = "GDBM version 1.8.3. 10/15/2002" --#if defined(__STDC__) && defined(__DATE__) && defined(__TIME__) -- " (built " __DATE__ " " __TIME__ ")" --#endif -- ; -+const char * gdbm_version = "GDBM version 1.8.3. 10/15/2002"; diff --git a/packaging/gdbm-fix_testprogs.patch b/packaging/gdbm-fix_testprogs.patch deleted file mode 100644 index 2872256..0000000 --- a/packaging/gdbm-fix_testprogs.patch +++ /dev/null @@ -1,138 +0,0 @@ ---- testdbm.c -+++ testdbm.c -@@ -31,6 +31,9 @@ - #include "autoconf.h" - - #include <stdio.h> -+#if HAVE_STRING_H -+#include <string.h> -+#endif - #include <sys/types.h> - #if HAVE_STDLIB_H - #include <stdlib.h> -@@ -39,19 +42,15 @@ - #include <sys/file.h> - #endif - #include <sys/stat.h> -+#ifdef GNU -+#include "dbm.h" -+#else -+#include <dbm.h> -+#endif - - #define TRUE 1 - #define FALSE 0 - --typedef struct { -- char *dptr; -- int dsize; --} datum; -- --extern datum fetch (); --extern datum firstkey (); --extern datum nextkey (); -- - /* The test program allows one to call all the routines plus the hash function. - The commands are single letter commands. The user is prompted for all other - information. The commands are q (quit), f (fetch), s (store), d (delete), -@@ -123,7 +122,7 @@ - - case 'f': - printf ("key -> "); -- gets (key_line); -+ fgets (key_line, sizeof(key_line), stdin); - key_data.dptr = key_line; - key_data.dsize = strlen (key_line)+1; - return_data = fetch (key_data); -@@ -135,11 +134,11 @@ - - case 's': - printf ("key -> "); -- gets (key_line); -+ fgets (key_line, sizeof(key_line), stdin); - key_data.dptr = key_line; - key_data.dsize = strlen (key_line)+1; - printf ("data -> "); -- gets (data_line); -+ fgets (data_line, sizeof(data_line), stdin); - data_data.dsize = strlen (data_line)+1; - if (store (key_data, data_data) != 0) - printf ("Item not inserted. \n"); -@@ -148,7 +147,7 @@ - - case 'd': - printf ("key -> "); -- gets (key_line); -+ fgets (key_line, sizeof(key_line), stdin); - key_data.dptr = key_line; - key_data.dsize = strlen (key_line)+1; - if (delete (key_data) != 0) ---- testgdbm.c -+++ testgdbm.c -@@ -37,10 +37,22 @@ - - #include "getopt.h" - -+#if defined(__GNUC__) && __GNUC__ >=3 -+# define NORETURN __attribute__((__noreturn__)) -+#else -+# define NORETURN -+#endif -+ - extern const char * gdbm_version; - - extern const char *gdbm_strerror __P((gdbm_error)); - -+void print_bucket __P((hash_bucket *bucket, char *mesg)); -+void _gdbm_print_avail_list __P((gdbm_file_info *dbf)); -+void _gdbm_print_bucket_cache __P((gdbm_file_info *dbf)); -+void usage __P((char *)) NORETURN; -+ -+ - gdbm_file_info *gdbm_file; - - /* Debug procedure to print the contents of the current hash bucket. */ ---- testndbm.c -+++ testndbm.c -@@ -42,6 +42,9 @@ - #if HAVE_FCNTL_H - #include <fcntl.h> - #endif -+#if HAVE_STRING_H -+#include <string.h> -+#endif - #ifdef GNU - #include "ndbm.h" - #else -@@ -120,7 +123,7 @@ - - case 'f': - printf ("key -> "); -- gets (key_line); -+ fgets (key_line, sizeof(key_line), stdin); - key_data.dptr = key_line; - key_data.dsize = strlen (key_line)+1; - return_data = dbm_fetch (dbm_file, key_data); -@@ -132,11 +135,11 @@ - - case 's': - printf ("key -> "); -- gets (key_line); -+ fgets (key_line, sizeof(key_line), stdin); - key_data.dptr = key_line; - key_data.dsize = strlen (key_line)+1; - printf ("data -> "); -- gets (data_line); -+ fgets (data_line, sizeof(data_line), stdin); - data_data.dsize = strlen (data_line)+1; - if (dbm_store (dbm_file, key_data, data_data, DBM_REPLACE) != 0) - printf ("Item not inserted. \n"); -@@ -145,7 +148,7 @@ - - case 'd': - printf ("key -> "); -- gets (key_line); -+ fgets (key_line, sizeof(key_line), stdin); - key_data.dptr = key_line; - key_data.dsize = strlen (key_line)+1; - if (dbm_delete (dbm_file, key_data) != 0) diff --git a/packaging/gdbm-protoize_dbm_headers.patch b/packaging/gdbm-protoize_dbm_headers.patch deleted file mode 100644 index a8af2d8..0000000 --- a/packaging/gdbm-protoize_dbm_headers.patch +++ /dev/null @@ -1,114 +0,0 @@ ---- dbm.h -+++ dbm.h -@@ -1,7 +1,7 @@ - /* dbm.h - The include file for dbm users. */ - - /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. -- Copyright (C) 1990, 1991, 1993 Free Software Foundation, Inc. -+ Copyright (C) 1990, 1991, 1993, 2008 Free Software Foundation, Inc. - - GDBM is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by -@@ -32,21 +32,31 @@ - int dsize; - } datum; - -+/* The file information header. This is good enough for most applications. */ -+typedef struct {int dummy[10];} DBM; - --/* These are the routines in dbm. */ - --extern int dbminit (); -+/* Determine if the C(++) compiler requires complete function prototype */ -+#ifndef __P -+#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) -+#define __P(x) x -+#else -+#define __P(x) () -+#endif -+#endif -+ -+/* These are the routines in dbm. */ - --extern datum fetch (); -+extern int dbminit __P((char *file)); - --extern int store (); -+extern datum fetch __P((datum key)); - --extern int delete (); -+extern int store __P((datum key, datum content)); - --extern int delete (); -+extern int delete __P((datum key)); - --extern datum firstkey (); -+extern datum firstkey __P((void)); - --extern datum nextkey (); -+extern datum nextkey __P((datum key)); - --extern int dbmclose (); -+extern int dbmclose __P((void)); ---- ndbm.h -+++ ndbm.h -@@ -1,7 +1,7 @@ - /* ndbm.h - The include file for ndbm users. */ - - /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. -- Copyright (C) 1990, 1991, 1993 Free Software Foundation, Inc. -+ Copyright (C) 1990, 1991, 1993, 2008 Free Software Foundation, Inc. - - GDBM is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by -@@ -41,31 +41,39 @@ - /* The file information header. This is good enough for most applications. */ - typedef struct {int dummy[10];} DBM; - -+/* Determine if the C(++) compiler requires complete function prototype */ -+#ifndef __P -+#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) -+#define __P(x) x -+#else -+#define __P(x) () -+#endif -+#endif - - /* These are the routines (with some macros defining them!) */ - --extern DBM *dbm_open (); -+extern DBM *dbm_open __P((char *file, int flags, int mode)); - --extern void dbm_close (); -+extern void dbm_close __P((DBM *dbf)); - --extern datum dbm_fetch (); -+extern datum dbm_fetch __P((DBM *dbf, datum key)); - --extern int dbm_store (); -+extern int dbm_store __P((DBM *dbf, datum key, datum content, int flags)); - --extern int dbm_delete (); -+extern int dbm_delete __P((DBM *dbf, datum key)); - --extern int dbm_delete (); -+extern int dbm_delete __P((DBM *dbf, datum key)); - --extern datum dbm_firstkey (); -+extern datum dbm_firstkey __P((DBM *)); - --extern datum dbm_nextkey (); -+extern datum dbm_nextkey __P((DBM *)); - - #define dbm_error(dbf) (0) - - #define dbm_clearerr(dbf) - --extern int dbm_dirfno (); -+extern int dbm_dirfno __P((DBM *dbf)); - --extern int dbm_pagfno (); -+extern int dbm_pagfno __P((DBM *dbf)); - --extern int dbm_rdonly (); -+extern int dbm_rdonly __P((DBM *dbf)); diff --git a/packaging/gdbm-prototype_static_functions.patch b/packaging/gdbm-prototype_static_functions.patch deleted file mode 100644 index d672dc1..0000000 --- a/packaging/gdbm-prototype_static_functions.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gdbmseq.c -+++ gdbmseq.c -@@ -41,6 +41,8 @@ - at ELEM_LOC of the current bucket and using RETURN_VAL as the place to - put the data that is found. */ - -+static void get_next_key __P((gdbm_file_info *, int, datum *)); -+ - static void - get_next_key (dbf, elem_loc, return_val) - gdbm_file_info *dbf; diff --git a/packaging/gdbm.spec b/packaging/gdbm.spec index 4162e9d..e5c79b7 100644 --- a/packaging/gdbm.spec +++ b/packaging/gdbm.spec @@ -1,38 +1,17 @@ -# -# spec file for package gdbm -# -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via http://bugs.opensuse.org/ -# - +%define keepstatic 1 Name: gdbm -Version: 1.8.3 +%define lname libgdbm +Url: http://directory.fsf.org/GNU/gdbm.html +Version: 1.10 Release: 0 License: GPL-2.0+ Summary: GNU dbm key/data database -%define lname libgdbm -Url: http://directory.fsf.org/GNU/gdbm.html Group: System/Libraries -Source: %{name}-%{version}.tar.bz2 +Source: ftp://prep.ai.mit.edu/gnu/gdbm/gdbm-%{version}.tar.gz Source2: baselibs.conf -Patch0: gdbm-%{version}.dif -Patch1: gdbm-protoize_dbm_headers.patch -Patch2: gdbm-prototype_static_functions.patch -Patch3: gdbm-fix_testprogs.patch -Patch4: gdbm-1.8.3-no-build-date.patch +# FIX-FOR-UPSTREAM i@marguerite.su - remove the build date from src/version.c BuildRequires: libtool -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description GNU dbm is a library of database functions that use extensible @@ -89,25 +68,16 @@ to develop applications that require these. %prep %setup -q -%patch0 -%patch1 -%patch2 -%patch3 -%patch4 %build aclocal autoreconf --force --install -%ifarch sparc64 -export CC="gcc -m64" -%endif export CFLAGS="%{optflags} -Wa,--noexecstack" -%configure +%configure --enable-libgdbm-compat make %{?_smp_mflags}; %install -make install INSTALL_ROOT=%{buildroot} -make install-compat INSTALL_ROOT=%{buildroot} +%make_install echo "/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ @@ -117,20 +87,24 @@ echo "/* GNU ld script the static library, so try that secondarily. */ GROUP ( %{_libdir}/libgdbm.a %{_libdir}/libgdbm_compat.a )" > %{buildroot}/%{_libdir}/libndbm.a +mkdir -p %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/ +cp -r %{SOURCE3} %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/%{name}.mo +%find_lang %{name} + %post -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig -%files -n %lname %defattr(-,root,root) -%doc COPYING README NEWS -%{_libdir}/libgdbm.so.3 -%{_libdir}/libgdbm.so.3.0.0 -%{_libdir}/libgdbm_compat.so.3 -%{_libdir}/libgdbm_compat.so.3.0.0 +%doc COPYING +%{_libdir}/libgdbm.so.4 +%{_libdir}/libgdbm.so.4.0.0 +%{_libdir}/libgdbm_compat.so.4 +%{_libdir}/libgdbm_compat.so.4.0.0 %files devel %defattr(-,root,root) +%{_bindir}/testgdbm %{_includedir}/dbm.h %{_includedir}/gdbm.h %{_includedir}/ndbm.h @@ -142,7 +116,4 @@ GROUP ( %{_libdir}/libgdbm.a %{_libdir}/libgdbm_compat.a )" > %{buildroot}/%{_li %{_libdir}/libndbm.a %{_libdir}/libndbm.so %{_mandir}/man3/gdbm.3.gz -%exclude %{_libdir}/*.la - -%changelog |