1 *** misc/epm-3.7/bsd.c Tue Jan 14 18:05:01 2003
2 --- misc/build/epm-3.7/bsd.c Mon Nov 20 14:54:51 2006
9 + void cr2semicolon(char *command)
12 + len=strlen(command);
14 + if(*(command+i)=='\n') *(command+i)=';';
18 * 'make_bsd()' - Make a FreeBSD software distribution package.
23 for (i = dist->num_depends, d = dist->depends; i > 0; i --, d ++)
26 + if (d->type == DEPEND_REQUIRES) {
27 + if (dist->relnumber)
28 + fprintf(fp, "@pkgdep %s-%s-%d-%s", d->product, dist->version, dist->relnumber, platname);
30 + fprintf(fp, "@pkgdep %s-%s-%s", d->product, dist->version, platname);
33 if (d->type == DEPEND_REQUIRES)
34 fprintf(fp, "@pkgdep %s", d->product);
42 " by the BSD packager.\n", stderr);
44 case COMMAND_POST_INSTALL :
45 + cr2semicolon(c->command);
46 fprintf(fp, "@exec %s\n", c->command);
48 case COMMAND_PRE_REMOVE :
49 + cr2semicolon(c->command);
50 fprintf(fp, "@unexec %s\n", c->command);
52 case COMMAND_POST_REMOVE :
57 fprintf(fp, "@exec /bin/mkdir -p %s\n", file->dst);
58 ! fprintf(fp, "@exec /bin/chown %s:%s %s\n", file->user, file->group,
60 fprintf(fp, "@exec /bin/chmod %04o %s\n", file->mode, file->dst);
65 fprintf(fp, "@exec /bin/mkdir -p %s\n", file->dst);
66 ! fprintf(fp, "@exec /usr/sbin/chown %s:%s %s\n", file->user, file->group,
68 fprintf(fp, "@exec /bin/chmod %04o %s\n", file->mode, file->dst);
73 puts("Building FreeBSD pkg binary distribution...");
75 ! if (run_command(NULL, "pkg_create -p / -s %s -c %s -d %s -f %s %s",
76 current, commentname, descrname, plistname, name))
79 ! if (run_command(NULL, "mv %s.tgz %s", name, directory))
83 * Remove temporary files...
86 puts("Building FreeBSD pkg binary distribution...");
88 ! if (run_command(NULL, "/usr/sbin/pkg_create -p / -s %s -c %s -d %s -f %s %s",
89 current, commentname, descrname, plistname, name))
92 ! if (run_command(NULL, "mv %s.tbz %s", name, directory))
93 ! if (run_command(NULL, "mv %s.tgz %s", name, directory))
97 * Remove temporary files...
98 *** misc/epm-3.7/configure Thu Jul 24 03:20:54 2003
99 --- misc/build/epm-3.7/configure Mon Nov 20 15:01:11 2006
106 + # Check whether --enable-fltk or --disable-fltk was given.
107 + if test "${enable_fltk+set}" = set; then
108 + enableval="$enable_fltk"
112 # Check whether --with-docdir or --without-docdir was given.
113 if test "${with_docdir+set}" = set; then
114 withval="$with_docdir"
120 ! # Extract the first word of "fltk-config", so it can be a program name with args.
121 ! set dummy fltk-config; ac_word=$2
122 ! echo "$as_me:$LINENO: checking for $ac_word" >&5
123 ! echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
124 ! if test "${ac_cv_path_FLTKCONFIG+set}" = set; then
125 ! echo $ECHO_N "(cached) $ECHO_C" >&6
127 ! case $FLTKCONFIG in
129 ! ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path.
132 ! as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
133 ! for as_dir in $PATH
136 ! test -z "$as_dir" && as_dir=.
137 ! for ac_exec_ext in '' $ac_executable_extensions; do
138 ! if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
139 ! ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext"
140 ! echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
149 - FLTKCONFIG=$ac_cv_path_FLTKCONFIG
151 if test -n "$FLTKCONFIG"; then
152 echo "$as_me:$LINENO: result: $FLTKCONFIG" >&5
157 ! if eval "test x$enable_fltk = xyes"; then
158 ! # Extract the first word of "fltk-config", so it can be a program name with args.
159 ! set dummy fltk-config; ac_word=$2
160 ! echo "$as_me:$LINENO: checking for $ac_word" >&5
161 ! echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
162 ! if test "${ac_cv_path_FLTKCONFIG+set}" = set; then
163 ! echo $ECHO_N "(cached) $ECHO_C" >&6
165 ! case $FLTKCONFIG in
167 ! ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path.
170 ! as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
171 ! for as_dir in $PATH
174 ! test -z "$as_dir" && as_dir=.
175 ! for ac_exec_ext in '' $ac_executable_extensions; do
176 ! if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
177 ! ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext"
178 ! echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
187 ! FLTKCONFIG=$ac_cv_path_FLTKCONFIG
190 if test -n "$FLTKCONFIG"; then
191 echo "$as_me:$LINENO: result: $FLTKCONFIG" >&5
198 + if eval "test x$enable_fltk = xyes"; then
199 { echo "$as_me:$LINENO: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&5
200 echo "$as_me: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&2;}
203 CXXFLAGS="`$FLTKCONFIG --cflags` ${CXXFLAGS}"
205 *** misc/epm-3.7/deb.c Wed Jan 15 15:29:24 2003
206 --- misc/build/epm-3.7/deb.c Mon Nov 20 14:54:51 2006
214 + * 'add_size()' - Append Installed-Size tag to DEBIAN/control file
217 + int /* O - 0 = success, 1 = fail */
218 + add_size(FILE *fpControl, /* Control file stream */
219 + const char *directory) /* Directory containing all files to package */
222 + char command[1024];
224 + snprintf(command, sizeof(command), "du -k -s %s", directory);
225 + fp = popen(command, "r");
229 + fscanf(fp, "%s .", size);
230 + fprintf(fpControl, "Installed-Size: %s\n", size);
237 * 'make_deb()' - Make a Debian software distribution package.
241 puts("Creating Debian distribution...");
246 ! snprintf(name, sizeof(name), "%s-%s-%d-%s", prodname, dist->version, dist->relnumber,
249 ! snprintf(name, sizeof(name), "%s-%s-%d", prodname, dist->version, dist->relnumber);
251 else if (platname[0])
252 ! snprintf(name, sizeof(name), "%s-%s-%s", prodname, dist->version, platname);
254 ! snprintf(name, sizeof(name), "%s-%s", prodname, dist->version);
257 * Write the control file for DPKG...
260 puts("Creating Debian distribution...");
263 + * Use debian default naming scheme
266 + if (!strcmp(platform->machine, "intel"))
268 + else if (!strcmp(platform->machine, "x86_64"))
269 + platname = "amd64";
270 + else if (!strcmp(platform->machine, "ppc"))
271 + platname = "powerpc";
276 ! snprintf(name, sizeof(name), "%s_%s-%d_%s", prodname, dist->version, dist->relnumber,
279 ! snprintf(name, sizeof(name), "%s_%s-%d", prodname, dist->version, dist->relnumber);
281 else if (platname[0])
282 ! snprintf(name, sizeof(name), "%s_%s_%s", prodname, dist->version, platname);
284 ! snprintf(name, sizeof(name), "%s_%s", prodname, dist->version);
287 * Write the control file for DPKG...
290 * (which we change in get_platform to a common name)
293 ! if (strcmp(platform->machine, "intel") == 0)
294 fputs("Architecture: i386\n", fp);
296 fprintf(fp, "Architecture: %s\n", platform->machine);
299 * (which we change in get_platform to a common name)
302 ! if (!strcmp(platform->machine, "intel"))
303 fputs("Architecture: i386\n", fp);
304 + else if (!strcmp(platform->machine, "x86_64"))
305 + fputs("Architecture: amd64\n", fp);
306 + else if (!strcmp(platform->machine, "ppc"))
307 + fputs("Architecture: powerpc\n", fp);
309 fprintf(fp, "Architecture: %s\n", platform->machine);
320 * Write the preinst file for DPKG...
330 * Write the preinst file for DPKG...
340 + * Calculate and append Installed-Size to DEBIAN/control
344 + puts("Calculating Installed-Size...");
346 + snprintf(filename, sizeof(filename), "%s/%s/DEBIAN/control", directory, name);
347 + if ((fp = fopen(filename, "a")) == NULL)
349 + fprintf(stderr, "epm: Unable to Installed-Size to file \"%s\" - %s\n", filename,
354 + snprintf(filename, sizeof(filename), "%s/%s", directory, name);
355 + add_size(fp, filename);
360 * Build the distribution from the spec file...
362 *** misc/epm-3.7/dist.c Thu Aug 7 16:14:40 2003
363 --- misc/build/epm-3.7/dist.c Mon Nov 20 14:54:51 2006
366 strcpy(platform->machine, "mips");
367 #elif defined(__hpux)
368 strcpy(platform->machine, "hppa");
369 ! #elif defined(_AIX) || defined(__APPLE__)
370 strcpy(platform->machine, "powerpc");
372 for (temp = platform->machine; *temp != '\0'; temp ++)
373 if (*temp == '-' || *temp == '_')
375 strcpy(platform->machine, "mips");
376 #elif defined(__hpux)
377 strcpy(platform->machine, "hppa");
378 ! #elif defined(_AIX)
379 strcpy(platform->machine, "powerpc");
380 + #elif defined(__APPLE__)
381 + if (strstr(platform->machine, "86") != NULL)
382 + strcpy(platform->machine, "intel");
384 + strcpy(platform->machine, "powerpc");
386 for (temp = platform->machine; *temp != '\0'; temp ++)
387 if (*temp == '-' || *temp == '_')
390 *temp = tolower(*temp);
392 if (strstr(platform->machine, "86") != NULL)
393 ! strcpy(platform->machine, "intel");
394 else if (strncmp(platform->machine, "sun", 3) == 0)
395 strcpy(platform->machine, "sparc");
398 *temp = tolower(*temp);
400 if (strstr(platform->machine, "86") != NULL)
402 ! if (strstr(platform->machine, "64") != NULL)
403 ! strcpy(platform->machine, "x86_64");
405 ! strcpy(platform->machine, "intel");
407 else if (strncmp(platform->machine, "sun", 3) == 0)
408 strcpy(platform->machine, "sparc");
410 *** misc/epm-3.7/epm.c Tue Oct 28 15:48:30 2003
411 --- misc/build/epm-3.7/epm.c Mon Nov 20 14:54:51 2006
417 puts("Copyright 1999-2003 by Easy Software Products.");
418 + puts("Patched for OpenOffice.org");
420 puts("EPM is free software and comes with ABSOLUTELY NO WARRANTY; for details");
421 puts("see the GNU General Public License in the file COPYING or at");
422 *** misc/epm-3.7/file.c Wed Jul 23 23:41:08 2003
423 --- misc/build/epm-3.7/file.c Mon Nov 20 14:54:51 2006
429 - chown(dst, owner, group);
438 chmod(buffer, mode | 0700);
439 - chown(buffer, owner, group);
448 chmod(buffer, mode | 0700);
449 - chown(buffer, owner, group);
454 *** misc/epm-3.7/osx.c Wed Jul 23 23:41:08 2003
455 --- misc/build/epm-3.7/osx.c Mon Nov 20 14:54:51 2006
459 snprintf(filename, sizeof(filename), "%s/%s", current, directory);
461 ! run_command(NULL, "/Developer/Applications/PackageMaker.app/"
462 "Contents/MacOS/PackageMaker -build "
463 "-p %s/%s.pkg -f %s/Package -r %s/Resources -d %s/%s-desc.plist -i %s/%s-info.plist",
464 filename, prodname, filename, filename, filename, prodname, filename, prodname);
467 snprintf(filename, sizeof(filename), "%s/%s", current, directory);
469 ! run_command(NULL, "/Developer/Applications/Utilities/PackageMaker.app/"
470 "Contents/MacOS/PackageMaker -build "
471 "-p %s/%s.pkg -f %s/Package -r %s/Resources -d %s/%s-desc.plist -i %s/%s-info.plist",
472 filename, prodname, filename, filename, filename, prodname, filename, prodname);
473 *** misc/epm-3.7/pkg.c Tue Dec 17 19:57:56 2002
474 --- misc/build/epm-3.7/pkg.c Mon Nov 20 14:54:51 2006
481 - * Build the distribution from the prototype file...
485 - puts("Building PKG binary distribution...");
487 - if (run_command(NULL, "pkgmk -o -f %s/%s.prototype -d %s/%s",
488 - directory, prodname, current, directory))
492 - * Tar and compress the distribution...
496 - puts("Creating tar.gz file for distribution...");
498 - snprintf(filename, sizeof(filename), "%s/%s.tar.gz", directory, name);
500 - if ((tarfile = tar_open(filename, 1)) == NULL)
503 - snprintf(filename, sizeof(filename), "%s/%s", directory, prodname);
505 - if (tar_directory(tarfile, filename, prodname))
507 - tar_close(tarfile);
511 - tar_close(tarfile);
514 - * Make a package stream file...
518 - puts("Copying into package stream file...");
520 - if (run_command(directory, "pkgtrans -s %s/%s %s.pkg %s",
521 - current, directory, name, prodname))
525 - * Remove temporary files...
531 - puts("Removing temporary distribution files...");
533 - snprintf(filename, sizeof(filename), "%s/%s.pkginfo", directory, prodname);
535 - snprintf(filename, sizeof(filename), "%s/%s.depend", directory, prodname);
537 - snprintf(filename, sizeof(filename), "%s/%s.prototype", directory, prodname);
540 - unlink(preinstall);
541 - if (postinstall[0])
542 - unlink(postinstall);
546 - unlink(postremove);
553 *** misc/epm-3.7/qprintf.c Mon Jan 27 22:48:03 2003
554 --- misc/build/epm-3.7/qprintf.c Mon Nov 20 14:54:51 2006
558 for (i = slen; i > 0; i --, s ++, bytes ++)
560 if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s))
571 for (i = slen; i > 0; i --, s ++, bytes ++)
573 + #if defined(__FreeBSD__)
574 + if (strchr("`~!#%^&*()[{]}\\|;\'\"<>? ", *s))
580 if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s))
589 *** misc/epm-3.7/rpm.c Wed Oct 1 21:27:15 2003
590 --- misc/build/epm-3.7/rpm.c Mon Nov 20 14:54:51 2006
593 dist_t *dist, /* I - Distribution information */
594 struct utsname *platform) /* I - Platform information */
596 ! int i; /* Looping var */
597 FILE *fp; /* Spec file */
598 char name[1024]; /* Full product name */
599 char specname[1024]; /* Spec filename */
601 dist_t *dist, /* I - Distribution information */
602 struct utsname *platform) /* I - Platform information */
604 ! int i,n; /* Looping vars */
605 FILE *fp; /* Spec file */
606 char name[1024]; /* Full product name */
607 char specname[1024]; /* Spec filename */
611 fprintf(fp, "Requires: %s", dname);
612 else if (d->type == DEPEND_PROVIDES)
613 fprintf(fp, "Provides: %s", dname);
614 + else if (d->type == DEPEND_REPLACES)
615 + fprintf(fp, "Obsoletes: %s", dname);
617 fprintf(fp, "Conflicts: %s", dname);
621 for (i = 0; i < dist->num_descriptions; i ++)
622 fprintf(fp, "%s\n", dist->descriptions[i]);
624 ! fputs("%pre\n", fp);
625 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
626 if (c->type == COMMAND_PRE_INSTALL)
627 fprintf(fp, "%s\n", c->command);
629 ! fputs("%post\n", fp);
630 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
631 if (c->type == COMMAND_POST_INSTALL)
632 fprintf(fp, "%s\n", c->command);
634 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
635 if (tolower(file->type) == 'i')
637 for (i = 0; i < dist->num_descriptions; i ++)
638 fprintf(fp, "%s\n", dist->descriptions[i]);
644 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
646 if (c->type == COMMAND_PRE_INSTALL)
648 + if (1 == ++n) /* Only write %pre if there is at least one command */
649 + fputs("%pre\n", fp);
650 fprintf(fp, "%s\n", c->command);
658 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
660 if (c->type == COMMAND_POST_INSTALL)
662 + if (1 == ++n) /* Only write %post if there is at least one command */
663 + fputs("%post\n", fp);
664 fprintf(fp, "%s\n", c->command);
668 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
669 if (tolower(file->type) == 'i')
676 + if (1 == ++n) /* If not previously done so, write %post here */
677 + fputs("%post\n", fp);
678 fputs("if test \"x$1\" = x1; then\n", fp);
679 fputs(" echo Setting up init scripts...\n", fp);
686 ! fputs("%preun\n", fp);
687 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
688 if (tolower(file->type) == 'i')
698 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
699 if (tolower(file->type) == 'i')
707 + fputs("%preun\n", fp); ++n; /* Need to write %preun here */
708 fputs("if test \"x$1\" = x0; then\n", fp);
709 fputs(" echo Cleaning up init scripts...\n", fp);
715 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
716 if (c->type == COMMAND_PRE_REMOVE)
717 fprintf(fp, "%s\n", c->command);
719 ! fputs("%postun\n", fp);
720 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
721 if (c->type == COMMAND_POST_REMOVE)
722 fprintf(fp, "%s\n", c->command);
724 fputs("%files\n", fp);
725 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
729 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
731 if (c->type == COMMAND_PRE_REMOVE)
733 + if (1 == ++n) /* Only write %preun if not previously done so */
734 + fputs("%preun\n", fp);
736 fprintf(fp, "%s\n", c->command);
744 for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
746 if (c->type == COMMAND_POST_REMOVE)
748 + if (1 == ++n) /* Only write %post if there is at least one command */
749 + fputs("%postun\n", fp);
750 fprintf(fp, "%s\n", c->command);
754 fputs("%files\n", fp);
755 for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
762 - * Build the distribution from the spec file...
766 - puts("Building RPM binary distribution...");
768 - if (strcmp(platform->machine, "intel") == 0)
770 - if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "i386 %s",
771 - Verbosity == 0 ? "--quiet" : "", specname))
774 - else if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "%s %s",
775 - Verbosity == 0 ? "--quiet" : "", platform->machine,
780 - * Move the RPM to the local directory and rename the RPM using the
781 - * product name specified by the user...
784 - if (strcmp(platform->machine, "intel") == 0)
785 - run_command(NULL, "/bin/mv %s/RPMS/i386/%s-%s-%d.i386.rpm %s/%s.rpm",
786 - rpmdir, prodname, dist->version, dist->relnumber,
789 - run_command(NULL, "/bin/mv %s/RPMS/%s/%s-%s-%d.%s.rpm %s/%s.rpm",
790 - rpmdir, platform->machine, prodname, dist->version,
791 - dist->relnumber, platform->machine, directory, name);
794 - * Remove temporary files...
800 - puts("Removing temporary distribution files...");
802 - run_command(NULL, "/bin/rm -rf %s/RPMS", directory);
803 - run_command(NULL, "/bin/rm -rf %s/buildroot", directory);