File: 9001-Fit-Makefile-to-Debian-packageing.patch

package info (click to toggle)
cmigemo 1%3A1.2%2Bgh0.20220623-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,700 kB
  • sloc: ansic: 2,617; cs: 188; makefile: 173; sh: 107; cpp: 67; perl: 59; csh: 49; javascript: 20
file content (159 lines) | stat: -rw-r--r-- 4,818 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Thu, 1 Mar 2012 00:52:22 +0900
Subject: Fit Makefile to Debian packageing

Forwarded: not-needed
---
 Makefile             | 10 ++++++----
 compile/Make_gcc.mak | 12 +++++++++---
 compile/config.mk.in |  6 +++---
 compile/unix.mak     | 16 ++++++++++++----
 configure            | 13 -------------
 5 files changed, 30 insertions(+), 27 deletions(-)

--- a/Makefile
+++ b/Makefile
@@ -4,10 +4,12 @@
 #
 # Maintainer:	MURAOKA Taro <koron.kaoriya@gmail.com>
 
-default: tags
-
-tags: src/*.c src/*.h
-	ctags src/*.c src/*.h
+default: gcc-rel
+install:
+	$(MAKE) -f compile/Make_gcc.mak install
+uninstall: gcc-uninstall
+clean: gcc-clean
+distclean: gcc-distclean
 
 ##############################################################################
 # for Borland C 5
--- a/compile/Make_gcc.mak
+++ b/compile/Make_gcc.mak
@@ -11,10 +11,11 @@
 #
 libmigemo_LIB	= libmigemo.so.1.1.0
 libmigemo_DSO	= libmigemo.so.1
+libmigemo_STL	= libmigemo.a
 libmigemo	= libmigemo.so
 EXEEXT		=
 CFLAGS_MIGEMO	= -fPIC
-LDFLAGS_MIGEMO	= -Wl,-rpath,.,-rpath,/usr/local/lib,-rpath,/usr/lib
+LDFLAGS_MIGEMO	=
 
 include config.mk
 include compile/unix.mak
@@ -25,15 +26,20 @@
 ##############################################################################
 # ‹ɉăCu\z@ύX
 #
-$(libmigemo_LIB): $(libmigemo_DSO)
+$(libmigemo_LIB): $(libmigemo_STL) $(libmigemo_DSO)
+$(libmigemo_STL): $(libmigemo_OBJ)
+	$(AR) vru $@ $(libmigemo_OBJ)
+	ranlib $@
 $(libmigemo_DSO): $(libmigemo_OBJ)
-	$(CC) -shared -o $(libmigemo_LIB) -Wl,-soname,$@ $(libmigemo_OBJ)
+	$(CC) -shared -o $(libmigemo_LIB) \
+	  -Wl,-soname,$@ $(libmigemo_OBJ) $(LDFLAGS)
 	$(RM) $@ $(libmigemo)
 	ln -s $(libmigemo_LIB) $@
 	ln -s $(libmigemo_LIB) $(libmigemo)
 
 install-lib: $(libmigemo_DSO)
 	$(INSTALL_PROGRAM) $(libmigemo_LIB) $(libdir)
+	$(INSTALL_PROGRAM) $(libmigemo_STL) $(libdir)
 	$(RM) $(libdir)/$(libmigemo_DSO) $(libdir)/$(libmigemo)
 	ln -s $(libmigemo_LIB) $(libdir)/$(libmigemo_DSO)
 	ln -s $(libmigemo_LIB) $(libdir)/$(libmigemo)
--- a/compile/config.mk.in
+++ b/compile/config.mk.in
@@ -14,12 +14,12 @@
 #
 prefix		= ${PATH_PREFIX}
 bindir		= $(prefix)/bin
-libdir		= $(prefix)/lib
+libdir		= $(prefix)/lib/$(DEB_HOST_MULTIARCH)
 incdir		= $(prefix)/include
 # WARNING: Directories $(dictdir) and $(docdir) will be deleted whole the
 # directory when unintall.
-dictdir		= $(prefix)/share/migemo
-docdir		= $(prefix)/doc/migemo
+dictdir		= $(prefix)/share/cmigemo
+docdir		= $(prefix)/share/doc/cmigemo
 
 ##############################################################################
 # Commands
--- a/compile/unix.mak
+++ b/compile/unix.mak
@@ -10,9 +10,10 @@
 libmigemo_OBJ = $(OBJ)
 
 DEFINES	=
-CFLAGS	= -O2 -Wall $(DEFINES) $(CFLAGS_MIGEMO)
-LDFLAGS = $(LDFLAGS_MIGEMO)
-LIBS	= 
+CFLAGS	= $(shell dpkg-buildflags --get CFLAGS) $(DEFINES) $(CFLAGS_MIGEMO)
+CFLAGS  += $(shell dpkg-buildflags --get CPPFLAGS) 
+LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) $(LDFLAGS_MIGEMO)
+LIBS	=
 
 default: $(outdir)cmigemo$(EXEEXT)
 
@@ -44,6 +45,7 @@
 	$(MKDIR) $(dictdir)/cp932
 	$(MKDIR) $(dictdir)/euc-jp
 	$(MKDIR) $(dictdir)/utf-8
+	$(MKDIR) $(dictdir)/tools
 
 install-dict: install-mkdir
 	$(INSTALL_DATA) dict/migemo-dict $(dictdir)/cp932
@@ -69,10 +71,16 @@
 # depends on $(libdir) to be already present
 install-lib: install-mkdir
 
-install: $(outdir)cmigemo$(EXEEXT) $(libmigemo_DSO) install-mkdir install-dict install-lib
+install: $(outdir)cmigemo$(EXEEXT) $(libmigemo_DSO) install-mkdir install-lib
 	$(INSTALL_DATA) $(srcdir)migemo.h $(incdir)
 	$(INSTALL_DATA) doc/README_j.txt $(docdir)
+	$(INSTALL_DATA) dict/han2zen.dat $(dictdir)/cp932
+	$(INSTALL_DATA) dict/hira2kata.dat $(dictdir)/cp932
+	$(INSTALL_DATA) dict/roma2hira.dat $(dictdir)/cp932
+	$(INSTALL_DATA) dict/zen2han.dat $(dictdir)/cp932
 	$(INSTALL_PROGRAM) $(outdir)cmigemo$(EXEEXT) $(bindir)
+	$(INSTALL_PROGRAM) tools/optimize-dict.pl $(dictdir)/tools
+	$(INSTALL_PROGRAM) tools/skk2migemo.pl $(dictdir)/tools
 
 ##############################################################################
 # Uninstall
--- a/configure
+++ b/configure
@@ -28,18 +28,6 @@
   esac
 done
 
-# Check HTTP access tool
-if CHECK_COMMAND curl ; then
-  PROGRAM_HTTP="curl -O"
-elif CHECK_COMMAND wget ; then
-  PROGRAM_HTTP="wget"
-elif CHECK_COMMAND fetch ; then
-  PROGRAM_HTTP="fetch"
-else
-  echo "ERROR: Require one of HTTP access tools (curl, wget or fetch)."
-  exit 1
-fi
-
 # Check encoding filter
 if CHECK_COMMAND qkc ; then
   PROGRAM_ENCODEFILTER="qkc -q -u"
@@ -64,7 +52,6 @@
 # for Debug
 if test 0 != 0 ; then
   echo "PATH_PREFIX=${PATH_PREFIX}" 1>&2
-  echo "PROGRAM_HTTP=${PROGRAM_HTTP}" 1>&2
   echo "PROGRAM_ENCODEFILTER=${PROGRAM_ENCODEFILTER}" 1>&2
   echo "PROGRAM_INSTALL=${PROGRAM_INSTALL}" 1>&2
 fi