Browse Source

update: dbusmenu, file

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@2679 ec354946-7b23-47d6-9f5a-488ba84defc7
inagaki 13 years ago
parent
commit
6d1f90b98b

+ 10 - 7
d/dbusmenu-qt/dbusmenu-qt-vl.spec

@@ -1,7 +1,8 @@
 Name: dbusmenu-qt
 Summary: A Qt implementation of the DBusMenu protocol 
-Version: 0.5.2
-Release: 3%{?_dist_release}
+Summary(ja): Qt で実装された DBusMenu プロトコル 
+Version: 0.6.3
+Release: 1%{?_dist_release}
 
 Group: System Environment/Libraries
 License: LGPLv2+
@@ -10,8 +11,8 @@ URL: https://launchpad.net/libdbusmenu-qt/
 Source0: http://launchpad.net/libdbusmenu-qt/trunk/%{version}/+download/libdbusmenu-qt-%{version}.tar.bz2
 
 ## upstream patches
-# honor LIB_SUFFIX (ie, use /usr/lib64 on 64bit)
-Patch100: dbusmenu-qt-0.3.2-pkgconfig.patch
+## upstream patches
+Patch100: http://bazaar.launchpad.net/~kubuntu-members/libdbusmenu-qt/ubuntu/download/head:/kubuntu_00_external_-20100920140604-m34bhlve690rhcmm-1/kubuntu_00_external_contributions.diff
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: cmake
@@ -41,8 +42,7 @@ Provides: libdbusmenu-devel = %{version}-%{release}
 %prep
 %setup -q -n libdbusmenu-qt-%{version}
 
-%patch100 -p1 -b .pkgconfig
-
+%patch100 -p1 -b .external_contributions
 
 %build
 mkdir -p %{_target_platform}
@@ -86,8 +86,11 @@ rm -rf %{buildroot}
 %{_libdir}/libdbusmenu-qt.so
 %{_libdir}/pkgconfig/dbusmenu-qt.pc
 
-
 %changelog
+* Sat Feb 12 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.6.3-1
+- new upstream release
+- added Patch100
+
 * Sun Sep 26 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.5.2-3
 - rebuilt with rpm-4.8.1 for pkg-config
 

+ 302 - 0
f/file/file-5.05-jtext.patch

