fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / external / epm / epm-3.7.patch
blob869c141a7155cd3ca32fbc3831a8ec2eeca6dc75
1 diff -urN epm-3.7-old//bsd.c epm-3.7/bsd.c
2 --- misc/epm-3.7/bsd.c 2003-01-14 17:05:01.000000000 +0000
3 +++ misc/build/epm-3.7/bsd.c 2010-04-19 22:52:32.000000000 +0000
4 @@ -26,6 +26,13 @@
6 #include "epm.h"
8 +void cr2semicolon(char *command)
9 +{
10 + int len, i;
11 + len=strlen(command);
12 + for (i=0;i<len;i++)
13 + if(*(command+i)=='\n') *(command+i)=';';
17 * 'make_bsd()' - Make a FreeBSD software distribution package.
18 @@ -149,8 +156,17 @@
20 for (i = dist->num_depends, d = dist->depends; i > 0; i --, d ++)
22 +#ifdef __FreeBSD__
23 + if (d->type == DEPEND_REQUIRES) {
24 + if (dist->relnumber)
25 + fprintf(fp, "@pkgdep %s-%s-%d-%s", d->product, dist->version, dist->relnumber, platname);
26 + else
27 + fprintf(fp, "@pkgdep %s-%s-%s", d->product, dist->version, platname);
28 + }
29 +#else
30 if (d->type == DEPEND_REQUIRES)
31 fprintf(fp, "@pkgdep %s", d->product);
32 +#endif
33 else
34 #ifdef __FreeBSD__
36 @@ -179,9 +195,11 @@
37 " by the BSD packager.\n", stderr);
38 break;
39 case COMMAND_POST_INSTALL :
40 + cr2semicolon(c->command);
41 fprintf(fp, "@exec %s\n", c->command);
42 break;
43 case COMMAND_PRE_REMOVE :
44 + cr2semicolon(c->command);
45 fprintf(fp, "@unexec %s\n", c->command);
46 break;
47 case COMMAND_POST_REMOVE :
48 @@ -199,7 +217,7 @@
51 fprintf(fp, "@exec /bin/mkdir -p %s\n", file->dst);
52 - fprintf(fp, "@exec /bin/chown %s:%s %s\n", file->user, file->group,
53 + fprintf(fp, "@exec /usr/sbin/chown %s:%s %s\n", file->user, file->group,
54 file->dst);
55 fprintf(fp, "@exec /bin/chmod %04o %s\n", file->mode, file->dst);
57 @@ -326,12 +344,13 @@
58 if (Verbosity)
59 puts("Building FreeBSD pkg binary distribution...");
61 - if (run_command(NULL, "pkg_create -p / -s %s -c %s -d %s -f %s %s",
62 + if (run_command(NULL, "/usr/sbin/pkg_create -p / -s %s -c %s -d %s -f %s %s",
63 current, commentname, descrname, plistname, name))
64 return (1);
66 - if (run_command(NULL, "mv %s.tgz %s", name, directory))
67 - return (1);
68 + if (run_command(NULL, "mv %s.tbz %s", name, directory))
69 + if (run_command(NULL, "mv %s.tgz %s", name, directory))
70 + return (1);
73 * Remove temporary files...
74 diff -urN epm-3.7-old//configure epm-3.7/configure
75 --- misc/epm-3.7/configure 2003-07-24 01:20:54.000000000 +0000
76 +++ misc/build/epm-3.7/configure 2010-04-19 22:52:32.000000000 +0000
77 @@ -1238,6 +1238,11 @@
79 fi;
81 +# Check whether --enable-fltk or --disable-fltk was given.
82 +if test "${enable_fltk+set}" = set; then
83 + enableval="$enable_fltk"
84 +fi;
87 # Check whether --with-docdir or --without-docdir was given.
88 if test "${with_docdir+set}" = set; then
89 @@ -4904,36 +4909,38 @@
93 -# Extract the first word of "fltk-config", so it can be a program name with args.
94 -set dummy fltk-config; ac_word=$2
95 -echo "$as_me:$LINENO: checking for $ac_word" >&5
96 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
97 -if test "${ac_cv_path_FLTKCONFIG+set}" = set; then
98 - echo $ECHO_N "(cached) $ECHO_C" >&6
99 -else
100 - case $FLTKCONFIG in
101 - [\\/]* | ?:[\\/]*)
102 - ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path.
103 - ;;
104 - *)
105 - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
106 -for as_dir in $PATH
108 - IFS=$as_save_IFS
109 - test -z "$as_dir" && as_dir=.
110 - for ac_exec_ext in '' $ac_executable_extensions; do
111 - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
112 - ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext"
113 - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
114 - break 2
115 +if eval "test x$enable_fltk = xyes"; then
116 + # Extract the first word of "fltk-config", so it can be a program name with args.
117 + set dummy fltk-config; ac_word=$2
118 + echo "$as_me:$LINENO: checking for $ac_word" >&5
119 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
120 + if test "${ac_cv_path_FLTKCONFIG+set}" = set; then
121 + echo $ECHO_N "(cached) $ECHO_C" >&6
122 + else
123 + case $FLTKCONFIG in
124 + [\\/]* | ?:[\\/]*)
125 + ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path.
126 + ;;
127 + *)
128 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
129 + for as_dir in $PATH
130 + do
131 + IFS=$as_save_IFS
132 + test -z "$as_dir" && as_dir=.
133 + for ac_exec_ext in '' $ac_executable_extensions; do
134 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
135 + ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext"
136 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
137 + break 2
138 + fi
139 + done
140 + done
142 + ;;
143 + esac
145 -done
146 -done
148 - ;;
149 -esac
150 + FLTKCONFIG=$ac_cv_path_FLTKCONFIG
152 -FLTKCONFIG=$ac_cv_path_FLTKCONFIG
154 if test -n "$FLTKCONFIG"; then
155 echo "$as_me:$LINENO: result: $FLTKCONFIG" >&5
156 @@ -4950,8 +4957,10 @@
157 INSTALL_GUIS=""
158 INSTALL_OSX=""
160 +if eval "test x$enable_fltk = xyes"; then
161 { echo "$as_me:$LINENO: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&5
162 echo "$as_me: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&2;}
164 else
165 CXXFLAGS="`$FLTKCONFIG --cflags` ${CXXFLAGS}"
166 GUIS="setup uninst"
167 diff -urN epm-3.7-old//deb.c epm-3.7/deb.c
168 --- misc/epm-3.7/deb.c 2003-01-15 14:29:24.000000000 +0000
169 +++ misc/build/epm-3.7/deb.c 2010-04-19 22:53:34.000000000 +0000
170 @@ -26,6 +26,28 @@
172 #include "epm.h"
175 + * 'add_size()' - Append Installed-Size tag to DEBIAN/control file
176 + */
178 +int /* O - 0 = success, 1 = fail */
179 +add_size(FILE *fpControl, /* Control file stream */
180 + const char *directory) /* Directory containing all files to package */
182 + FILE *fp;
183 + char command[1024];
185 + snprintf(command, sizeof(command), "du -k -s %s", directory);
186 + fp = popen(command, "r");
187 + if( NULL != fp )
189 + char size[1024];
190 + fscanf(fp, "%s .", size);
191 + fprintf(fpControl, "Installed-Size: %s\n", size);
192 + return pclose(fp);
194 + return 1;
198 * 'make_deb()' - Make a Debian software distribution package.
199 @@ -61,18 +83,37 @@
200 if (Verbosity)
201 puts("Creating Debian distribution...");
203 + /*
204 + * Use debian default naming scheme
205 + */
207 + if (!strcmp(platform->machine, "intel"))
208 +#ifdef __FreeBSD_kernel__
209 + platname = "kfreebsd-i386";
210 +#else
211 + platname = "i386";
212 +#endif
213 + else if (!strcmp(platform->machine, "x86_64"))
214 +#ifdef __FreeBSD_kernel__
215 + platname = "kfreebsd-amd64";
216 +#else
217 + platname = "amd64";
218 +#endif
219 + else if (!strcmp(platform->machine, "ppc"))
220 + platname = "powerpc";
222 if (dist->relnumber)
224 if (platname[0])
225 - snprintf(name, sizeof(name), "%s-%s-%d-%s", prodname, dist->version, dist->relnumber,
226 + snprintf(name, sizeof(name), "%s_%s-%d_%s", prodname, dist->version, dist->relnumber,
227 platname);
228 else
229 - snprintf(name, sizeof(name), "%s-%s-%d", prodname, dist->version, dist->relnumber);
230 + snprintf(name, sizeof(name), "%s_%s-%d", prodname, dist->version, dist->relnumber);
232 else if (platname[0])
233 - snprintf(name, sizeof(name), "%s-%s-%s", prodname, dist->version, platname);
234 + snprintf(name, sizeof(name), "%s_%s_%s", prodname, dist->version, platname);
235 else
236 - snprintf(name, sizeof(name), "%s-%s", prodname, dist->version);
237 + snprintf(name, sizeof(name), "%s_%s", prodname, dist->version);
240 * Write the control file for DPKG...
241 @@ -108,8 +141,20 @@
242 * (which we change in get_platform to a common name)
245 - if (strcmp(platform->machine, "intel") == 0)
246 + if (!strcmp(platform->machine, "intel"))
247 +#ifdef __FreeBSD_kernel__
248 + fputs("Architecture: kfreebsd-i386\n", fp);
249 +#else
250 fputs("Architecture: i386\n", fp);
251 +#endif
252 + else if (!strcmp(platform->machine, "x86_64"))
253 +#ifdef __FreeBSD_kernel__
254 + fputs("Architecture: kfreebsd-amd64\n", fp);
255 +#else
256 + fputs("Architecture: amd64\n", fp);
257 +#endif
258 + else if (!strcmp(platform->machine, "ppc"))
259 + fputs("Architecture: powerpc\n", fp);
260 else
261 fprintf(fp, "Architecture: %s\n", platform->machine);
263 @@ -139,7 +192,7 @@
264 else
266 if (d->vernumber[1] < INT_MAX)
267 - fprintf(fp, " (>= %s, <= %s)", d->version[0], d->version[1]);
268 + fprintf(fp, " (>= %s), %s (<= %s)", d->version[0], d->product, d->version[1]);
269 else
270 fprintf(fp, " (>= %s)", d->version[0]);
272 @@ -148,9 +193,9 @@
273 putc('\n', fp);
278 fclose(fp);
282 * Write the preinst file for DPKG...
284 @@ -417,6 +462,27 @@
289 + /*
290 + * Calculate and append Installed-Size to DEBIAN/control
291 + */
293 + if (Verbosity)
294 + puts("Calculating Installed-Size...");
296 + snprintf(filename, sizeof(filename), "%s/%s/DEBIAN/control", directory, name);
297 + if ((fp = fopen(filename, "a")) == NULL)
299 + fprintf(stderr, "epm: Unable to Installed-Size to file \"%s\" - %s\n", filename,
300 + strerror(errno));
301 + return (1);
304 + snprintf(filename, sizeof(filename), "%s/%s", directory, name);
305 + add_size(fp, filename);
306 + fclose(fp);
310 * Build the distribution from the spec file...
312 diff -urN epm-3.7-old//dist.c epm-3.7/dist.c
313 --- misc/epm-3.7/dist.c 2003-08-07 14:14:40.000000000 +0000
314 +++ misc/build/epm-3.7/dist.c 2010-04-19 22:52:32.000000000 +0000
315 @@ -394,8 +394,13 @@
316 strcpy(platform->machine, "mips");
317 #elif defined(__hpux)
318 strcpy(platform->machine, "hppa");
319 -#elif defined(_AIX) || defined(__APPLE__)
320 +#elif defined(_AIX)
321 strcpy(platform->machine, "powerpc");
322 +#elif defined(__APPLE__)
323 + if (strstr(platform->machine, "86") != NULL)
324 + strcpy(platform->machine, "intel");
325 + else
326 + strcpy(platform->machine, "powerpc");
327 #else
328 for (temp = platform->machine; *temp != '\0'; temp ++)
329 if (*temp == '-' || *temp == '_')
330 @@ -407,7 +412,12 @@
331 *temp = tolower(*temp);
333 if (strstr(platform->machine, "86") != NULL)
334 - strcpy(platform->machine, "intel");
336 + if (strstr(platform->machine, "64") != NULL)
337 + strcpy(platform->machine, "x86_64");
338 + else
339 + strcpy(platform->machine, "intel");
341 else if (strncmp(platform->machine, "sun", 3) == 0)
342 strcpy(platform->machine, "sparc");
343 #endif /* __sgi */
344 diff -urN epm-3.7-old//epm.c epm-3.7/epm.c
345 --- misc/epm-3.7/epm.c 2003-10-28 14:48:30.000000000 +0000
346 +++ misc/build/epm-3.7/epm.c 2010-04-19 22:52:32.000000000 +0000
347 @@ -547,6 +547,7 @@
349 puts(EPM_VERSION);
350 puts("Copyright 1999-2003 by Easy Software Products.");
351 + puts("Patched for OpenOffice.org");
352 puts("");
353 puts("EPM is free software and comes with ABSOLUTELY NO WARRANTY; for details");
354 puts("see the GNU General Public License in the file COPYING or at");
355 diff -urN epm-3.7-old//file.c epm-3.7/file.c
356 --- misc/epm-3.7/file.c 2003-07-23 21:41:08.000000000 +0000
357 +++ misc/build/epm-3.7/file.c 2010-04-19 22:52:32.000000000 +0000
358 @@ -108,7 +108,6 @@
359 fclose(dstfile);
361 chmod(dst, mode);
362 - chown(dst, owner, group);
364 return (0);
366 @@ -138,7 +137,6 @@
368 mkdir(buffer, 0777);
369 chmod(buffer, mode | 0700);
370 - chown(buffer, owner, group);
374 @@ -151,7 +149,6 @@
376 mkdir(buffer, 0777);
377 chmod(buffer, mode | 0700);
378 - chown(buffer, owner, group);
381 return (0);
382 diff -urN epm-3.7-old//osx.c epm-3.7/osx.c
383 --- misc/epm-3.7/osx.c 2003-07-23 21:41:08.000000000 +0000
384 +++ misc/build/epm-3.7/osx.c 2010-04-19 22:52:32.000000000 +0000
385 @@ -373,7 +373,7 @@
386 else
387 snprintf(filename, sizeof(filename), "%s/%s", current, directory);
389 - run_command(NULL, "/Developer/Applications/PackageMaker.app/"
390 + run_command(NULL, "/Developer/Applications/Utilities/PackageMaker.app/"
391 "Contents/MacOS/PackageMaker -build "
392 "-p %s/%s.pkg -f %s/Package -r %s/Resources -d %s/%s-desc.plist -i %s/%s-info.plist",
393 filename, prodname, filename, filename, filename, prodname, filename, prodname);
394 diff -urN epm-3.7-old//pkg.c epm-3.7/pkg.c
395 --- misc/epm-3.7/pkg.c 2002-12-17 18:57:56.000000000 +0000
396 +++ misc/build/epm-3.7/pkg.c 2010-04-19 22:52:32.000000000 +0000
397 @@ -429,75 +429,6 @@
399 fclose(fp);
401 - /*
402 - * Build the distribution from the prototype file...
403 - */
405 - if (Verbosity)
406 - puts("Building PKG binary distribution...");
408 - if (run_command(NULL, "pkgmk -o -f %s/%s.prototype -d %s/%s",
409 - directory, prodname, current, directory))
410 - return (1);
412 - /*
413 - * Tar and compress the distribution...
414 - */
416 - if (Verbosity)
417 - puts("Creating tar.gz file for distribution...");
419 - snprintf(filename, sizeof(filename), "%s/%s.tar.gz", directory, name);
421 - if ((tarfile = tar_open(filename, 1)) == NULL)
422 - return (1);
424 - snprintf(filename, sizeof(filename), "%s/%s", directory, prodname);
426 - if (tar_directory(tarfile, filename, prodname))
428 - tar_close(tarfile);
429 - return (1);
432 - tar_close(tarfile);
434 - /*
435 - * Make a package stream file...
436 - */
438 - if (Verbosity)
439 - puts("Copying into package stream file...");
441 - if (run_command(directory, "pkgtrans -s %s/%s %s.pkg %s",
442 - current, directory, name, prodname))
443 - return (1);
445 - /*
446 - * Remove temporary files...
447 - */
449 - if (!KeepFiles)
451 - if (Verbosity)
452 - puts("Removing temporary distribution files...");
454 - snprintf(filename, sizeof(filename), "%s/%s.pkginfo", directory, prodname);
455 - unlink(filename);
456 - snprintf(filename, sizeof(filename), "%s/%s.depend", directory, prodname);
457 - unlink(filename);
458 - snprintf(filename, sizeof(filename), "%s/%s.prototype", directory, prodname);
459 - unlink(filename);
460 - if (preinstall[0])
461 - unlink(preinstall);
462 - if (postinstall[0])
463 - unlink(postinstall);
464 - if (preremove[0])
465 - unlink(preremove);
466 - if (postremove[0])
467 - unlink(postremove);
470 return (0);
473 diff -urN epm-3.7-old//qprintf.c epm-3.7/qprintf.c
474 --- misc/epm-3.7-old/qprintf.c 2003-01-27 21:48:03.000000000 +0000
475 +++ misc/build/epm-3.7/qprintf.c 2010-04-19 22:52:32.000000000 +0000
476 @@ -181,12 +181,19 @@
478 for (i = slen; i > 0; i --, s ++, bytes ++)
480 +#if defined(__FreeBSD__)
481 + if (strchr("`~!#%^&*()[{]}\\|;\'\"<>? ", *s))
483 + putc('\\', fp);
484 + bytes ++;
486 +#else
487 if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s))
489 putc('\\', fp);
490 bytes ++;
493 +#endif
494 putc(*s, fp);
497 diff -urN epm-3.7-old//rpm.c epm-3.7/rpm.c
498 --- misc/epm-3.7/rpm.c 2003-10-01 19:27:15.000000000 +0000
499 +++ misc/build/epm-3.7/rpm.c 2010-04-19 22:52:32.000000000 +0000
500 @@ -38,7 +38,7 @@
501 dist_t *dist, /* I - Distribution information */
502 struct utsname *platform) /* I - Platform information */
504 - int i; /* Looping var */
505 + int i,n; /* Looping vars */
506 FILE *fp; /* Spec file */
507 char name[1024]; /* Full product name */
508 char specname[1024]; /* Spec filename */
509 @@ -160,6 +160,8 @@
510 fprintf(fp, "Requires: %s", dname);
511 else if (d->type == DEPEND_PROVIDES)
512 fprintf(fp, "Provides: %s", dname);
513 + else if (d->type == DEPEND_REPLACES)
514 + fprintf(fp, "Obsoletes: %s", dname);
515 else
516 fprintf(fp, "Conflicts: %s", dname);
518 @@ -186,15 +188,33 @@
519 for (i = 0; i < dist->num_descriptions; i ++)
520 fprintf(fp, "%s\n", dist->descriptions[i]);
522 - fputs("%pre\n", fp);
523 + /*
524 + * %pre
525 + */
526 + n = 0;
527 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
529 if (c->type == COMMAND_PRE_INSTALL)
531 + if (1 == ++n) /* Only write %pre if there is at least one command */
532 + fputs("%pre\n", fp);
533 fprintf(fp, "%s\n", c->command);
537 - fputs("%post\n", fp);
538 + /*
539 + * %post
540 + */
541 + n = 0;
542 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
544 if (c->type == COMMAND_POST_INSTALL)
546 + if (1 == ++n) /* Only write %post if there is at least one command */
547 + fputs("%post\n", fp);
548 fprintf(fp, "%s\n", c->command);
552 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
553 if (tolower(file->type) == 'i')
554 @@ -202,6 +222,8 @@
556 if (i)
558 + if (1 == ++n) /* If not previously done so, write %post here */
559 + fputs("%post\n", fp);
560 fputs("if test \"x$1\" = x1; then\n", fp);
561 fputs(" echo Setting up init scripts...\n", fp);
563 @@ -259,13 +281,17 @@
564 fputs("fi\n", fp);
567 - fputs("%preun\n", fp);
568 + /*
569 + * %preun
570 + */
571 + n = 0;
572 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
573 if (tolower(file->type) == 'i')
574 break;
576 if (i)
578 + fputs("%preun\n", fp); ++n; /* Need to write %preun here */
579 fputs("if test \"x$1\" = x0; then\n", fp);
580 fputs(" echo Cleaning up init scripts...\n", fp);
582 @@ -315,13 +341,29 @@
585 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
587 if (c->type == COMMAND_PRE_REMOVE)
589 + if (1 == ++n) /* Only write %preun if not previously done so */
590 + fputs("%preun\n", fp);
592 fprintf(fp, "%s\n", c->command);
596 - fputs("%postun\n", fp);
597 + /*
598 + * %post
599 + */
600 + n = 0;
601 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
603 if (c->type == COMMAND_POST_REMOVE)
605 + if (1 == ++n) /* Only write %post if there is at least one command */
606 + fputs("%postun\n", fp);
607 fprintf(fp, "%s\n", c->command);
611 fputs("%files\n", fp);
612 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
613 @@ -415,53 +457,6 @@
617 - /*
618 - * Build the distribution from the spec file...
619 - */
621 - if (Verbosity)
622 - puts("Building RPM binary distribution...");
624 - if (strcmp(platform->machine, "intel") == 0)
626 - if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "i386 %s",
627 - Verbosity == 0 ? "--quiet" : "", specname))
628 - return (1);
630 - else if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "%s %s",
631 - Verbosity == 0 ? "--quiet" : "", platform->machine,
632 - specname))
633 - return (1);
635 - /*
636 - * Move the RPM to the local directory and rename the RPM using the
637 - * product name specified by the user...
638 - */
640 - if (strcmp(platform->machine, "intel") == 0)
641 - run_command(NULL, "/bin/mv %s/RPMS/i386/%s-%s-%d.i386.rpm %s/%s.rpm",
642 - rpmdir, prodname, dist->version, dist->relnumber,
643 - directory, name);
644 - else
645 - run_command(NULL, "/bin/mv %s/RPMS/%s/%s-%s-%d.%s.rpm %s/%s.rpm",
646 - rpmdir, platform->machine, prodname, dist->version,
647 - dist->relnumber, platform->machine, directory, name);
649 - /*
650 - * Remove temporary files...
651 - */
653 - if (!KeepFiles)
655 - if (Verbosity)
656 - puts("Removing temporary distribution files...");
658 - run_command(NULL, "/bin/rm -rf %s/RPMS", directory);
659 - run_command(NULL, "/bin/rm -rf %s/buildroot", directory);
661 - unlink(specname);
664 return (0);