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
8 +void cr2semicolon(char *command)
11 + len=strlen(command);
13 + if(*(command+i)=='\n') *(command+i)=';';
17 * 'make_bsd()' - Make a FreeBSD software distribution package.
20 for (i = dist->num_depends, d = dist->depends; i > 0; i --, d ++)
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);
27 + fprintf(fp, "@pkgdep %s-%s-%s", d->product, dist->version, platname);
30 if (d->type == DEPEND_REQUIRES)
31 fprintf(fp, "@pkgdep %s", d->product);
37 " by the BSD packager.\n", stderr);
39 case COMMAND_POST_INSTALL :
40 + cr2semicolon(c->command);
41 fprintf(fp, "@exec %s\n", c->command);
43 case COMMAND_PRE_REMOVE :
44 + cr2semicolon(c->command);
45 fprintf(fp, "@unexec %s\n", c->command);
47 case COMMAND_POST_REMOVE :
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,
55 fprintf(fp, "@exec /bin/chmod %04o %s\n", file->mode, file->dst);
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))
66 - if (run_command(NULL, "mv %s.tgz %s", name, directory))
68 + if (run_command(NULL, "mv %s.tbz %s", name, directory))
69 + if (run_command(NULL, "mv %s.tgz %s", name, directory))
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 @@
81 +# Check whether --enable-fltk or --disable-fltk was given.
82 +if test "${enable_fltk+set}" = set; then
83 + enableval="$enable_fltk"
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
100 - case $FLTKCONFIG in
102 - ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path.
105 - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
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
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
123 + case $FLTKCONFIG in
125 + ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path.
128 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
129 + for as_dir in $PATH
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
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 @@
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;}
165 CXXFLAGS="`$FLTKCONFIG --cflags` ${CXXFLAGS}"
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
175 + * 'add_size()' - Append Installed-Size tag to DEBIAN/control file
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 */
183 + char command[1024];
185 + snprintf(command, sizeof(command), "du -k -s %s", directory);
186 + fp = popen(command, "r");
190 + fscanf(fp, "%s .", size);
191 + fprintf(fpControl, "Installed-Size: %s\n", size);
198 * 'make_deb()' - Make a Debian software distribution package.
201 puts("Creating Debian distribution...");
204 + * Use debian default naming scheme
207 + if (!strcmp(platform->machine, "intel"))
208 +#ifdef __FreeBSD_kernel__
209 + platname = "kfreebsd-i386";
213 + else if (!strcmp(platform->machine, "x86_64"))
214 +#ifdef __FreeBSD_kernel__
215 + platname = "kfreebsd-amd64";
217 + platname = "amd64";
219 + else if (!strcmp(platform->machine, "ppc"))
220 + platname = "powerpc";
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,
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);
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...
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);
250 fputs("Architecture: i386\n", fp);
252 + else if (!strcmp(platform->machine, "x86_64"))
253 +#ifdef __FreeBSD_kernel__
254 + fputs("Architecture: kfreebsd-amd64\n", fp);
256 + fputs("Architecture: amd64\n", fp);
258 + else if (!strcmp(platform->machine, "ppc"))
259 + fputs("Architecture: powerpc\n", fp);
261 fprintf(fp, "Architecture: %s\n", platform->machine);
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]);
270 fprintf(fp, " (>= %s)", d->version[0]);
282 * Write the preinst file for DPKG...
290 + * Calculate and append Installed-Size to DEBIAN/control
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,
304 + snprintf(filename, sizeof(filename), "%s/%s", directory, name);
305 + add_size(fp, filename);
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
316 strcpy(platform->machine, "mips");
317 #elif defined(__hpux)
318 strcpy(platform->machine, "hppa");
319 -#elif defined(_AIX) || defined(__APPLE__)
321 strcpy(platform->machine, "powerpc");
322 +#elif defined(__APPLE__)
323 + if (strstr(platform->machine, "86") != NULL)
324 + strcpy(platform->machine, "intel");
326 + strcpy(platform->machine, "powerpc");
328 for (temp = platform->machine; *temp != '\0'; temp ++)
329 if (*temp == '-' || *temp == '_')
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");
339 + strcpy(platform->machine, "intel");
341 else if (strncmp(platform->machine, "sun", 3) == 0)
342 strcpy(platform->machine, "sparc");
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
350 puts("Copyright 1999-2003 by Easy Software Products.");
351 + puts("Patched for OpenOffice.org");
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
362 - chown(dst, owner, group);
369 chmod(buffer, mode | 0700);
370 - chown(buffer, owner, group);
377 chmod(buffer, mode | 0700);
378 - chown(buffer, owner, group);
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
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
402 - * Build the distribution from the prototype file...
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))
413 - * Tar and compress the distribution...
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)
424 - snprintf(filename, sizeof(filename), "%s/%s", directory, prodname);
426 - if (tar_directory(tarfile, filename, prodname))
428 - tar_close(tarfile);
432 - tar_close(tarfile);
435 - * Make a package stream file...
439 - puts("Copying into package stream file...");
441 - if (run_command(directory, "pkgtrans -s %s/%s %s.pkg %s",
442 - current, directory, name, prodname))
446 - * Remove temporary files...
452 - puts("Removing temporary distribution files...");
454 - snprintf(filename, sizeof(filename), "%s/%s.pkginfo", directory, prodname);
456 - snprintf(filename, sizeof(filename), "%s/%s.depend", directory, prodname);
458 - snprintf(filename, sizeof(filename), "%s/%s.prototype", directory, prodname);
461 - unlink(preinstall);
462 - if (postinstall[0])
463 - unlink(postinstall);
467 - unlink(postremove);
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))
487 if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s))
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
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 */
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);
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);
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);
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')
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 @@
567 - fputs("%preun\n", fp);
572 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
573 if (tolower(file->type) == '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);
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 ++)
618 - * Build the distribution from the spec file...
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))
630 - else if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "%s %s",
631 - Verbosity == 0 ? "--quiet" : "", platform->machine,
636 - * Move the RPM to the local directory and rename the RPM using the
637 - * product name specified by the user...
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,
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);
650 - * Remove temporary files...
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);