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);
273 * Write the preinst file for DPKG...
281 + * Calculate and append Installed-Size to DEBIAN/control
285 + puts("Calculating Installed-Size...");
287 + snprintf(filename, sizeof(filename), "%s/%s/DEBIAN/control", directory, name);
288 + if ((fp = fopen(filename, "a")) == NULL)
290 + fprintf(stderr, "epm: Unable to Installed-Size to file \"%s\" - %s\n", filename,
295 + snprintf(filename, sizeof(filename), "%s/%s", directory, name);
296 + add_size(fp, filename);
301 * Build the distribution from the spec file...
303 diff -urN epm-3.7-old//dist.c epm-3.7/dist.c
304 --- misc/epm-3.7/dist.c 2003-08-07 14:14:40.000000000 +0000
305 +++ misc/build/epm-3.7/dist.c 2010-04-19 22:52:32.000000000 +0000
307 strcpy(platform->machine, "mips");
308 #elif defined(__hpux)
309 strcpy(platform->machine, "hppa");
310 -#elif defined(_AIX) || defined(__APPLE__)
312 strcpy(platform->machine, "powerpc");
313 +#elif defined(__APPLE__)
314 + if (strstr(platform->machine, "86") != NULL)
315 + strcpy(platform->machine, "intel");
317 + strcpy(platform->machine, "powerpc");
319 for (temp = platform->machine; *temp != '\0'; temp ++)
320 if (*temp == '-' || *temp == '_')
322 *temp = tolower(*temp);
324 if (strstr(platform->machine, "86") != NULL)
325 - strcpy(platform->machine, "intel");
327 + if (strstr(platform->machine, "64") != NULL)
328 + strcpy(platform->machine, "x86_64");
330 + strcpy(platform->machine, "intel");
332 else if (strncmp(platform->machine, "sun", 3) == 0)
333 strcpy(platform->machine, "sparc");
335 diff -urN epm-3.7-old//epm.c epm-3.7/epm.c
336 --- misc/epm-3.7/epm.c 2003-10-28 14:48:30.000000000 +0000
337 +++ misc/build/epm-3.7/epm.c 2010-04-19 22:52:32.000000000 +0000
341 puts("Copyright 1999-2003 by Easy Software Products.");
342 + puts("Patched for OpenOffice.org");
344 puts("EPM is free software and comes with ABSOLUTELY NO WARRANTY; for details");
345 puts("see the GNU General Public License in the file COPYING or at");
346 diff -urN epm-3.7-old//file.c epm-3.7/file.c
347 --- misc/epm-3.7/file.c 2003-07-23 21:41:08.000000000 +0000
348 +++ misc/build/epm-3.7/file.c 2010-04-19 22:52:32.000000000 +0000
353 - chown(dst, owner, group);
360 chmod(buffer, mode | 0700);
361 - chown(buffer, owner, group);
368 chmod(buffer, mode | 0700);
369 - chown(buffer, owner, group);
373 diff -urN epm-3.7-old//osx.c epm-3.7/osx.c
374 --- misc/epm-3.7/osx.c 2003-07-23 21:41:08.000000000 +0000
375 +++ misc/build/epm-3.7/osx.c 2010-04-19 22:52:32.000000000 +0000
378 snprintf(filename, sizeof(filename), "%s/%s", current, directory);
380 - run_command(NULL, "/Developer/Applications/PackageMaker.app/"
381 + run_command(NULL, "/Developer/Applications/Utilities/PackageMaker.app/"
382 "Contents/MacOS/PackageMaker -build "
383 "-p %s/%s.pkg -f %s/Package -r %s/Resources -d %s/%s-desc.plist -i %s/%s-info.plist",
384 filename, prodname, filename, filename, filename, prodname, filename, prodname);
385 diff -urN epm-3.7-old//pkg.c epm-3.7/pkg.c
386 --- misc/epm-3.7/pkg.c 2002-12-17 18:57:56.000000000 +0000
387 +++ misc/build/epm-3.7/pkg.c 2010-04-19 22:52:32.000000000 +0000
393 - * Build the distribution from the prototype file...
397 - puts("Building PKG binary distribution...");
399 - if (run_command(NULL, "pkgmk -o -f %s/%s.prototype -d %s/%s",
400 - directory, prodname, current, directory))
404 - * Tar and compress the distribution...
408 - puts("Creating tar.gz file for distribution...");
410 - snprintf(filename, sizeof(filename), "%s/%s.tar.gz", directory, name);
412 - if ((tarfile = tar_open(filename, 1)) == NULL)
415 - snprintf(filename, sizeof(filename), "%s/%s", directory, prodname);
417 - if (tar_directory(tarfile, filename, prodname))
419 - tar_close(tarfile);
423 - tar_close(tarfile);
426 - * Make a package stream file...
430 - puts("Copying into package stream file...");
432 - if (run_command(directory, "pkgtrans -s %s/%s %s.pkg %s",
433 - current, directory, name, prodname))
437 - * Remove temporary files...
443 - puts("Removing temporary distribution files...");
445 - snprintf(filename, sizeof(filename), "%s/%s.pkginfo", directory, prodname);
447 - snprintf(filename, sizeof(filename), "%s/%s.depend", directory, prodname);
449 - snprintf(filename, sizeof(filename), "%s/%s.prototype", directory, prodname);
452 - unlink(preinstall);
453 - if (postinstall[0])
454 - unlink(postinstall);
458 - unlink(postremove);
464 diff -urN epm-3.7-old//qprintf.c epm-3.7/qprintf.c
465 --- misc/epm-3.7-old/qprintf.c 2003-01-27 21:48:03.000000000 +0000
466 +++ misc/build/epm-3.7/qprintf.c 2010-04-19 22:52:32.000000000 +0000
467 @@ -181,12 +181,19 @@
469 for (i = slen; i > 0; i --, s ++, bytes ++)
471 +#if defined(__FreeBSD__)
472 + if (strchr("`~!#%^&*()[{]}\\|;\'\"<>? ", *s))
478 if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s))
488 diff -urN epm-3.7-old//rpm.c epm-3.7/rpm.c
489 --- misc/epm-3.7/rpm.c 2003-10-01 19:27:15.000000000 +0000
490 +++ misc/build/epm-3.7/rpm.c 2010-04-19 22:52:32.000000000 +0000
492 dist_t *dist, /* I - Distribution information */
493 struct utsname *platform) /* I - Platform information */
495 - int i; /* Looping var */
496 + int i,n; /* Looping vars */
497 FILE *fp; /* Spec file */
498 char name[1024]; /* Full product name */
499 char specname[1024]; /* Spec filename */
501 fprintf(fp, "Requires: %s", dname);
502 else if (d->type == DEPEND_PROVIDES)
503 fprintf(fp, "Provides: %s", dname);
504 + else if (d->type == DEPEND_REPLACES)
505 + fprintf(fp, "Obsoletes: %s", dname);
507 fprintf(fp, "Conflicts: %s", dname);
509 @@ -186,15 +188,33 @@
510 for (i = 0; i < dist->num_descriptions; i ++)
511 fprintf(fp, "%s\n", dist->descriptions[i]);
513 - fputs("%pre\n", fp);
518 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
520 if (c->type == COMMAND_PRE_INSTALL)
522 + if (1 == ++n) /* Only write %pre if there is at least one command */
523 + fputs("%pre\n", fp);
524 fprintf(fp, "%s\n", c->command);
528 - fputs("%post\n", fp);
533 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
535 if (c->type == COMMAND_POST_INSTALL)
537 + if (1 == ++n) /* Only write %post if there is at least one command */
538 + fputs("%post\n", fp);
539 fprintf(fp, "%s\n", c->command);
543 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
544 if (tolower(file->type) == 'i')
549 + if (1 == ++n) /* If not previously done so, write %post here */
550 + fputs("%post\n", fp);
551 fputs("if test \"x$1\" = x1; then\n", fp);
552 fputs(" echo Setting up init scripts...\n", fp);
554 @@ -259,13 +281,17 @@
558 - fputs("%preun\n", fp);
563 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
564 if (tolower(file->type) == 'i')
569 + fputs("%preun\n", fp); ++n; /* Need to write %preun here */
570 fputs("if test \"x$1\" = x0; then\n", fp);
571 fputs(" echo Cleaning up init scripts...\n", fp);
573 @@ -315,13 +341,29 @@
576 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
578 if (c->type == COMMAND_PRE_REMOVE)
580 + if (1 == ++n) /* Only write %preun if not previously done so */
581 + fputs("%preun\n", fp);
583 fprintf(fp, "%s\n", c->command);
587 - fputs("%postun\n", fp);
592 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
594 if (c->type == COMMAND_POST_REMOVE)
596 + if (1 == ++n) /* Only write %post if there is at least one command */
597 + fputs("%postun\n", fp);
598 fprintf(fp, "%s\n", c->command);
602 fputs("%files\n", fp);
603 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
609 - * Build the distribution from the spec file...
613 - puts("Building RPM binary distribution...");
615 - if (strcmp(platform->machine, "intel") == 0)
617 - if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "i386 %s",
618 - Verbosity == 0 ? "--quiet" : "", specname))
621 - else if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "%s %s",
622 - Verbosity == 0 ? "--quiet" : "", platform->machine,
627 - * Move the RPM to the local directory and rename the RPM using the
628 - * product name specified by the user...
631 - if (strcmp(platform->machine, "intel") == 0)
632 - run_command(NULL, "/bin/mv %s/RPMS/i386/%s-%s-%d.i386.rpm %s/%s.rpm",
633 - rpmdir, prodname, dist->version, dist->relnumber,
636 - run_command(NULL, "/bin/mv %s/RPMS/%s/%s-%s-%d.%s.rpm %s/%s.rpm",
637 - rpmdir, platform->machine, prodname, dist->version,
638 - dist->relnumber, platform->machine, directory, name);
641 - * Remove temporary files...
647 - puts("Removing temporary distribution files...");
649 - run_command(NULL, "/bin/rm -rf %s/RPMS", directory);
650 - run_command(NULL, "/bin/rm -rf %s/buildroot", directory);