3
# Silently exit if the changes are already applied
4
[ -f $1/filter/imagetopdf.c ] && exit 0
7
cp filter/imagetopdf.c $1/filter/
8
cp filter/pdftoijs.cxx $1/filter/
9
cp filter/texttopdf.c $1/filter/
10
cp filter/pdfutils.h $1/filter/
11
cp filter/pdfutils.c $1/filter/
12
cp -r filter/fontembed $1/filter/
13
cp filter/test_pdf1.c $1/filter/
14
cp filter/test_pdf2.c $1/filter/
15
cp conf/imagetopdf.convs $1/conf/
16
cp conf/imagetopdf.types $1/conf/
17
cp conf/pdftopdf.convs $1/conf/
18
cp conf/pdf.types $1/conf/
19
cp conf/texttopdf.convs $1/conf/
20
cp data/pdf.utf-8.heavy $1/data/
21
cp data/pdf.utf-8.simple $1/data/
22
cp config-scripts/cups-pdf-filters.m4 $1/config-scripts/
29
# Edit configure script
30
cp configure.in configure.in.pdf-filters
31
cp configure configure.pdf-filters
32
cp config.h.in config.h.in.pdf-filters
33
perl -p -i -e 's/(sinclude\(config-scripts\/cups-defaults\.m4\))/$1\nsinclude(config-scripts\/cups-pdf-filters.m4)/' configure.in
35
perl -p -i -e 's:(\#endif\s*\/\*\s*\!_CUPS_CONFIG_H_\s*\*\/):
37
/* Define to 1 if you have the <dirent.h> header file, and it defines "DIR".
41
/* Define to 1 if you have the <ndir.h> header file, and it defines "DIR". */
44
/* Define to 1 if you have the <sys/dir.h> header file, and it defines "DIR".
46
\#undef HAVE_SYS_DIR_H
48
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines "DIR".
50
\#undef HAVE_SYS_NDIR_H
52
/* Define to 1 if you have the <zlib.h> header file. */
55
/* Parser\:\:Parser has two arguments. */
56
\#undef PARSER_HAS_2_ARGS
58
/* Define to 1 if you have the "poppler" library (-lpoppler). */
59
\#undef HAVE_LIBPOPPLER
61
/* New font type enumeration */
62
\#undef FONTTYPE_ENUM2
64
/* GlobalParams\:\:GlobalParams has a argument. */
65
\#undef GLOBALPARAMS_HAS_A_ARG
67
/* Have Stream\:\:getUndecodedStream */
68
\#undef HAVE_GETUNDECODEDSTREAM
70
/* Have UGooString.h */
71
\#undef HAVE_UGOOSTRING_H
73
/* Old CharCodeToUnicode\:\:mapToUnicode */
74
\#undef OLD_MAPTOUNICODE
79
cp conf/Makefile conf/Makefile.pdf-filters
80
cp filter/Makefile filter/Makefile.pdf-filters
81
cp data/Makefile data/Makefile.pdf-filters
82
cp Makefile Makefile.pdf-filters
83
cp Makedefs.in Makedefs.in.pdf-filters
84
perl -p -i -e 's/^(\s*REPLACE\s*=.*)$/$1 imagetopdf.convs imagetopdf.types pdftopdf.convs pdf.types texttopdf.convs/' conf/Makefile
85
perl -p -i -e 's/^(\s*FILTERS\s*=\s+)/$1imagetopdf pdftoijs texttopdf /' filter/Makefile
86
perl -p -i -e 's/^(\s*OBJS\s*=\s+)/$1imagetopdf.o pdftoijs.o texttopdf.o pdfutils.o /' filter/Makefile
87
perl -p -i -e 's/^(\s*CHARSETS\s*=\s+)/$1pdf.utf-8.heavy pdf.utf-8.simple /' data/Makefile
88
cat >> filter/Makefile <<EOF
94
imagetopdf: imagetopdf.o common.o \$(LIBCUPSIMAGE) \\
97
\$(CC) \$(LDFLAGS) -o \$@ imagetopdf.o common.o \$(LINKCUPSIMAGE) \\
105
pdftoijs: pdftoijs.o ../cups/\$(LIBCUPS)
107
\$(CC) \$(LDFLAGS) -o \$@ pdftoijs.o \\
108
\$(POPPLER_LIBS) \$(IJS_LIBS)
115
fontembed/libfontembed.a:
116
\$(MAKE) -C fontembed
118
texttopdf: texttopdf.o textcommon.o common.o pdfutils.o fontembed/libfontembed.a \\
121
\$(CC) \$(LDFLAGS) -o \$@ texttopdf.o textcommon.o common.o pdfutils.o -Lfontembed -lfontembed \$(LIBS)
124
perl -p -i -e 's/^(\s*DIRS\s*=.*\s+filter\s+)/$1pdftopdf /' Makefile
125
perl -p -i -e 's/^(\s*LIBS\s*=.*$)/$1\nPOPPLER_LIBS\t=\t\@POPPLER_LIBS\@ \$(LIBS)/' Makedefs.in
126
perl -p -i -e 's/^(\s*LIBS\s*=.*$)/$1\nIJS_LIBS\t=\t\@IJS_LIBS\@ \$(LIBS)/' Makedefs.in
127
perl -p -i -e 's/^(\s*ALL_CFLAGS\s*=\s*)/$1-Ifontembed /' Makedefs.in