source: pkg/raul/main/cups/trunk/debian/local/filters/pdf-filters/addtocups @ 7142

Revision 7142, 4.9 KB checked in by alanbach-guest, 3 years ago (diff)
  • Sync'd with Debian 1.4.5-2
Line 
1#!/bin/bash
2
3# Silently exit if the changes are already applied
4[ -f $1/filter/imagetopdf.c ] && exit 0
5
6# Copy files
7cp filter/imagetopdf.c $1/filter/
8cp filter/pdftoijs.cxx $1/filter/
9cp filter/texttopdf.c $1/filter/
10cp filter/pdfutils.h $1/filter/
11cp filter/pdfutils.c $1/filter/
12cp filter/test_pdf1.c $1/filter/
13cp filter/test_pdf2.c $1/filter/
14cp conf/imagetopdf.convs $1/conf/
15cp conf/imagetopdf.types $1/conf/
16cp conf/pdftopdf.convs $1/conf/
17cp conf/pdf.types $1/conf/
18cp conf/texttopdf.convs $1/conf/
19cp data/pdf.utf-8.heavy $1/data/
20cp data/pdf.utf-8.simple $1/data/
21cp config-scripts/cups-pdf-filters.m4 $1/config-scripts/
22
23# Copy directories
24cp -r filter/fontembed $1/filter/
25cp -r pdftopdf $1
26cp -r pdftoopvp $1
27
28cd $1
29
30# Edit configure script
31cp configure.in configure.in.pdf-filters
32cp configure configure.pdf-filters
33cp config.h.in config.h.in.pdf-filters
34perl -p -i -e 's/(sinclude\(config-scripts\/cups-defaults\.m4\))/$1\nsinclude(config-scripts\/cups-pdf-filters.m4)/' configure.in
35aclocal
36autoconf
37perl -p -i -e 's:(\#endif\s*\/\*\s*\!_CUPS_CONFIG_H_\s*\*\/):
38
39/* CUPS Version is 1.1 */
40\#undef CUPS_1_1
41
42/* CUPS Version is 1.4 or newer */
43\#undef CUPS_1_4
44
45/* Use libjpeg instead of builtin jpeg decoder. */
46\#undef ENABLE_LIBJPEG
47
48/* Use zlib instead of builtin zlib decoder. */
49\#undef ENABLE_ZLIB
50
51/* Have FreeType2 include files */
52\#undef HAVE_FREETYPE_H
53
54/* Define to 1 if you have the <inttypes.h> header file. */
55\#undef HAVE_INTTYPES_H
56
57/* Define to 1 if you have the "cups" library (-lcups). */
58\#define HAVE_LIBCUPS 1
59
60/* Define to 1 if you have the <memory.h> header file. */
61\#undef HAVE_MEMORY_H
62
63/* have new GfxFontType */
64\#undef HAVE_NEW_GFX_FONTTYPE
65
66/* Define to 1 if you have the "popen" function. */
67\#undef HAVE_POPEN
68
69/* Define to 1 if you have the <stdint.h> header file. */
70\#undef HAVE_STDINT_H
71
72/* Define to 1 if you have the <dirent.h> header file, and it defines "DIR".
73   */
74\#undef HAVE_DIRENT_H
75
76/* Define to 1 if you have the <ndir.h> header file, and it defines "DIR". */
77\#undef HAVE_NDIR_H
78
79/* Define to 1 if you have the <sys/dir.h> header file, and it defines "DIR".
80   */
81\#undef HAVE_SYS_DIR_H
82
83/* Define to 1 if you have the <sys/ndir.h> header file, and it defines "DIR".
84   */
85\#undef HAVE_SYS_NDIR_H
86
87/* Define to 1 if you have the <zlib.h> header file. */
88\#undef HAVE_ZLIB_H
89
90/* Parser\:\:Parser has two arguments. */
91\#undef PARSER_HAS_2_ARGS
92
93/* Define to 1 if you have the "poppler" library (-lpoppler). */
94\#undef HAVE_LIBPOPPLER
95
96/* New font type enumeration */
97\#undef FONTTYPE_ENUM2
98
99/* GlobalParams\:\:GlobalParams has a argument. */
100\#undef GLOBALPARAMS_HAS_A_ARG
101
102/* Have Stream\:\:getUndecodedStream */
103\#undef HAVE_GETUNDECODEDSTREAM
104
105/* Have UGooString.h */
106\#undef HAVE_UGOOSTRING_H
107
108/* Old CharCodeToUnicode\:\:mapToUnicode */
109\#undef OLD_MAPTOUNICODE
110
111/* Old GfxColorSpace\:\:parse */
112\#undef OLD_CS_PARSE
113
114/* Poppler uses CMS */
115\#undef USE_CMS
116
117/* Poppler data dir */
118\#undef POPPLER_DATADIR
119
120\n$1:' config.h.in
121
122# Edit Makefiles
123cp conf/Makefile conf/Makefile.pdf-filters
124cp filter/Makefile filter/Makefile.pdf-filters
125cp data/Makefile data/Makefile.pdf-filters
126cp Makefile Makefile.pdf-filters
127cp Makedefs.in Makedefs.in.pdf-filters
128perl -p -i -e 's/^(\s*REPLACE\s*=.*)$/$1 imagetopdf.convs imagetopdf.types pdftopdf.convs pdf.types texttopdf.convs/' conf/Makefile
129perl -p -i -e 's/^(\s*FILTERS\s*=\s+)/$1imagetopdf pdftoijs texttopdf /' filter/Makefile
130perl -p -i -e 's/^(\s*OBJS\s*=\s+)/$1imagetopdf.o pdftoijs.o texttopdf.o pdfutils.o /' filter/Makefile
131perl -p -i -e 's/^(\s*CHARSETS\s*=\s+)/$1pdf.utf-8.heavy pdf.utf-8.simple /' data/Makefile
132cat >> filter/Makefile <<EOF
133
134#
135# imagetops
136#
137
138imagetopdf:     imagetopdf.o common.o \$(LIBCUPSIMAGE) \\
139                ../cups/\$(LIBCUPS)
140        echo Linking \$@...
141        \$(CC) \$(LDFLAGS) -o \$@ imagetopdf.o common.o \$(LINKCUPSIMAGE) \\
142                \$(IMGLIBS) \$(LIBS)
143
144
145#
146# pdftoijs
147#
148
149pdftoijs:       pdftoijs.o ../cups/\$(LIBCUPS)
150        echo Linking \$@...
151        \$(CXX) \$(LDFLAGS) -o \$@ pdftoijs.o \\
152                \$(POPPLER_LIBS) \$(IJS_LIBS)
153
154
155#
156# texttopdf
157#
158
159fontembed/libfontembed.a:
160        \$(MAKE) -C fontembed
161
162texttopdf:      texttopdf.o textcommon.o common.o pdfutils.o fontembed/libfontembed.a \\
163                ../cups/\$(LIBCUPS)
164        echo Linking \$@...
165        \$(CC) \$(LDFLAGS) -o \$@ texttopdf.o textcommon.o common.o pdfutils.o -Lfontembed -lfontembed \$(LIBS)
166
167EOF
168perl -p -i -e 's/^(\s*DIRS\s*=.*\s+filter\s+)/$1pdftoopvp /' Makefile
169perl -p -i -e 's/^(\s*DIRS\s*=.*\s+filter\s+)/$1pdftopdf /' Makefile
170perl -p -i -e 's/^(\s*LIBS\s*=.*$)/$1\nPOPPLER_LIBS\t=\t\@POPPLER_LIBS\@ \$(LIBS)/' Makedefs.in
171perl -p -i -e 's/^(\s*LIBS\s*=.*$)/$1\nIJS_LIBS\t=\t\@IJS_LIBS\@ \$(LIBS)/' Makedefs.in
172perl -p -i -e 's/^(\s*LIBS\s*=.*$)/$1\nFREETYPE_LIBS\t=\t\@FREETYPE_LIBS\@ \$(LIBS)/' Makedefs.in
173perl -p -i -e 's/^(\s*LIBS\s*=.*$)/$1\nFONTCONFIG_LIBS\t=\t\@FONTCONFIG_LIBS\@ \$(LIBS)/' Makedefs.in
174perl -p -i -e 's/^(\s*ALL_CFLAGS\s*=\s*)/$1-Ifontembed /' Makedefs.in
175perl -p -i -e 's/^(\s*ALL_CXXFLAGS\s*=\s*)/$1-Ioprs -Iopvp -I..\/opvp -I..\/.. /' Makedefs.in
Note: See TracBrowser for help on using the repository browser.