SHA256
1
0
forked from pool/man
OBS User unknown 2007-12-12 17:16:54 +00:00 committed by Git OBS Bridge
parent 0aa4b1741f
commit 14decd3568
15 changed files with 1022 additions and 1455 deletions

View File

@ -1,18 +0,0 @@
--- src/straycats.c
+++ src/straycats.c Wed Jul 9 19:33:23 2003
@@ -366,6 +366,7 @@
int fd;
drop_effective_privs ();
fd = create_tempfile ("zcat", &temp_name);
+ regain_effective_privs ();
if (fd == -1) {
error (0, errno,
_("warning: can't create temp file %s"),
@@ -373,7 +374,6 @@
return 0;
}
close (fd);
- regain_effective_privs ();
}
dbf = MYDBM_RWOPEN (database);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:28ef32cd88dcd486f76855a805c8028174eba816606160ae5a349d06dee6c0dc
size 22793

View File

@ -1,105 +0,0 @@
--- src/encodings.c 2005-01-05 16:11:54.000000000 +0100
+++ src/encodings.c 2007-07-26 14:25:02.000000000 +0200
@@ -106,6 +106,11 @@
{ "cs", "ISO-8859-2", "ISO-8859-2" }, /* Czech */
{ "hr", "ISO-8859-2", "ISO-8859-2" }, /* Croatian */
{ "hu", "ISO-8859-2", "ISO-8859-2" }, /* Hungarian */
+ { "zh_TW", "BIG5", "BIG5" }, /* Traditional Chinese */
+ { "zh_HK", "BIG5HKSCS", "BIG5HKSCS" }, /* Traditional Chinese */
+ { "zh_CN", "GB18030", "GB18030" }, /* Simplified Chinese */
+ { "zh_SG", "GB18030", "GB18030" }, /* Simplified Chinese */
+ { "zh", "GB18030", "GB18030" }, /* Simplified Chinese */
{ "ja", "EUC-JP", "EUC-JP" }, /* Japanese */
{ "ko", "EUC-KR", "EUC-KR" }, /* Korean */
{ "pl", "ISO-8859-2", "ISO-8859-2" }, /* Polish */
@@ -136,6 +141,9 @@
#ifdef MULTIBYTE_GROFF
{ "EUC-JP", "nippon" },
+ { "GB18030", "nippon" },
+ { "BIG5", "nippon" },
+ { "BIG5HKSCS", "nippon" },
#endif /* MULTIBYTE_GROFF */
{ NULL, NULL }
@@ -170,7 +178,7 @@
#ifdef MULTIBYTE_GROFF
{ "ascii8", NULL, NULL },
- { "nippon", "EUC-JP", "EUC-JP" },
+ { "nippon", NULL, NULL },
#endif /* MULTIBYTE_GROFF */
{ NULL, NULL, NULL }
@@ -193,6 +201,7 @@
{ "UTF-8", "utf-8" },
#ifdef MULTIBYTE_GROFF
+ { "GB18030", "zh" },
{ "EUC-JP", "ja" },
{ "KOI8-R", "koi8-r" },
#endif /* MULTIBYTE_GROFF */
@@ -283,6 +292,13 @@
* roff encoding = UTF-8
* output encoding = UTF-8
* EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
+ *
+ * /usr/share/man/zh_CN.GB18030, locale zh_CN.UTF-8
+ * page encoding = GB18030
+ * source encoding = GB18030
+ * roff encoding = UTF-8
+ * output encoding = UTF-8
+ * GB18030 -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
*/
const char *get_source_encoding (const char *lang)
{
@@ -386,10 +402,14 @@
return 1;
#ifdef MULTIBYTE_GROFF
- /* Special case for ja_JP.UTF-8, which takes UTF-8 input recoded
- * from EUC-JP and produces UTF-8 output. This is rather filthy.
+ /* Special case for ja_JP.UTF-8, zh_CN.UTF-8, zh_TW.UTF-8, and zh_HK.UTF-8 which
+ * takes UTF-8 input recoded from EUC-JP, BIG5, BIG5HKSCS, GB18030, or GBK
+ * and produces UTF-8 output.
+ * This is rather filthy.
*/
- if (STREQ (input, "EUC-JP") && STREQ (output, "UTF-8"))
+ if ((STREQ (input, "EUC-JP") || STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
+ STREQ (input, "GB18030") || STREQ (input, "GBK")) &&
+ STREQ (output, "UTF-8"))
return 1;
#endif /* MULTIBYTE_GROFF */
@@ -449,14 +469,26 @@
#ifdef MULTIBYTE_GROFF
/* An ugly special case is needed here. The utf8 device normally
* takes ISO-8859-1 input. However, with the multibyte patch, when
- * recoding from EUC-JP it takes UTF-8 input instead. This is evil,
- * but there's not much that can be done about it apart from waiting
- * for groff 2.0.
+ * recoding from EUC-JP, GB18030, BIG5, or BIG5HKSCS it takes UTF-8 input
+ * instead. This is evil, but there's not much that can be done
+ * about it apart from waiting for groff 2.0.
+ *
*/
+ /*
+ * don't try to convert to UTF-8, the input might be UTF-8 already
+ * and groff 1.18.1.1 with the multibyte patch doesn't want
+ * UTF-8 input anyway, the /usr/bin/nroff script contains
+ * a hack to convert back to the appropriate legacy encoding
+ * if it gets UTF-8 input.
+ */
if (STREQ (device, "utf8")) {
const char *ctype = setlocale (LC_CTYPE, NULL);
- if (STREQ (ctype, "ja_JP.UTF-8"))
- roff_encoding = "UTF-8";
+ if (STREQ (ctype, "ja_JP.UTF-8") ||
+ STREQ (ctype, "zh_CN.UTF-8") ||
+ STREQ (ctype, "zh_SG.UTF-8") ||
+ STREQ (ctype, "zh_TW.UTF-8") ||
+ STREQ (ctype, "zh_HK.UTF-8"))
+ roff_encoding = source_encoding; /* "UTF-8"; */
}
#endif /* MULTIBYTE_GROFF */

View File

@ -1,16 +1,6 @@
--- src/globbing.c
+++ src/globbing.c 2007-09-19 13:35:04.128822519 +0200
@@ -28,7 +28,9 @@
#endif /* HAVE_CONFIG_H */
/* Need _GNU_SOURCE for FNM_CASEFOLD. */
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#include <stdio.h>
@@ -340,13 +342,22 @@ char **look_for_file (const char *unesc_
@@ -340,13 +340,22 @@ char **look_for_file (const char *unesc_
/* allow lookups like "3x foo" to match "../man3/foo.3x" */
if ((layout & LAYOUT_GNU) && CTYPE (isdigit, *sec) && sec[1] != '\0') {

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be7487221716d5f53ca93c9fe373b33b6703626ee47d973e59128decab501b5e
size 636060

64
man-db-2.5.0-chinese.dif Normal file
View File

@ -0,0 +1,64 @@
--- src/encodings.c
+++ src/encodings.c 2007-12-07 19:12:54.428222452 +0100
@@ -110,6 +110,11 @@ static struct directory_entry directory_
{ "cs", "ISO-8859-2", "ISO-8859-2" }, /* Czech */
{ "hr", "ISO-8859-2", "ISO-8859-2" }, /* Croatian */
{ "hu", "ISO-8859-2", "ISO-8859-2" }, /* Hungarian */
+ { "zh_TW", "BIG5", "BIG5" }, /* Traditional Chinese */
+ { "zh_HK", "BIG5HKSCS", "BIG5HKSCS" }, /* Traditional Chinese */
+ { "zh_CN", "GB18030", "GB18030" }, /* Simplified Chinese */
+ { "zh_SG", "GB18030", "GB18030" }, /* Simplified Chinese */
+ { "zh", "GB18030", "GB18030" }, /* Simplified Chinese */
{ "ja", "EUC-JP", "EUC-JP" }, /* Japanese */
{ "ko", "EUC-KR", "EUC-KR" }, /* Korean */
{ "pl", "ISO-8859-2", "ISO-8859-2" }, /* Polish */
@@ -209,6 +214,7 @@ static struct charset_entry charset_tabl
{ "BIG5HKSCS", "nippon" },
{ "EUC-CN", "nippon" },
{ "EUC-JP", "nippon" },
+ { "GB18030", "nippon" },
{ "GBK", "nippon" },
#endif /* MULTIBYTE_GROFF */
@@ -267,6 +273,7 @@ static struct less_charset_entry less_ch
{ "UTF-8", "utf-8" },
#ifdef MULTIBYTE_GROFF
+ { "GB18030", "zh" },
{ "EUC-JP", "ja" },
{ "KOI8-R", "koi8-r" },
#endif /* MULTIBYTE_GROFF */
@@ -391,6 +398,13 @@ char *get_page_encoding (const char *lan
* roff encoding = UTF-8
* output encoding = UTF-8
* EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
+ *
+ * /usr/share/man/zh_CN.GB18030, locale zh_CN.UTF-8
+ * page encoding = GB18030
+ * source encoding = GB18030
+ * roff encoding = UTF-8
+ * output encoding = UTF-8
+ * GB18030 -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
*/
const char *get_source_encoding (const char *lang)
{
@@ -524,8 +538,8 @@ static int compatible_encodings (const c
* rather filthy.
*/
if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
- STREQ (input, "EUC-JP") ||
- STREQ (input, "EUC-CN") || STREQ (input, "GBK")) &&
+ STREQ (input, "EUC-JP") || STREQ (input, "EUC-CN") ||
+ STREQ (input, "GB18030") || STREQ (input, "GBK")) &&
STREQ (output, "UTF-8"))
return 1;
#endif /* MULTIBYTE_GROFF */
@@ -600,7 +614,7 @@ const char *get_roff_encoding (const cha
STREQ (ctype, "zh_HK.UTF-8") ||
STREQ (ctype, "zh_SG.UTF-8") ||
STREQ (ctype, "zh_TW.UTF-8"))
- roff_encoding = "UTF-8";
+ roff_encoding = source_encoding; /* "UTF-8"; */
}
#endif /* MULTIBYTE_GROFF */

View File

@ -1,6 +1,6 @@
--- lib/error.c
+++ lib/error.c Fri Mar 16 16:48:40 2001
@@ -69,12 +69,15 @@
+++ lib/error.c 2007-12-07 18:50:29.332479427 +0100
@@ -76,12 +76,15 @@ private_strerror (errnum)
#define strerror private_strerror
#endif
@ -16,38 +16,22 @@
void
#if defined(VA_START) && __STDC__
error (int status, int errnum, const char *message, ...)
@@ -117,3 +120,4 @@
if (status)
@@ -137,3 +140,4 @@ error (status, errnum, message, va_alist
exit (status);
}
}
+#endif
--- lib/error.h
+++ lib/error.h Fri Mar 16 16:45:18 2001
@@ -7,10 +7,11 @@
extern int errno;
#endif
+/* Use error() function of glibc */
#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)
-void error (int, int, const char *, ...);
+extern void error (int, int, const char *, ...);
#else
-void error ();
+extern void error ();
#endif
#endif
--- lib/xmalloc.c
+++ lib/xmalloc.c Fri Mar 16 16:45:37 2001
@@ -44,9 +44,9 @@
int xmalloc_exit_failure = EXIT_FAILURE;
#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)
-void error (int, int, const char *, ...);
+extern void error (int, int, const char *, ...);
#else
-void error ();
+extern void error ();
#endif
+++ lib/error.h 2007-12-07 18:51:53.803262466 +0100
@@ -29,9 +29,9 @@ extern int errno;
#include "manconfig.h"
#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)
-void error (int, int, const char *, ...) ATTRIBUTE_FORMAT_PRINTF(3, 4);
+extern void error (int, int, const char *, ...) ATTRIBUTE_FORMAT_PRINTF(3, 4);
#else
-void error ();
+extern void error ();
#endif
#endif

View File

@ -1,14 +1,14 @@
--- src/mandb.c
+++ src/mandb.c Fri Jul 11 17:48:41 2003
+++ src/mandb.c 2007-12-07 18:59:06.546515903 +0100
@@ -34,6 +34,7 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h> /* for chmod() */
+#include <fcntl.h> /* for open () */
#include <dirent.h>
#if defined(STDC_HEADERS)
# include <string.h>
@@ -328,11 +331,20 @@
@@ -393,11 +394,20 @@ static short mandb (const char *catpath,
char pid[23];
short amount;
char *dbname;

156
man-db-2.5.0-zio.dif Normal file
View File

@ -0,0 +1,156 @@
--- config.h.in
+++ config.h.in 2007-12-07 15:50:22.900940943 +0100
@@ -220,6 +220,9 @@
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
+/* Define to 1 if you have libzio for opening compressed manuals */
+#undef HAVE_ZIO
+
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
--- configure.ac
+++ configure.ac 2007-12-07 15:55:02.636618503 +0100
@@ -98,6 +98,18 @@ AC_ARG_WITH(config-file,
fi],
: ${config_file=\$\{sysconfdir\}/man_db.conf}
: ${config_file_basename=man_db.conf})
+AC_ARG_WITH(zio,
+[AS_HELP_STRING([--with-zio=LIBRARY], [use zlib/libbz2 wrapper library LIBRARY (libzio)])],
+ [if test -z "$withval" -o "$withval" = "yes"
+ then
+ zio=libzio
+ elif test "$withval" = "no"
+ then
+ AC_MSG_ERROR(--with-zio requires an argument)
+ else
+ zio=$withval
+ fi],
+ : ${zio=no})
dnl
dnl Finish the argument parsing
dnl
@@ -271,6 +283,29 @@ AC_SUBST(gunzip)dnl
AC_SUBST(uncompress)dnl
AC_SUBST(bunzip2)dnl
AC_CHECK_LIB(z, gzopen)
+dnl Check for zlib and libbz2 libraries to use this together
+dnl with SuSE's libzio to open compressed info files.
+dnl
+if test "$zio" = "no" || test -n "$zio"
+then
+ AC_CHECK_HEADER(zlib.h,[
+ for lib in z gz
+ do
+ AC_CHECK_LIB($lib, gzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ; break])
+ done])
+ AC_CHECK_HEADER(bzlib.h,[
+ for lib in bz2 bzip2
+ do
+ AC_CHECK_LIB($lib, BZ2_bzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ; break])
+ done])
+ AC_CHECK_HEADER(zio.h,[
+ for lib in ${zio#lib} zio
+ do
+ AC_CHECK_LIB($lib, fzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib"
+ AC_DEFINE([COMP_SRC],[],[])
+ AC_DEFINE([HAVE_ZIO],[],[])])
+ done])
+fi
dnl
dnl to add more decompressors just follow the scheme above.
dnl
--- lib/decompress.c
+++ lib/decompress.c 2007-12-07 18:22:47.940413890 +0100
@@ -46,6 +46,10 @@
# include "zlib.h"
#endif /* HAVE_LIBZ */
+#ifdef HAVE_ZIO
+# include "zio.h"
+#endif /* HAVE_ZIO */
+
#include "manconfig.h"
#include "comp_src.h"
#include "pipeline.h"
@@ -76,6 +80,32 @@ static void decompress_zlib (void *data
#endif /* HAVE_LIBZ */
+#ifdef HAVE_ZIO
+
+static void decompress_zio (void *data)
+{
+ const char *what = (const char*)data;
+ FILE *file;
+
+ file = fdzopen(dup (fileno (stdin)), "r", what);
+ if (!file)
+ return;
+
+ for (;;) {
+ char buffer[4096];
+ int r = fread(buffer, sizeof(char), sizeof(buffer), file);
+ if (r <= 0)
+ break;
+ if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r)
+ break;
+ }
+
+ fclose(file);
+ return;
+}
+
+#endif /* HAVE_ZIO */
+
pipeline *decompress_open (const char *filename)
{
command *cmd;
@@ -87,9 +117,45 @@ pipeline *decompress_open (const char *f
char *ext;
struct compression *comp;
- if (stat (filename, &st) < 0 && !S_ISDIR (st.st_mode))
+ if (stat (filename, &st) < 0 || S_ISDIR (st.st_mode))
return NULL;
+#ifdef HAVE_ZIO
+ ext = strrchr(filename, '.');
+ if (ext && STREQ (ext, ".gz")) {
+ /* informational only; no shell quoting concerns */
+ char *name = strappend (NULL, "zcat < ", filename, NULL);
+ cmd = command_new_function (name, &decompress_zio, "g");
+ free (name);
+ p = pipeline_new_commands (cmd, NULL);
+ goto got_pipeline;
+ }
+ if (ext && STREQ (ext, ".z")) {
+ /* informational only; no shell quoting concerns */
+ char *name = strappend (NULL, "zcat < ", filename, NULL);
+ cmd = command_new_function (name, &decompress_zio, "z");
+ free (name);
+ p = pipeline_new_commands (cmd, NULL);
+ goto got_pipeline;
+ }
+ if (ext && STREQ (ext, ".bz2")) {
+ /* informational only; no shell quoting concerns */
+ char *name = strappend (NULL, "bzcat < ", filename, NULL);
+ cmd = command_new_function (name, &decompress_zio, "b");
+ free (name);
+ p = pipeline_new_commands (cmd, NULL);
+ goto got_pipeline;
+ }
+ if (ext && STREQ (ext, ".Z")) {
+ /* informational only; no shell quoting concerns */
+ char *name = strappend (NULL, "zcat < ", filename, NULL);
+ cmd = command_new_function (name, &decompress_zio, "Z");
+ free (name);
+ p = pipeline_new_commands (cmd, NULL);
+ goto got_pipeline;
+ }
+#endif /* HAVE_ZIO */
+
#ifdef HAVE_LIBZ
filename_len = strlen (filename);
if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) {

File diff suppressed because it is too large Load Diff

3
man-db-2.5.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e6dbb18464fe31cd52fb6287b63829e556a77746b81899c743c327b15ad9e434
size 746743

3
man-db_2.5.0-4.diff.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7eb73655f06e81b910fad7a7c93b0b1ddd84fde0fec3a72c684f9e43bc7e0d9f
size 1230

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Dec 10 17:23:04 CET 2007 - werner@suse.de
- Update to man-db 2.5.0-4
* No temporary files anymore due usage of pipes
* Our libzio patch is simply to add due this new API
* Better UTF-8 support
* Disable straycats for now
- Add sample script mancoding to show how to use encoding tag
-------------------------------------------------------------------
Wed Sep 19 13:39:50 CEST 2007 - werner@suse.de

167
man.spec
View File

@ -1,5 +1,5 @@
#
# spec file for package man (Version 2.4.3)
# spec file for package man (Version 2.5.0)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -17,8 +17,8 @@ BuildRequires: gdbm-devel less libbz2-devel libzio-devel zlib-devel
%else
BuildRequires: libzio util-linux
%endif
Version: 2.4.3
Release: 84
Version: 2.5.0
Release: 1
Summary: A Program for Displaying man Pages
License: GPL v2 or later
Group: System/Base
@ -30,17 +30,19 @@ Source: man-db-%{version}.tar.bz2
Source1: sysconfig.cron-man
Source2: cron.daily.do_mandb
Source3: cron.daily.clean_catman
Source4: mancoding
Patch0: man-db-%{version}.dif
Patch1: man-db-%{version}-6.diff.bz2
Patch1: man-db_%{version}-4.diff.bz2
Patch2: man-db-2.3.19deb4.0-groff.dif
Patch3: man-db-2.4.1-error.dif
Patch4: man-db-%{version}-section.dif
Patch5: man-db-2.4.1-security2.dif
Patch6: man-db-2.4.1-security4.dif
Patch7: man-db-2.4.3-firefox.dif
Patch8: man-db-2.4.3-chinese.dif
Patch9: man-db-2.4.3-globbing.dif
Patch3: man-db-%{version}-error.dif
Patch4: man-db-2.4.3-section.dif
Patch5: man-db-%{version}-security4.dif
Patch6: man-db-2.4.3-firefox.dif
Patch7: man-db-%{version}-chinese.dif
Patch8: man-db-2.4.3-globbing.dif
Patch9: man-db-%{version}-zio.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir /etc
%description
A program for displaying man pages on the screen or sending them to a
@ -58,43 +60,87 @@ Authors:
%patch2 -p0 -b .groff
%patch3 -p0 -b .err
%patch4 -p0 -b .sect
%patch5 -p0 -b .secu2
%patch6 -p0 -b .secu4
%patch7 -p0 -b .firefox
%patch8 -p0 -b .chinese
%patch9 -p0 -b .globbing
%patch5 -p0 -b .secu4
%patch6 -p0 -b .firefox
%patch7 -p0 -b .chinese
%patch8 -p0 -b .globbing
%patch9 -p0 -b .zio
%patch -p0
%build
%{?suse_update_config:%{suse_update_config -f tools }}
gettextize --force --copy --no-changelog
rm -f configure GNUmakefile
echo $RPM_OPT_FLAGS
make -f Makefile.Linux compile MANDIR=%{_mandir} SYSCONFDIR=%{_sysconfdir}
CFLAGS="${RPM_OPT_FLAGS} -funroll-loops -pipe -D_GNU_SOURCE -D_SVID_SOURCE -Wall"
LDFLAGS=
LIBS=
export CFLAGS LDFLAGS LIBS
# aclocal
autoconf
./configure \
--enable-dups \
--enable-setuid=man \
--with-device=utf8 \
--prefix=%{_prefix} \
--mandir=%{_mandir} \
--localstatedir=%{_localstatedir} \
--with-zio \
--with-gnu-ld \
--disable-rpath \
--enable-mb-groff \
--with-db=gdbm \
--enable-nls \
--with-config-file=%{_sysconfdir}/manpath.config \
--without-included-gettext
make nls=all
for man in $(find man/*.UTF-8 -type f); do
pp="$(head -n 1 $man)"
case "$pp" in
\'\\\"*\ -\*-\ coding:\ *\ -\*-)
continue
;;
\'\\\"*)
sed -ri "1{ s/('\\\\\".*)/\\1 -\*- coding: UTF-8 -\*-/ }" $man
;;
*)
sed -ri "1 i\
'\\\\\" -\*- coding: UTF-8 -\*-\
" $man
esac
done
%install
set +o posix
#touch /tmp/bstamp; sleep 3; sync
rm -rf ${RPM_BUILD_ROOT}/var/cache/man
DESTDIR=${RPM_BUILD_ROOT}
export DESTDIR
make -f Makefile.Linux install MANDIR=%{_mandir}
mkdir -p ${RPM_BUILD_ROOT}/usr/share/groff/site-tmac
install -m 0644 groff/tmac.andb ${RPM_BUILD_ROOT}/usr/share/groff/site-tmac/
install -m 0644 groff/tmac.andocdb ${RPM_BUILD_ROOT}/usr/share/groff/site-tmac/
mkdir -p ${RPM_BUILD_ROOT}/var/adm/fillup-templates
mkdir -p ${RPM_BUILD_ROOT}/etc/cron.daily
install -m 0644 %{SOURCE1} ${RPM_BUILD_ROOT}/var/adm/fillup-templates
install -m 0744 %{SOURCE2} ${RPM_BUILD_ROOT}/etc/cron.daily/suse-do_mandb
install -m 0744 %{SOURCE3} ${RPM_BUILD_ROOT}/etc/cron.daily/suse-clean_catman
/usr/sbin/Check
#touch /tmp/estamp; sleep 3; sync
#(
# find / -xdev \( -newer /tmp/bstamp -a \( -not -newer /tmp/estamp \) \) -a \( \
# \( \( \( -not -type d \) -a \( -not -type l \) \) -printf '%%p\n' \) -o \
# \( -type d -printf '%%p/\n' \) -o \( -type l -printf '%%p\n' \) \)
#) > >(sort -u -t / | grep -vE '^(/tmp|/proc|/usr/src/packages)' > /tmp/man.list)
#rm /tmp/estamp /tmp/bstamp
rm -rf %{buildroot}%{_localstatedir}/cache/man
mkdir -p %{buildroot}%{_prefix}/lib/man-db
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}/etc
make nls=all install DESTDIR=%{buildroot}
if test -x %{buildroot}%{_bindir}/wrapper ; then
rm -f %{buildroot}%{_bindir}/mandb
rm -f %{buildroot}%{_bindir}/man
mv %{buildroot}%{_bindir}/wrapper %{buildroot}%{_bindir}/mandb
ln -sf mandb %{buildroot}%{_bindir}/man
fi
mkdir -p %{buildroot}%{_mandir}
pushd %{buildroot}%{_mandir}/
rm -rf *.ascii/
for d in *.UTF-8 ; do
find -name '*.[1-9nlop]' | xargs gzip -9f
done
for d in `find -name manpath.5.gz -printf '%%h '` ; do
ln -sf manpath.5.gz $d/manpath.config.5.gz
done
popd
install -m 644 src/man_db.conf %{buildroot}%{_sysconfdir}/manpath.config
sh ./mk_catdirs %{buildroot}
mkdir -p %{buildroot}%{_datadir}/groff/site-tmac
install -m 0644 groff/tmac.andb %{buildroot}%{_datadir}/groff/site-tmac/
install -m 0644 groff/tmac.andocdb %{buildroot}%{_datadir}/groff/site-tmac/
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
mkdir -p %{buildroot}/etc/cron.daily
install -m 0644 %{SOURCE1} %{buildroot}%{_localstatedir}/adm/fillup-templates
install -m 0744 %{SOURCE2} %{buildroot}/etc/cron.daily/suse-do_mandb
install -m 0744 %{SOURCE3} %{buildroot}/etc/cron.daily/suse-clean_catman
%find_lang man-db
%pre
@ -108,20 +154,21 @@ test -d var/catman/ && rm -rf var/catman/ || true
%config /etc/manpath.config
%attr(0744,root,root) /etc/cron.daily/suse-clean_catman
%attr(0744,root,root) /etc/cron.daily/suse-do_mandb
/usr/bin/apropos
/usr/bin/catman
/usr/bin/lexgrog
%attr(4755,root,root) /usr/bin/man
%attr(4755,root,root) /usr/bin/mandb
/usr/bin/manpath
/usr/bin/whatis
/usr/bin/zsoelim
%dir %attr(0711,root,root) /usr/lib/man-db
%attr(0711,root,root) /usr/lib/man-db/man
%attr(0711,root,root) /usr/lib/man-db/mandb
/usr/sbin/accessdb
/usr/share/groff/site-tmac/tmac.andb
/usr/share/groff/site-tmac/tmac.andocdb
%{_bindir}/apropos
%{_bindir}/catman
%{_bindir}/lexgrog
%attr(4755,root,root) %{_bindir}/man
%attr(4755,root,root) %{_bindir}/mandb
%{_bindir}/manpath
%{_bindir}/whatis
%{_bindir}/zsoelim
%dir %attr(0711,root,root) %{_prefix}/lib/man-db
%attr(0711,root,root) %{_prefix}/lib/man-db/man
%attr(0711,root,root) %{_prefix}/lib/man-db/mandb
%attr(0755,man,man) %{_prefix}/lib/man-db/manconv
%{_sbindir}/accessdb
%{_datadir}/groff/site-tmac/tmac.andb
%{_datadir}/groff/site-tmac/tmac.andocdb
%dir %{_mandir}/de
%dir %{_mandir}/de/man1
%doc %{_mandir}/de/man1/*.1.gz
@ -161,9 +208,17 @@ test -d var/catman/ && rm -rf var/catman/ || true
%doc %{_mandir}/man5/*.5.gz
%doc %{_mandir}/man8/*.8.gz
%defattr(-,man,daemon)
/var/cache/man/*
/var/adm/fillup-templates/sysconfig.cron-man
%{_localstatedir}/cache/man/*
%{_localstatedir}/adm/fillup-templates/sysconfig.cron-man
%changelog
* Mon Dec 10 2007 - werner@suse.de
- Update to man-db 2.5.0-4
* No temporary files anymore due usage of pipes
* Our libzio patch is simply to add due this new API
* Better UTF-8 support
* Disable straycats for now
- Add sample script mancoding to show how to use encoding tag
* Wed Sep 19 2007 - werner@suse.de
- Be sure that e.g. /usr/share/man/man3p/open.3p.gz is found before
/usr/share/man/man3/open.3pm.gz by "man 3p open" (bug #310498)

54
mancoding Normal file
View File

@ -0,0 +1,54 @@
#!/bin/bash
#
# Copyright (c) 2007 Werner Fink
# Copyright (c) 2007 SuSE Linux Products GmbH, Nuernberg, Germany.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at
# your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# For a copy see <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>
#
# Author: Werner Fink <werner@suse.de>
docode=yes
if test "$1" = "-e" ; then
shift
encode=$1
docode=no
shift
fi
for man; do
pp="$(head -n 1 $man)"
case "$pp" in
\'\\\"*\ -\*-\ coding:\ *\ -\*-)
continue
esac
if test "$docode" = "yes" ; then
encode=$(sed -r "s/^(\.[[:alpha:]]{1,2}|\.\\\\\".*|'\\\\\".*)//;s/\\f[[:alpha:]]//;s/\\\\\".*//" $man | file -b -)
encode=${encode%% *}
fi
case "$encode" in
ISO-8859)
echo "${0##*/}: The encoding $encode does not include the Latin Alphabet Number" 1>&2
echo "${0##*/}: use option -e to specify" 1>&2
echo " ${0##*/} -e ISO-8859-<number> $man" 1>&2
exit 1
esac
case "$pp" in
\'\\\"*)
sed -ri "1{s/('\\\\\".*)/\\1 -\*- coding: UTF-8 -\*-/}" $man
;;
*)
sed -ri "1 i\
'\\\\\" -\*- coding: UTF-8 -\*-\
" $man
esac
done