@@ -0,0 +1,302 @@
+--- file-5.05/src/Makefile.am.vinejtext	2010-07-22 00:56:10.000000000 +0900
++++ file-5.05/src/Makefile.am	2011-02-11 16:53:06.000000000 +0900
+@@ -4,11 +4,11 @@
+ 
+ bin_PROGRAMS = file
+ 
+-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
++AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' -DDETECT_JAPANESE
+ AM_CFLAGS = @WARNINGS@
+ 
+ libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
+-	encoding.c compress.c is_tar.c readelf.c print.c fsmagic.c \
++	encoding.c compress.c is_tar.c readelf.c print.c jcode.c fsmagic.c \
+ 	funcs.c file.h names.h patchlevel.h readelf.h tar.h apptype.c \
+ 	file_opts.h elfclass.h mygetopt.h cdf.c cdf_time.c readcdf.c cdf.h
+ libmagic_la_LDFLAGS = -no-undefined -version-info 1:0:0
+--- file-5.05/src/encoding.c.vinejtext	2010-07-22 01:47:17.000000000 +0900
++++ file-5.05/src/encoding.c	2011-02-11 17:26:00.000000000 +0900
+@@ -42,7 +42,7 @@ FILE_RCSID("@(#)$File: encoding.c,v 1.5 
+ #include <string.h>
+ #include <memory.h>
+ #include <stdlib.h>
+-
++#include "jcode.h"
+ 
+ private int looks_ascii(const unsigned char *, size_t, unichar *, size_t *);
+ private int looks_utf8_with_BOM(const unsigned char *, size_t, unichar *,
+@@ -68,7 +68,7 @@ protected int
+ file_encoding(struct magic_set *ms, const unsigned char *buf, size_t nbytes, unichar **ubuf, size_t *ulen, const char **code, const char **code_mime, const char **type)
+ {
+ 	size_t mlen;
+-	int rv = 1, ucs_type;
++	int rv = 1, ucs_type, jcode;
+ 	unsigned char *nbuf = NULL;
+ 
+ 	mlen = (nbytes + 1) * sizeof(nbuf[0]);
+@@ -83,10 +83,27 @@ file_encoding(struct magic_set *ms, cons
+ 	}
+ 
+ 	*type = "text";
+-	if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
++	jcode = detect_kcode(buf, nbytes, *ubuf, ulen);
++	if (jcode == ASCII) {
+ 		DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
+ 		*code = "ASCII";
+ 		*code_mime = "us-ascii";
++	} else if (jcode == JIS) {
++		DPRINTF(("jis %" SIZE_T_FORMAT "u\n", *ulen));
++		code = "7-bit JIS [ESC$B, ESC(B]";
++		code_mime = "jis";
++	} else if (jcode == SJIS){
++		DPRINTF(("sjis %" SIZE_T_FORMAT "u\n", *ulen));
++	        code = "SJIS";
++		code_mime = "sjis";
++	} else if (jcode == EUC){
++		DPRINTF(("euc %" SIZE_T_FORMAT "u\n", *ulen));
++		code = "EUC";
++		code_mime = "euc-jp";
++	} else if (jcode == EUCORSJIS){
++		DPRINTF(("euc or sjis %" SIZE_T_FORMAT "u\n", *ulen));
++		code = "EUC or SJIS";
++		code_mime = "unknown";
+ 	} else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
+ 		DPRINTF(("utf8/bom %" SIZE_T_FORMAT "u\n", *ulen));
+ 		*code = "UTF-8 Unicode (with BOM)";
+--- /dev/null	2011-02-06 21:11:58.373999997 +0900
++++ file-5.05/src/jcode.c	2011-02-11 17:14:29.000000000 +0900
+@@ -0,0 +1,205 @@
++/*
++jcode.c: Kanji-code detect routing by Jun Nishii <jun@vinelinux.org>
++                          modified by Ryoichi INAGAKI <inagaki@vinelinux.org>
++ */
++#include <stdio.h>
++#include <unistd.h>
++#include <signal.h>
++#include <sys/types.h>
++#include <sys/wait.h>
++#include <jcode.h>
++
++typedef unsigned long unichar;
++
++#define F 0   /* character never appears in text */
++#define T 1   /* character appears in plain ASCII text */
++#define I 2   /* character appears in ISO-8859 text */
++#define X 3   /* character appears in non-ISO extended ASCII (Mac, IBM PC) */
++#define J 4   /* character appears in JIS or plain ASCII */
++#define S 5   /* character appears in SJIS */
++#define E 6   /* character appears in EUC */
++#define O 7   /* character appears in EUC or SJIS */
++
++#define ESC           27
++
++static char jp_chars1[256] = {
++        F, F, F, F, F, F, F, T, T, T, T, F, T, T, F, F,  /* 0x0X */
++        F, F, F, F, F, F, F, F, F, F, F, T, F, F, F, F,  /* 0x1X */
++        T, J, J, J, J, J, J, J, J, J, J, J, J, J, J, J,  /* 0x2X */
++        J, J, J, J, J, J, J, J, J, J, J, J, J, J, J, J,  /* 0x3X */
++        J, J, J, J, J, J, J, J, J, J, J, J, J, J, J, J,  /* 0x4X */
++        J, J, J, J, J, J, J, J, J, J, J, J, J, J, J, J,  /* 0x5X */
++        J, J, J, J, J, J, J, J, J, J, J, J, J, J, J, J,  /* 0x6X */
++        J, J, J, J, J, J, J, J, J, J, J, J, J, J, J, F,  /* 0x7X */
++        /*            NEL                            */
++        X, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,  /* 0x8X */
++        S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,  /* 0x9X */
++        I, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E,  /* 0xaX */
++        E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E,  /* 0xbX */
++        E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E,  /* 0xcX */
++        E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E,  /* 0xdX */
++        O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,  /* 0xeX */
++        E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, I   /* 0xfX */
++};
++
++static char jp_chars2[256] = {
++        /*                  BEL BS HT LF    FF CR    */
++        F, F, F, F, F, F, F, T, T, T, T, F, T, T, F, F,  /* 0x0X */
++        /*                              ESC          */
++        F, F, F, F, F, F, F, F, F, F, F, T, F, F, F, F,  /* 0x1X */
++        T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T,  /* 0x2X */
++        T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T,  /* 0x3X */
++        S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,  /* 0x4X */
++        S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,  /* 0x5X */
++        S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,  /* 0x6X */
++        S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, F,  /* 0x7X */
++        /*            NEL                            */
++        S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,  /* 0x8X */
++        S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,  /* 0x9X */
++        S, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,  /* 0xaX */
++        O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,  /* 0xbX */
++        O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,  /* 0xcX */
++        O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,  /* 0xdX */
++        O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,  /* 0xeX */
++        O, O, O, O, O, O, O, O, O, O, O, O, O, E, E, I   /* 0xfX */
++};
++
++
++int
++check_asc_jis(buf, nbytes, ubuf, ulen)
++	const unsigned char *buf;
++	size_t nbytes;
++	unichar *ubuf;
++	size_t *ulen;
++{
++	size_t i;
++	int jflag;
++
++	*ulen = 0; jflag=0;
++
++	for (i = 0; i < nbytes; i++) {
++		int t = jp_chars1[buf[i]];
++
++		if (t != T && t != J )
++			return 0;
++
++		if (buf[i] == ESC && i+2<nbytes) {
++		  if ((buf[i+1]=='$' && buf[i+2]=='B')||
++		      (buf[i+1]=='$' && buf[i+2]=='@')) jflag=1;
++		}
++
++		ubuf[(*ulen)++] = buf[i];
++	}
++
++	if (jflag==1) return JIS;
++	else return ASCII;
++}
++
++int
++check_sjis(buf, nbytes, ubuf, ulen)
++	const unsigned char *buf;
++	size_t nbytes;
++	unichar *ubuf;
++	size_t *ulen;
++{
++	size_t i;
++	int jflag;
++
++	*ulen = 0;
++	jflag = ASCII;
++	for (i = 0; i < nbytes; i++) {
++		int t = jp_chars1[buf[i]];
++
++		if (t != T && t != J && t != S && t!= O)
++			return 0;
++
++		if (t == S && i<nbytes-1){
++		  ubuf[(*ulen)++] = buf[i];
++		  ++i;
++		  t=jp_chars2[buf[i]];
++		  if(t != S && t != O ) return 0;
++		  jflag=SJIS;
++		} else if (t == O && i<nbytes-1){
++		  ubuf[(*ulen)++] = buf[i];
++		  ++i;
++		  t=jp_chars2[buf[i]];
++		  if( t == S ){ jflag=SJIS; }
++		  else if( t == O ){ if(jflag==ASCII) jflag=EUCORSJIS; }
++		  else return 0;
++		}
++
++		ubuf[(*ulen)++] = buf[i];
++	}
++#ifdef Z
++	if (jflag==SJIS) {ckfputs("SJIS text", stdout); return SJIS;}
++	if (jflag==EUCORSJIS) {ckfputs("EUCorSJIS", stdout); return EUCORSJIS;}
++#else
++	if (jflag==SJIS) {return SJIS;}
++	if (jflag==EUCORSJIS) {return EUCORSJIS;}
++#endif
++}
++
++int
++check_euc(buf, nbytes, ubuf, ulen)
++	const unsigned char *buf;
++	size_t nbytes;
++	unichar *ubuf;
++	size_t *ulen;
++{
++	size_t i;
++	int jflag;
++
++	*ulen = 0;
++	jflag = ASCII;
++
++	for (i = 0; i < nbytes; i++) {
++		int t = jp_chars1[buf[i]];
++
++		if (t != T && t != J && t != E && t!= O)
++			return 0;
++
++		if (t == E && i<nbytes-1){
++		  ubuf[(*ulen)++] = buf[i];
++		  ++i;
++		  t= jp_chars2[buf[i]];
++		  if( t != E && t != O) return 0;
++		  jflag=EUC;
++		} else if (t == O && i<nbytes-1){
++		  ubuf[(*ulen)++] = buf[i];
++		  ++i;
++		  t=jp_chars2[buf[i]];
++		  if( t == E ){ jflag=EUC; }
++		  else if( t == O ){ if(jflag==ASCII) jflag=EUCORSJIS; }
++		  else return 0;
++		}
++
++		ubuf[(*ulen)++] = buf[i];
++	}
++#ifdef Z
++	if (jflag==EUC) {ckfputs("EUC text", stdout); return EUC;}
++	if (jflag==EUCORSJIS) {ckfputs("EUCorSJIS", stdout); return EUCORSJIS;}
++#else
++	if (jflag==EUC) { return EUC;}
++	if (jflag==EUCORSJIS) {return EUCORSJIS;}
++#endif
++}
++
++int
++detect_kcode(buf, nbytes, ubuf, ulen)
++	const unsigned char *buf;
++	size_t nbytes;
++	unichar *ubuf;
++	size_t *ulen;
++{
++  int ret;
++  ret=check_asc_jis(buf, nbytes, ubuf, ulen);
++  if(ret==ASCII) return ASCII;
++  if(ret==JIS) return JIS;
++
++  ret=check_sjis(buf, nbytes, ubuf, ulen);
++  if(ret==SJIS) return SJIS;
++  if(ret==EUCORSJIS) return EUCORSJIS;
++  ret=check_euc(buf, nbytes, ubuf, ulen);
++  if(ret==EUC) return EUC;
++  if(ret==EUCORSJIS) return EUCORSJIS;
++}
+--- /dev/null	2011-02-06 21:11:58.373999997 +0900
++++ file-5.05/src/jcode.h	2011-02-11 17:12:11.000000000 +0900
+@@ -0,0 +1,15 @@
++/*
++ jcode.h - for jcode.c by Jun Nishii <jun@vinelinux.org>
++              modified by Ryoichi INAGAKI <inagaki@vinelinux.org>
++ */
++
++#define ASCII         1
++#define JIS           2
++#define EUC           3
++#define SJIS          4
++#define EUCORSJIS     5
++
++extern int detect_kcode (const unsigned char *, size_t, unichar *, size_t *);
++extern int looks_jis (const unsigned char *, size_t, unichar *, size_t *);
++extern int looks_sjis (const unsigned char *, size_t, unichar *, size_t *);
++extern int looks_euc (const unsigned char *, size_t, unichar *, size_t *);
+--- file-5.05/src/names.h.vinejtext	2010-10-09 06:58:44.000000000 +0900
++++ file-5.05/src/names.h	2011-02-11 17:28:18.000000000 +0900
+@@ -135,8 +135,6 @@
+ 	{"/*",		L_C, 2 },	/* must precede "The", "the", etc. */
+ 	{"#include",	L_C, 2 },
+ 	{"char",	L_C, 2 },
+-	{"The",		L_ENG, 2 },
+-	{"the",		L_ENG, 2 },
+ 	{"double",	L_C, 1 },
+ 	{"extern",	L_C, 2 },
+ 	{"float",	L_C, 1 },

+ 29 - 0
f/file/file-5.05-vinenames.patch

@@ -0,0 +1,29 @@
+--- file-5.05/src/names.h.vinenames	2010-10-09 06:58:44.000000000 +0900
++++ file-5.05/src/names.h	2011-02-11 17:50:30.000000000 +0900
+@@ -55,6 +55,7 @@
+ #define	L_BCPL	11		/* BCPL */
+ #define	L_M4	12		/* M4 */
+ #define	L_PO	13		/* PO */
++#define	L_SPEC	14		/* Spec */
+ 
+ static const struct {
+ 	char human[48];
+@@ -74,6 +75,7 @@
+ 	{ "BCPL program",				"text/x-bcpl" },
+ 	{ "M4 macro language pre-processor",		"text/x-m4" },
+ 	{ "PO (gettext message catalogue)",             "text/x-po" },
++	{ "spec file",					"text/x-spec" },
+ 	{ "cannot happen error on names.h/types",	"error/x-error" }
+ };
+ 
+@@ -121,6 +123,10 @@
+ } names[] = {
+ 	/* These must be sorted by eye for optimal hit rate */
+ 	/* Add to this list only after substantial meditation */
++  	{"Buildroot:",	L_SPEC, 2 },
++	{"BuildRoot:",	L_SPEC, 2 },
++	{"%prep:",	L_SPEC, 2 },
++	{"%setup:",	L_SPEC, 2 },
+ 	{"msgid",	L_PO, 1 },
+ 	{"dnl",		L_M4, 2 },
+ 	{"import",	L_JAVA, 2 },

+ 137 - 73
f/file/file-vl.spec

@@ -1,39 +1,33 @@
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 %define __libtoolize :
+
 Summary: A utility for determining file types.
 Summary(ja): ファイルの種類を判別するユーティリティー
 Name: file
-Version: 4.21
-Release: 3%{?_dist_release}
-License: Distributable
+Version: 5.05
+Release: 1%{?_dist_release}
+
+License: BSD
 Group: Applications/System
-URL:	http://www.darwinsys.com/file/
-
-Source: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
-Source1: magic.mime
-# Source for Vine
-Source6: printer-j.magic2
-
-Patch1: file-4.19-debian.patch
-Patch3: file-4.21-magic.patch
-Patch5: file-4.13-fsdump.patch
-Patch6: file-4.13-quick.patch
-Patch8: file-4.15-berkeley.patch
-Patch12: file-4.16-xen.patch
-Patch16: file-4.21-oracle.patch
-Patch17: file-4.17-clamav.patch
-Patch20: file-4.17-bash.patch
-Patch21: file-4.19-ELF.patch
-Patch22: file-4.19-ooffice.patch
-patch23: file-4.21-core_from.patch
-patch24: file-4.21-msoffice.patch
+
+Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
+
+# Addtional magic file for Vine
+Source10: magic.printer-j
+
+Patch1: file-5.04-zip64.patch
+Patch2: file-5.05-python-magic.patch
+Patch3: file-5.05-images-magic.patch
 
 # Vine patch
-Patch100: file-4.21-jtext.patch
-Patch110: file-4.21-vinemagic.patch
-Patch120: file-4.09-vinenames.patch
+Patch100: file-5.05-jtext.patch
+Patch120: file-5.05-vinenames.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-root
-BuildRequires: automake, autoconf, zlib-devel
+#BuildRequires: automake
+#BuildRequires: autoconf
+BuildRequires: zlib-devel
 
 Vendor: Project Vine
 Distribution: Vine Linux
@@ -48,70 +42,122 @@ You should install the file package, since the file command is such a
 useful utility.
 
 %description -l ja
-ファイルコマンドは、ファイルに含まれるデータの種類によって各ファイルが
+file コマンドは、ファイルに含まれるデータの種類によって各ファイルが
 どのようなファイルかを判定するために使います。file は ELF バイナリ、シ
 ステムライブラリ、RPM パッケージ、そして様々なグラフィックフォーマット
 を含む、多くの異なるファイルの種類を見分けることができます。
 
-file コマンドは大変役に立つユーティリティーなので、必ずインストールして
-ください。
+
+%package devel
+Summary:  Libraries and header files for file development
+Summary(ja): libmagic の開発用ファイル
+Group:    Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+The file-devel package contains the header files and libmagic library
+necessary for developing programs using libmagic.
+
+%package static
+Summary: Static library for file development
+Summary(ja): libmagic のスタティックライブラリ
+Group:    Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description static
+The file-static package contains the static version of
+the libmagic library.
+
+%package -n python-magic
+Summary: Python bindings for the libmagic API
+Group:   Development/Libraries
+BuildRequires: python-devel
+Requires: %{name} = %{version}-%{release}
+
+%description -n python-magic
+This package contains the Python bindings to allow access to the
+libmagic API. The libmagic library is also used by the familiar
+file(1) command.
+
 
 %prep
 %setup -q
 
-%patch1 -p1 -b .debian
-%patch3 -p1 -b .magic
-%patch5 -p1 -b .fsdump
-%patch6 -p1 -b .quick
-%patch8 -p1 -b .berkeley
-%patch12 -p1 -b .xen
-%patch16 -p1 -b .oracle
-%patch17 -p1 -b .clamav
-%patch20 -p1 -b .bash
-%patch21 -p1 -b .ELF
-%patch22 -p1 -b .ooffice
-%patch23 -p1 -b .core_from
-%patch24 -p1 -b .msoffice
-
-%patch100 -p1 -b .vinejtext
-%patch110 -p1 -b .vinemagic
+#fixes #637785
+%patch1 -p1
+#keeps compatibility with older python-magic versions
+%patch2 -p1
+%patch3 -p1 
+
+# Patch100 working now
+#patch100 -p1 -b .vinejtext
 %patch120 -p1 -b .vinenames
 
-cp -p %{SOURCE6} ./magic/Magdir/printer-j
+cat %{SOURCE10} >> ./magic/Localstuff
+
+iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
+touch -r doc/libmagic.man doc/libmagic.man_
+mv doc/libmagic.man_ doc/libmagic.man
 
 %build
-autoreconf
+#autoreconf
 CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \
-%configure --enable-fsect-man5
-make LIBTOOL=/usr/bin/libtool
+%configure --enable-fsect-man5 --disable-rpath
+# remove hardcoded library paths from local libtool
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+export LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{name}-%{version}/src/.libs
+make
+
+cd python
+CFLAGS="%{optflags}" %{__python} setup.py build
 
 %install
-rm -rf ${RPM_BUILD_ROOT}
-mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
-mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
-mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5
-mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/misc
-
-make install DESTDIR=$RPM_BUILD_ROOT LIBTOOL=/usr/bin/libtool
-ln -s file/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
-ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
-
-ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/misc/magic 
-
-{ cd ${RPM_BUILD_ROOT}
-  strip .%{_bindir}/file
-  cp %SOURCE1 .%{_datadir}/magic.mime
-}
-## remove unuse files
-rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man5
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/misc
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/file
 
+make install DESTDIR=$RPM_BUILD_ROOT
+
+cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
+ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
+##ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
+ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
+
+cd python
+%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
+%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
+
+
+# LIBTOOL=/usr/bin/libtool
+#ln -s file/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
+#ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
+
+#ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/misc/magic 
+
+#{ cd ${RPM_BUILD_ROOT}
+#  strip .%{_bindir}/file
+#  cp %SOURCE1 .%{_datadir}/magic.mime
+#}
+
+# remove unuse files
+rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
 
 %clean
-rm -rf ${RPM_BUILD_ROOT}
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
 
 %files
 %defattr(-,root,root)
-%doc LEGAL.NOTICE README
+%doc COPYING ChangeLog README
 %{_bindir}/*
 %{_libdir}/libmagic.so.*
 %{_datadir}/file/*
@@ -119,15 +165,33 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_datadir}/misc/*
 %{_mandir}/man[15]/*
 
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/*.so
 %{_includedir}/magic.h
-%{_libdir}/libmagic.a
-%{_libdir}/libmagic.so
 %{_mandir}/man3/*
 
+%files static
+%defattr(-,root,root,-)
+%{_libdir}/*.a
+
+%files -n python-magic
+%defattr(-, root, root, -)
+%doc python/README COPYING python/example.py
+%{python_sitelib}/magic.py
+%{python_sitelib}/magic.pyc
+%{python_sitelib}/magic.pyo
+%{python_sitelib}/*egg-info
+
 
 %changelog
+* Sat Feb 12 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.05-1
+- new upstream release
+- updated Vine patches (but Patch100 has not been ported yet...)
+- split to devel and static subpackcages
+
 * Mon Sep 27 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.21-3
-- rebuils with rpm-4.8.1
+- rebuilt with rpm-4.8.1
 - add environment variable LIBTOOL for make command
 
 * Fri Sep 26 2008 Shu KONNO <owa@bg.wakwak.com> 4.21-2

+ 17 - 0
f/file/magic.printer-j

@@ -0,0 +1,17 @@
+
+#------------------------------------------------------------------------------
+# printer-j:  file(1) magic for japanese printer-formatted files
+#
+
+# Canon LIPS printer Data
+0       string         \033%@          Canon LIPS printer data
+
+# EPSON Printer Job Language (aka EPSON Remote Mode) Data
+0	string		\033\001@EJL	EPSON Remote Mode printer data
+
+# NEC NPDL printer Data
+0       string          \033c1\034d240.  NEC NPDL printer data
+
+# NEC NPDL2 printer Data
+0       string          \033c1\034&400.  NEC NPDL2 printer data
+