parent
23e11dc776
commit
c07b00f296
@ -1,4 +1 @@
|
|||||||
DIST logrotate-3.7.8.tar.gz 43246 RMD160 c90de0efe013b533eff50bb52e2bf6948b839572 SHA1 5742dc0d9541ac59eba5f5718520f7504aea2159 SHA256 21aa3dc830e8cc895ee4199d9325aa1e37cd3b525d0eaef400f66f6c7fc536dd
|
|
||||||
DIST logrotate-3.7.9.tar.gz 45301 RMD160 e3fb77e37c454a52566f7d5b017d70c9dddf9b66 SHA1 b920f9664a2c930f1ccdabc0db4f31f67cf95661 SHA256 080caf904e70e04da16b8dfa95a5a787ec7d722ee1af18ccea437d3ffdd6fec0
|
|
||||||
DIST logrotate-3.8.0.tar.gz 48199 RMD160 7e1e24f53db5230eee2e1db8d90fe3a33692ca01 SHA1 a79c500c4ce45177b47bb473a6bff4021af7121e SHA256 5e52edc8c1894ab079ea3666cfd828085e3949388703f7236c39b2d20968536e
|
|
||||||
DIST logrotate-3.8.1.tar.gz 48827 RMD160 cec3bc6a4cb4226b31696977935818695027b0f8 SHA1 1df36cee76a9c4c7438f35ca3599a7bdd68a09b5 SHA256 c12471e70ae8bc923bd5c4f25e8fd6483b68c6301f3cd79f7cfe37bc5b370169
|
DIST logrotate-3.8.1.tar.gz 48827 RMD160 cec3bc6a4cb4226b31696977935818695027b0f8 SHA1 1df36cee76a9c4c7438f35ca3599a7bdd68a09b5 SHA256 c12471e70ae8bc923bd5c4f25e8fd6483b68c6301f3cd79f7cfe37bc5b370169
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
Fix compilation on Gentoo/FreeBSD, no alloca.h here and PATH_MAX
|
|
||||||
is defined elsewhere.
|
|
||||||
|
|
||||||
See bug 254795
|
|
||||||
|
|
||||||
--- logrotate-3.7.7.orig/config.c
|
|
||||||
+++ logrotate-3.7.7/config.c
|
|
||||||
@@ -1,5 +1,7 @@
|
|
||||||
#include <sys/queue.h>
|
|
||||||
+#ifndef NO_ALLOCA_H
|
|
||||||
#include <alloca.h>
|
|
||||||
+#endif /* NO_ALLOCA_H */
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <errno.h>
|
|
||||||
@@ -21,6 +21,9 @@
|
|
||||||
#include <wctype.h>
|
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
+#if !defined(PATH_MAX) && defined(__FreeBSD__)
|
|
||||||
+#include <sys/param.h>
|
|
||||||
+#endif
|
|
||||||
#include "basenames.h"
|
|
||||||
#include "log.h"
|
|
||||||
#include "logrotate.h"
|
|
||||||
--- logrotate-3.7.7.orig/logrotate.c
|
|
||||||
+++ logrotate-3.7.7/logrotate.c
|
|
||||||
@@ -1,5 +1,7 @@
|
|
||||||
#include <sys/queue.h>
|
|
||||||
+#ifndef NO_ALLOCA_H
|
|
||||||
#include <alloca.h>
|
|
||||||
+#endif /* NO_ALLOCA_H */
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <errno.h>
|
|
||||||
@@ -24,6 +24,9 @@
|
|
||||||
int selinux_enforce = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if !defined(PATH_MAX) && defined(__FreeBSD__)
|
|
||||||
+#include <sys/param.h>
|
|
||||||
+#endif
|
|
||||||
#include "basenames.h"
|
|
||||||
#include "log.h"
|
|
||||||
#include "logrotate.h"
|
|
@ -1,15 +0,0 @@
|
|||||||
diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN logrotate-3.7.7.orig/config.c logrotate-3.7.7/config.c
|
|
||||||
--- logrotate-3.7.7.orig/config.c 2008-05-09 03:28:59.000000000 -0400
|
|
||||||
+++ logrotate-3.7.7/config.c 2008-12-23 11:11:18.000000000 -0500
|
|
||||||
@@ -164,6 +164,11 @@ static int checkFile(const char *fname)
|
|
||||||
if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2])))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
+ /* Don't include 'hidden' files either; this breaks Gentoo
|
|
||||||
+ portage config file management http://bugs.gentoo.org/87683 */
|
|
||||||
+ if (fname[0] == '.')
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
/* Check if fname is ending in a taboo-extension; if so, return false */
|
|
||||||
for (i = 0; i < tabooCount; i++) {
|
|
||||||
snprintf(pattern, sizeof(pattern), "*%s", tabooExts[i]);
|
|
@ -1,28 +0,0 @@
|
|||||||
diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN logrotate-3.7.7.orig/logrotate.c logrotate-3.7.7/logrotate.c
|
|
||||||
--- logrotate-3.7.7.orig/logrotate.c 2008-05-14 06:31:35.000000000 -0400
|
|
||||||
+++ logrotate-3.7.7/logrotate.c 2008-12-23 11:14:55.000000000 -0500
|
|
||||||
@@ -512,16 +512,17 @@ int findNeedRotating(struct logInfo *log
|
|
||||||
switch (log->criterium) {
|
|
||||||
case ROT_WEEKLY:
|
|
||||||
/* rotate if:
|
|
||||||
- 1) the current weekday is before the weekday of the
|
|
||||||
- last rotation
|
|
||||||
+ 1) the day of the week is the same as the day of the week of
|
|
||||||
+ the previous rotation but not the same day of the year
|
|
||||||
+ this will rotate it on the same day every week, but not
|
|
||||||
+ twice a day.
|
|
||||||
2) more then a week has passed since the last
|
|
||||||
rotation */
|
|
||||||
- state->doRotate = ((now.tm_wday < state->lastRotated.tm_wday)
|
|
||||||
- ||
|
|
||||||
- ((mktime(&now) -
|
|
||||||
- mktime(&state->lastRotated)) >
|
|
||||||
+ state->doRotate = ((now.tm_wday == state->lastRotated.tm_wday &&
|
|
||||||
+ now.tm_yday != state->lastRotated.tm_yday) ||
|
|
||||||
+ ((mktime(&now) - mktime(&state->lastRotated)) >
|
|
||||||
(7 * 24 * 3600)));
|
|
||||||
- break;
|
|
||||||
+ break;
|
|
||||||
case ROT_MONTHLY:
|
|
||||||
/* rotate if the logs haven't been rotated this month or
|
|
||||||
this year */
|
|
@ -1,70 +0,0 @@
|
|||||||
diff --git a/logrotate.c b/logrotate.c
|
|
||||||
index 3748918..fbe232a 100644
|
|
||||||
--- a/logrotate.c
|
|
||||||
+++ b/logrotate.c
|
|
||||||
@@ -194,31 +194,41 @@ static int runScript(char *logfn, char *script)
|
|
||||||
int createOutputFile(char *fileName, int flags, struct stat *sb)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
+ char template[PATH_MAX + 1];
|
|
||||||
+ mode_t umask_value;
|
|
||||||
+ snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName));
|
|
||||||
+
|
|
||||||
+ umask_value = umask(0000);
|
|
||||||
+ fd = mkstemp(template);
|
|
||||||
+ umask(umask_value);
|
|
||||||
+
|
|
||||||
+ if (fd < 0) {
|
|
||||||
+ message(MESS_ERROR, "error creating unique temp file: %s\n",
|
|
||||||
+ strerror(errno));
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (fchown(fd, sb->st_uid, sb->st_gid)) {
|
|
||||||
+ message(MESS_ERROR, "error setting owner of %s: %s\n",
|
|
||||||
+ fileName, strerror(errno));
|
|
||||||
+ close(fd);
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (fchmod(fd, sb->st_mode)) {
|
|
||||||
+ message(MESS_ERROR, "error setting mode of %s: %s\n",
|
|
||||||
+ fileName, strerror(errno));
|
|
||||||
+ close(fd);
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (rename(template, fileName)) {
|
|
||||||
+ message(MESS_ERROR, "error renaming temp file to %s: %s\n",
|
|
||||||
+ fileName, strerror(errno));
|
|
||||||
+ close(fd);
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- fd = open(fileName, flags, sb->st_mode);
|
|
||||||
- if (fd < 0) {
|
|
||||||
- message(MESS_ERROR, "error creating output file %s: %s\n",
|
|
||||||
- fileName, strerror(errno));
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
- if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) {
|
|
||||||
- message(MESS_ERROR, "error setting mode of %s: %s\n",
|
|
||||||
- fileName, strerror(errno));
|
|
||||||
- close(fd);
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
- if (fchown(fd, sb->st_uid, sb->st_gid)) {
|
|
||||||
- message(MESS_ERROR, "error setting owner of %s: %s\n",
|
|
||||||
- fileName, strerror(errno));
|
|
||||||
- close(fd);
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
- if (fchmod(fd, sb->st_mode)) {
|
|
||||||
- message(MESS_ERROR, "error setting mode of %s: %s\n",
|
|
||||||
- fileName, strerror(errno));
|
|
||||||
- close(fd);
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
return fd;
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN logrotate-3.7.9.orig//config.c logrotate-3.7.9/config.c
|
|
||||||
--- logrotate-3.7.9.orig//config.c 2010-06-28 04:04:56.000000000 -0400
|
|
||||||
+++ logrotate-3.7.9/config.c 2011-04-28 19:16:55.422051174 -0400
|
|
||||||
@@ -514,12 +514,19 @@ static int readConfigFile(const char *co
|
|
||||||
.l_whence = SEEK_SET,
|
|
||||||
.l_type = F_RDLCK
|
|
||||||
};
|
|
||||||
+ int flags;
|
|
||||||
|
|
||||||
/* FIXME: createOwner and createGroup probably shouldn't be fixed
|
|
||||||
length arrays -- of course, if we aren't run setuid it doesn't
|
|
||||||
matter much */
|
|
||||||
|
|
||||||
- fd = open(configFile, O_RDONLY | O_CLOEXEC);
|
|
||||||
+#ifdef O_CLOEXEC
|
|
||||||
+ flags = O_RDONLY | O_CLOEXEC;
|
|
||||||
+#else
|
|
||||||
+ flags = O_RDONLY;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ fd = open(configFile, flags);
|
|
||||||
if (fd < 0) {
|
|
||||||
message(MESS_ERROR, "failed to open config file %s: %s\n",
|
|
||||||
configFile, strerror(errno));
|
|
@ -1,151 +0,0 @@
|
|||||||
diff --git a/logrotate.c b/logrotate.c
|
|
||||||
index 95bc80b..8dfb3d7 100644
|
|
||||||
--- a/logrotate.c
|
|
||||||
+++ b/logrotate.c
|
|
||||||
@@ -56,7 +56,7 @@ int debug = 0;
|
|
||||||
char *mailCommand = DEFAULT_MAIL_COMMAND;
|
|
||||||
time_t nowSecs = 0;
|
|
||||||
|
|
||||||
-static int shred_file(char *filename, struct logInfo *log);
|
|
||||||
+static int shred_file(int fd, char *filename, struct logInfo *log);
|
|
||||||
|
|
||||||
static int globerr(const char *pathname, int theerr)
|
|
||||||
{
|
|
||||||
@@ -216,59 +216,79 @@ int createOutputFile(char *fileName, int flags, struct stat *sb)
|
|
||||||
return fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
-#define SHRED_CALL "shred -u "
|
|
||||||
-#define SHRED_COUNT_FLAG "-n "
|
|
||||||
#define DIGITS 10
|
|
||||||
+
|
|
||||||
/* unlink, but try to call shred from GNU fileutils */
|
|
||||||
-static int shred_file(char *filename, struct logInfo *log)
|
|
||||||
+static int shred_file(int fd, char *filename, struct logInfo *log)
|
|
||||||
{
|
|
||||||
- int len, ret;
|
|
||||||
- char *cmd;
|
|
||||||
char count[DIGITS]; /* that's a lot of shredding :) */
|
|
||||||
+ const char **fullCommand;
|
|
||||||
+ int id = 0;
|
|
||||||
+ int status;
|
|
||||||
|
|
||||||
if (!(log->flags & LOG_FLAG_SHRED)) {
|
|
||||||
return unlink(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
- len = strlen(filename) + strlen(SHRED_CALL);
|
|
||||||
- len += strlen(SHRED_COUNT_FLAG) + DIGITS;
|
|
||||||
- cmd = malloc(len);
|
|
||||||
+ message(MESS_DEBUG, "Using shred to remove the file %s\n", filename);
|
|
||||||
|
|
||||||
- if (!cmd) {
|
|
||||||
- message(MESS_ERROR, "malloc error while shredding");
|
|
||||||
- return unlink(filename);
|
|
||||||
+ if (log->shred_cycles != 0) {
|
|
||||||
+ fullCommand = alloca(sizeof(*fullCommand) * 6);
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ fullCommand = alloca(sizeof(*fullCommand) * 4);
|
|
||||||
}
|
|
||||||
- strcpy(cmd, SHRED_CALL);
|
|
||||||
+ fullCommand[id++] = "shred";
|
|
||||||
+ fullCommand[id++] = "-u";
|
|
||||||
+
|
|
||||||
if (log->shred_cycles != 0) {
|
|
||||||
- strcat(cmd, SHRED_COUNT_FLAG);
|
|
||||||
+ fullCommand[id++] = "-n";
|
|
||||||
snprintf(count, DIGITS - 1, "%d", log->shred_cycles);
|
|
||||||
- strcat(count, " ");
|
|
||||||
- strcat(cmd, count);
|
|
||||||
+ fullCommand[id++] = count;
|
|
||||||
+ }
|
|
||||||
+ fullCommand[id++] = "-";
|
|
||||||
+ fullCommand[id++] = NULL;
|
|
||||||
+
|
|
||||||
+ if (!fork()) {
|
|
||||||
+ dup2(fd, 1);
|
|
||||||
+ close(fd);
|
|
||||||
+
|
|
||||||
+ execvp(fullCommand[0], (void *) fullCommand);
|
|
||||||
+ exit(1);
|
|
||||||
}
|
|
||||||
- strcat(cmd, filename);
|
|
||||||
- ret = system(cmd);
|
|
||||||
- free(cmd);
|
|
||||||
- if (ret != 0) {
|
|
||||||
+
|
|
||||||
+ wait(&status);
|
|
||||||
+
|
|
||||||
+ if (!WIFEXITED(status) || WEXITSTATUS(status)) {
|
|
||||||
message(MESS_ERROR, "Failed to shred %s\n, trying unlink", filename);
|
|
||||||
- if (ret != -1) {
|
|
||||||
- message(MESS_NORMAL, "Shred returned %d\n", ret);
|
|
||||||
- }
|
|
||||||
return unlink(filename);
|
|
||||||
- } else {
|
|
||||||
- return ret;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ /* We have to unlink it after shred anyway,
|
|
||||||
+ * because it doesn't remove the file itself */
|
|
||||||
+ return unlink(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int removeLogFile(char *name, struct logInfo *log)
|
|
||||||
{
|
|
||||||
- message(MESS_DEBUG, "removing old log %s\n", name);
|
|
||||||
+ int fd;
|
|
||||||
+ message(MESS_DEBUG, "removing old log %s\n", name);
|
|
||||||
|
|
||||||
- if (!debug && shred_file(name, log)) {
|
|
||||||
- message(MESS_ERROR, "Failed to remove old log %s: %s\n",
|
|
||||||
- name, strerror(errno));
|
|
||||||
- return 1;
|
|
||||||
- }
|
|
||||||
- return 0;
|
|
||||||
+ if ((fd = open(name, O_RDWR)) < 0) {
|
|
||||||
+ message(MESS_ERROR, "error opening %s: %s\n",
|
|
||||||
+ name, strerror(errno));
|
|
||||||
+ return 1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (!debug && shred_file(fd, name, log)) {
|
|
||||||
+ message(MESS_ERROR, "Failed to remove old log %s: %s\n",
|
|
||||||
+ name, strerror(errno));
|
|
||||||
+ close(fd);
|
|
||||||
+ return 1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ close(fd);
|
|
||||||
+ return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int compressLogFile(char *name, struct logInfo *log, struct stat *sb)
|
|
||||||
@@ -294,7 +314,7 @@ static int compressLogFile(char *name, struct logInfo *log, struct stat *sb)
|
|
||||||
compressedName = alloca(strlen(name) + strlen(log->compress_ext) + 2);
|
|
||||||
sprintf(compressedName, "%s%s", name, log->compress_ext);
|
|
||||||
|
|
||||||
- if ((inFile = open(name, O_RDONLY)) < 0) {
|
|
||||||
+ if ((inFile = open(name, O_RDWR)) < 0) {
|
|
||||||
message(MESS_ERROR, "unable to open %s for compression\n", name);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
@@ -316,7 +336,6 @@ static int compressLogFile(char *name, struct logInfo *log, struct stat *sb)
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
- close(inFile);
|
|
||||||
close(outFile);
|
|
||||||
|
|
||||||
wait(&status);
|
|
||||||
@@ -326,7 +345,8 @@ static int compressLogFile(char *name, struct logInfo *log, struct stat *sb)
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- shred_file(name, log);
|
|
||||||
+ shred_file(inFile, name, log);
|
|
||||||
+ close(inFile);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN logrotate-3.7.9.orig/config.c logrotate-3.7.9/config.c
|
|
||||||
--- logrotate-3.7.9.orig/config.c 2010-06-28 04:04:56.000000000 -0400
|
|
||||||
+++ logrotate-3.7.9/config.c 2011-04-17 10:51:13.697645782 -0400
|
|
||||||
@@ -546,6 +546,15 @@ static int readConfigFile(const char *co
|
|
||||||
}
|
|
||||||
|
|
||||||
length = sb.st_size;
|
|
||||||
+ /* We can't mmap empty file... */
|
|
||||||
+ if (length == 0) {
|
|
||||||
+ message(MESS_DEBUG,
|
|
||||||
+ "Ignoring %s because it's empty.\n",
|
|
||||||
+ configFile);
|
|
||||||
+ close(fd);
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
buf = mmap(NULL, (size_t)(length + 2), PROT_READ | PROT_WRITE,
|
|
||||||
MAP_PRIVATE | MAP_POPULATE, fd, (off_t) 0);
|
|
||||||
if (buf == MAP_FAILED) {
|
|
@ -1,96 +0,0 @@
|
|||||||
Index: logrotate.c
|
|
||||||
===================================================================
|
|
||||||
--- logrotate.c (revision 314)
|
|
||||||
+++ logrotate.c (working copy)
|
|
||||||
@@ -45,6 +45,12 @@
|
|
||||||
#define GLOB_ABORTED GLOB_ABEND
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#ifdef PATH_MAX
|
|
||||||
+#define STATEFILE_BUFFER_SIZE 2 * PATH_MAX + 16
|
|
||||||
+#else
|
|
||||||
+#define STATEFILE_BUFFER_SIZE 4096
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
struct logState {
|
|
||||||
char *fn;
|
|
||||||
struct tm lastRotated; /* only tm.mon, tm_mday, tm_year are good! */
|
|
||||||
@@ -82,6 +88,34 @@
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void unescape(char *arg)
|
|
||||||
+{
|
|
||||||
+ char *p = arg;
|
|
||||||
+ char *next;
|
|
||||||
+ char escaped;
|
|
||||||
+ while ((next = strchr(p, '\\')) != NULL) {
|
|
||||||
+
|
|
||||||
+ p = next;
|
|
||||||
+
|
|
||||||
+ switch (p[1]) {
|
|
||||||
+ case 'n':
|
|
||||||
+ escaped = '\n';
|
|
||||||
+ break;
|
|
||||||
+ case '\\':
|
|
||||||
+ escaped = '\\';
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ ++p;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Overwrite the backslash with the intended character,
|
|
||||||
+ * and shift everything down one */
|
|
||||||
+ *p++ = escaped;
|
|
||||||
+ memmove(p, p+1, 1 + strlen(p+1));
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#define HASH_SIZE_MIN 64
|
|
||||||
static int allocateHash(void)
|
|
||||||
{
|
|
||||||
@@ -1546,7 +1580,13 @@
|
|
||||||
for (chptr = p->fn; *chptr; chptr++) {
|
|
||||||
switch (*chptr) {
|
|
||||||
case '"':
|
|
||||||
+ case '\\':
|
|
||||||
fputc('\\', f);
|
|
||||||
+ break;
|
|
||||||
+ case '\n':
|
|
||||||
+ fputc('\\', f);
|
|
||||||
+ fputc('n', f);
|
|
||||||
+ continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
fputc(*chptr, f);
|
|
||||||
@@ -1567,7 +1607,8 @@
|
|
||||||
static int readState(char *stateFilename)
|
|
||||||
{
|
|
||||||
FILE *f;
|
|
||||||
- char buf[1024];
|
|
||||||
+ char buf[STATEFILE_BUFFER_SIZE];
|
|
||||||
+ char *filename;
|
|
||||||
const char **argv;
|
|
||||||
int argc;
|
|
||||||
int year, month, day;
|
|
||||||
@@ -1678,7 +1719,10 @@
|
|
||||||
|
|
||||||
year -= 1900, month -= 1;
|
|
||||||
|
|
||||||
- if ((st = findState(argv[0])) == NULL)
|
|
||||||
+ filename = strdup(argv[0]);
|
|
||||||
+ unescape(filename);
|
|
||||||
+
|
|
||||||
+ if ((st = findState(filename)) == NULL)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
st->lastRotated.tm_mon = month;
|
|
||||||
@@ -1690,6 +1734,7 @@
|
|
||||||
st->lastRotated = *localtime(&lr_time);
|
|
||||||
|
|
||||||
free(argv);
|
|
||||||
+ free(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(f);
|
|
@ -1,55 +0,0 @@
|
|||||||
diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN logrotate-3.8.0.orig/config.c logrotate-3.8.0/config.c
|
|
||||||
--- logrotate-3.8.0.orig/config.c 2011-06-21 04:12:02.000000000 -0400
|
|
||||||
+++ logrotate-3.8.0/config.c 2011-07-12 13:47:36.274319050 -0400
|
|
||||||
@@ -41,39 +41,6 @@
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-#if !defined(asprintf)
|
|
||||||
-#include <stdarg.h>
|
|
||||||
-
|
|
||||||
-int asprintf(char **string_ptr, const char *format, ...)
|
|
||||||
-{
|
|
||||||
- va_list arg;
|
|
||||||
- char *str;
|
|
||||||
- int size;
|
|
||||||
- int rv;
|
|
||||||
-
|
|
||||||
- va_start(arg, format);
|
|
||||||
- size = vsnprintf(NULL, 0, format, arg);
|
|
||||||
- size++;
|
|
||||||
- va_start(arg, format);
|
|
||||||
- str = malloc(size);
|
|
||||||
- if (str == NULL) {
|
|
||||||
- va_end(arg);
|
|
||||||
- /*
|
|
||||||
- * Strictly speaking, GNU asprintf doesn't do this,
|
|
||||||
- * but the caller isn't checking the return value.
|
|
||||||
- */
|
|
||||||
- fprintf(stderr, "failed to allocate memory\\n");
|
|
||||||
- exit(1);
|
|
||||||
- }
|
|
||||||
- rv = vsnprintf(str, size, format, arg);
|
|
||||||
- va_end(arg);
|
|
||||||
-
|
|
||||||
- *string_ptr = str;
|
|
||||||
- return (rv);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
enum {
|
|
||||||
STATE_DEFAULT = 2,
|
|
||||||
STATE_SKIP_LINE = 4,
|
|
||||||
diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN logrotate-3.8.0.orig/logrotate.h logrotate-3.8.0/logrotate.h
|
|
||||||
--- logrotate-3.8.0.orig/logrotate.h 2011-06-21 04:12:02.000000000 -0400
|
|
||||||
+++ logrotate-3.8.0/logrotate.h 2011-07-12 13:47:38.949285608 -0400
|
|
||||||
@@ -66,8 +66,5 @@ extern int numLogs;
|
|
||||||
extern int debug;
|
|
||||||
|
|
||||||
int readAllConfigPaths(const char **paths);
|
|
||||||
-#if !defined(asprintf)
|
|
||||||
-int asprintf(char **string_ptr, const char *format, ...);
|
|
||||||
-#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,72 +0,0 @@
|
|||||||
# Copyright 1999-2011 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/logrotate-3.7.8.ebuild,v 1.14 2011/07/08 10:15:59 ssuominen Exp $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic
|
|
||||||
|
|
||||||
DESCRIPTION="Rotates, compresses, and mails system logs"
|
|
||||||
HOMEPAGE="https://fedorahosted.org/logrotate/"
|
|
||||||
SRC_URI="https://fedorahosted.org/releases/l/o/logrotate/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
|
|
||||||
IUSE="selinux"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
>=dev-libs/popt-1.5
|
|
||||||
selinux? (
|
|
||||||
sys-libs/libselinux
|
|
||||||
sec-policy/selinux-logrotate
|
|
||||||
)"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
>=sys-apps/sed-4"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
strip-flags
|
|
||||||
|
|
||||||
epatch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-datehack.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-ignore-hidden.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-weekly.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-fbsd.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
local myconf
|
|
||||||
myconf="CC=$(tc-getCC)"
|
|
||||||
use selinux && myconf="${myconf} WITH_SELINUX=yes"
|
|
||||||
use elibc_FreeBSD && append-flags -DNO_ALLOCA_H
|
|
||||||
emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}" || die "emake failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
insinto /usr
|
|
||||||
dosbin logrotate
|
|
||||||
doman logrotate.8
|
|
||||||
dodoc examples/logrotate*
|
|
||||||
|
|
||||||
exeinto /etc/cron.daily
|
|
||||||
doexe "${FILESDIR}"/logrotate.cron
|
|
||||||
|
|
||||||
insinto /etc
|
|
||||||
doins "${FILESDIR}"/logrotate.conf
|
|
||||||
|
|
||||||
keepdir /etc/logrotate.d
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If you wish to have logrotate e-mail you updates, please"
|
|
||||||
elog "emerge virtual/mailx and configure logrotate in"
|
|
||||||
elog "/etc/logrotate.conf appropriately"
|
|
||||||
elog
|
|
||||||
elog "Additionally, /etc/logrotate.conf may need to be modified"
|
|
||||||
elog "for your particular needs. See man logrotate for details."
|
|
||||||
}
|
|
@ -1,76 +0,0 @@
|
|||||||
# Copyright 1999-2011 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/logrotate-3.7.9-r1.ebuild,v 1.9 2011/07/08 10:15:59 ssuominen Exp $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic
|
|
||||||
|
|
||||||
DESCRIPTION="Rotates, compresses, and mails system logs"
|
|
||||||
HOMEPAGE="https://fedorahosted.org/logrotate/"
|
|
||||||
SRC_URI="https://fedorahosted.org/releases/l/o/logrotate/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
|
|
||||||
IUSE="selinux"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
>=dev-libs/popt-1.5
|
|
||||||
selinux? (
|
|
||||||
sys-libs/libselinux
|
|
||||||
sec-policy/selinux-logrotate
|
|
||||||
)"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
>=sys-apps/sed-4"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
strip-flags
|
|
||||||
|
|
||||||
epatch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-datehack.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-ignore-hidden.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-weekly.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-fbsd.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-atomic-create.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-shred.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-statefile.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-no-cloexec.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
local myconf
|
|
||||||
myconf="CC=$(tc-getCC)"
|
|
||||||
use selinux && myconf="${myconf} WITH_SELINUX=yes"
|
|
||||||
use elibc_FreeBSD && append-flags -DNO_ALLOCA_H
|
|
||||||
emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}" || die "emake failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
insinto /usr
|
|
||||||
dosbin logrotate
|
|
||||||
doman logrotate.8
|
|
||||||
dodoc examples/logrotate*
|
|
||||||
|
|
||||||
exeinto /etc/cron.daily
|
|
||||||
doexe "${FILESDIR}"/logrotate.cron
|
|
||||||
|
|
||||||
insinto /etc
|
|
||||||
doins "${FILESDIR}"/logrotate.conf
|
|
||||||
|
|
||||||
keepdir /etc/logrotate.d
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If you wish to have logrotate e-mail you updates, please"
|
|
||||||
elog "emerge virtual/mailx and configure logrotate in"
|
|
||||||
elog "/etc/logrotate.conf appropriately"
|
|
||||||
elog
|
|
||||||
elog "Additionally, /etc/logrotate.conf may need to be modified"
|
|
||||||
elog "for your particular needs. See man logrotate for details."
|
|
||||||
}
|
|
@ -1,76 +0,0 @@
|
|||||||
# Copyright 1999-2011 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/logrotate-3.7.9-r2.ebuild,v 1.3 2011/07/08 10:15:59 ssuominen Exp $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic
|
|
||||||
|
|
||||||
DESCRIPTION="Rotates, compresses, and mails system logs"
|
|
||||||
HOMEPAGE="https://fedorahosted.org/logrotate/"
|
|
||||||
SRC_URI="https://fedorahosted.org/releases/l/o/logrotate/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
|
|
||||||
IUSE="selinux"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
>=dev-libs/popt-1.5
|
|
||||||
selinux? (
|
|
||||||
sys-libs/libselinux
|
|
||||||
sec-policy/selinux-logrotate
|
|
||||||
)"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
>=sys-apps/sed-4"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
strip-flags
|
|
||||||
|
|
||||||
epatch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-datehack.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-ignore-hidden.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-fbsd.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-atomic-create.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-shred.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-statefile.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-no-cloexec.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.9-skip-empty-files.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
local myconf
|
|
||||||
myconf="CC=$(tc-getCC)"
|
|
||||||
use selinux && myconf="${myconf} WITH_SELINUX=yes"
|
|
||||||
use elibc_FreeBSD && append-flags -DNO_ALLOCA_H
|
|
||||||
emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}" || die "emake failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
insinto /usr
|
|
||||||
dosbin logrotate
|
|
||||||
doman logrotate.8
|
|
||||||
dodoc examples/logrotate*
|
|
||||||
|
|
||||||
exeinto /etc/cron.daily
|
|
||||||
doexe "${FILESDIR}"/logrotate.cron
|
|
||||||
|
|
||||||
insinto /etc
|
|
||||||
doins "${FILESDIR}"/logrotate.conf
|
|
||||||
|
|
||||||
keepdir /etc/logrotate.d
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If you wish to have logrotate e-mail you updates, please"
|
|
||||||
elog "emerge virtual/mailx and configure logrotate in"
|
|
||||||
elog "/etc/logrotate.conf appropriately"
|
|
||||||
elog
|
|
||||||
elog "Additionally, /etc/logrotate.conf may need to be modified"
|
|
||||||
elog "for your particular needs. See man logrotate for details."
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
# Copyright 1999-2011 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/logrotate-3.7.9.ebuild,v 1.2 2011/07/08 10:15:59 ssuominen Exp $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic
|
|
||||||
|
|
||||||
DESCRIPTION="Rotates, compresses, and mails system logs"
|
|
||||||
HOMEPAGE="https://fedorahosted.org/logrotate/"
|
|
||||||
SRC_URI="https://fedorahosted.org/releases/l/o/logrotate/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
|
|
||||||
IUSE="selinux"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
>=dev-libs/popt-1.5
|
|
||||||
selinux? (
|
|
||||||
sys-libs/libselinux
|
|
||||||
sec-policy/selinux-logrotate
|
|
||||||
)"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
>=sys-apps/sed-4"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
strip-flags
|
|
||||||
|
|
||||||
epatch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-datehack.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-ignore-hidden.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-weekly.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-fbsd.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
local myconf
|
|
||||||
myconf="CC=$(tc-getCC)"
|
|
||||||
use selinux && myconf="${myconf} WITH_SELINUX=yes"
|
|
||||||
use elibc_FreeBSD && append-flags -DNO_ALLOCA_H
|
|
||||||
emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}" || die "emake failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
insinto /usr
|
|
||||||
dosbin logrotate
|
|
||||||
doman logrotate.8
|
|
||||||
dodoc examples/logrotate*
|
|
||||||
|
|
||||||
exeinto /etc/cron.daily
|
|
||||||
doexe "${FILESDIR}"/logrotate.cron
|
|
||||||
|
|
||||||
insinto /etc
|
|
||||||
doins "${FILESDIR}"/logrotate.conf
|
|
||||||
|
|
||||||
keepdir /etc/logrotate.d
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If you wish to have logrotate e-mail you updates, please"
|
|
||||||
elog "emerge virtual/mailx and configure logrotate in"
|
|
||||||
elog "/etc/logrotate.conf appropriately"
|
|
||||||
elog
|
|
||||||
elog "Additionally, /etc/logrotate.conf may need to be modified"
|
|
||||||
elog "for your particular needs. See man logrotate for details."
|
|
||||||
}
|
|
@ -1,74 +0,0 @@
|
|||||||
# Copyright 1999-2011 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/logrotate-3.8.0.ebuild,v 1.9 2011/08/07 17:32:21 armin76 Exp $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic
|
|
||||||
|
|
||||||
DESCRIPTION="Rotates, compresses, and mails system logs"
|
|
||||||
HOMEPAGE="https://fedorahosted.org/logrotate/"
|
|
||||||
SRC_URI="https://fedorahosted.org/releases/l/o/logrotate/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
|
|
||||||
IUSE="acl selinux"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
>=dev-libs/popt-1.5
|
|
||||||
selinux? (
|
|
||||||
sys-libs/libselinux
|
|
||||||
sec-policy/selinux-logrotate
|
|
||||||
)
|
|
||||||
acl? ( virtual/acl )"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
>=sys-apps/sed-4"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
strip-flags
|
|
||||||
|
|
||||||
epatch \
|
|
||||||
"${FILESDIR}"/${PN}-3.7.7-datehack.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.8.0-ignore-hidden.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.8.0-fbsd.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.8.0-atomic-create.patch \
|
|
||||||
"${FILESDIR}"/${PN}-3.8.0-noasprintf.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
local myconf
|
|
||||||
myconf="CC=$(tc-getCC)"
|
|
||||||
use selinux && myconf="${myconf} WITH_SELINUX=yes"
|
|
||||||
use acl && myconf="${myconf} WITH_ACL=yes"
|
|
||||||
emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}" || die "emake failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
insinto /usr
|
|
||||||
dosbin logrotate
|
|
||||||
doman logrotate.8
|
|
||||||
dodoc CHANGES examples/logrotate*
|
|
||||||
|
|
||||||
exeinto /etc/cron.daily
|
|
||||||
doexe "${FILESDIR}"/logrotate.cron
|
|
||||||
|
|
||||||
insinto /etc
|
|
||||||
doins "${FILESDIR}"/logrotate.conf
|
|
||||||
|
|
||||||
keepdir /etc/logrotate.d
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If you wish to have logrotate e-mail you updates, please"
|
|
||||||
elog "emerge virtual/mailx and configure logrotate in"
|
|
||||||
elog "/etc/logrotate.conf appropriately"
|
|
||||||
elog
|
|
||||||
elog "Additionally, /etc/logrotate.conf may need to be modified"
|
|
||||||
elog "for your particular needs. See man logrotate for details."
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||||
<pkgmetadata>
|
<pkgmetadata>
|
||||||
<maintainer><email>dang@gentoo.org</email></maintainer>
|
<maintainer><email>maintainer-needed@gentoo.org</email></maintainer>
|
||||||
</pkgmetadata>
|
</pkgmetadata>
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
From c0afec5b46eb3508fd3b1449e37b7e550f7d35e2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gergely Nagy <algernon@balabit.hu>
|
||||||
|
Date: Fri, 08 Jun 2012 15:28:33 +0200
|
||||||
|
Subject: dnscache: Fix a memory corruption when destroying the DNS cache
|
||||||
|
|
||||||
|
The DNS cache gets destroyed every time a worker thread quits, which
|
||||||
|
is fine, as most of the dns cache variables are thread local.
|
||||||
|
|
||||||
|
However, dns_cache_hosts is not, it's a global static, and
|
||||||
|
dns_cache_destroy() was freeing that aswell.
|
||||||
|
|
||||||
|
The solution is to not free dns_cache_hosts when a worker stops, but
|
||||||
|
do so when syslog-ng stops. This patch introduces dns_cache_deinit()
|
||||||
|
which does just that, and removes the same thing from
|
||||||
|
dns_cache_destroy(), which now only touches thread-local variables.
|
||||||
|
|
||||||
|
Reported-by: EgonB <egon@local.ee>
|
||||||
|
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
||||||
|
---
|
||||||
|
diff --git a/lib/dnscache.c b/lib/dnscache.c
|
||||||
|
index 49102b7..9cdc2c0 100644
|
||||||
|
--- a/lib/dnscache.c
|
||||||
|
+++ b/lib/dnscache.c
|
||||||
|
@@ -361,6 +361,12 @@ dns_cache_destroy(void)
|
||||||
|
cache_last.prev = NULL;
|
||||||
|
persist_first.next = NULL;
|
||||||
|
persist_last.prev = NULL;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+dns_cache_deinit(void)
|
||||||
|
+{
|
||||||
|
if (dns_cache_hosts)
|
||||||
|
g_free(dns_cache_hosts);
|
||||||
|
+ dns_cache_hosts = NULL;
|
||||||
|
}
|
||||||
|
diff --git a/lib/dnscache.h b/lib/dnscache.h
|
||||||
|
index 8bae5f1..647ba19 100644
|
||||||
|
--- a/lib/dnscache.h
|
||||||
|
+++ b/lib/dnscache.h
|
||||||
|
@@ -34,5 +34,6 @@ void dns_cache_store(gboolean persistent, gint family, void *addr, const gchar *
|
||||||
|
void dns_cache_set_params(gint cache_size, gint expire, gint expire_failed, const gchar *hosts);
|
||||||
|
void dns_cache_init(void);
|
||||||
|
void dns_cache_destroy(void);
|
||||||
|
+void dns_cache_deinit(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
diff --git a/lib/mainloop.c b/lib/mainloop.c
|
||||||
|
index 1203098..e294fa3 100644
|
||||||
|
--- a/lib/mainloop.c
|
||||||
|
+++ b/lib/mainloop.c
|
||||||
|
@@ -585,6 +585,7 @@ main_loop_exit_finish(void)
|
||||||
|
/* deinit the current configuration, as at this point we _know_ that no
|
||||||
|
* threads are running. This will unregister ivykis tasks and timers
|
||||||
|
* that could fire while the configuration is being destructed */
|
||||||
|
+ dns_cache_deinit();
|
||||||
|
cfg_deinit(current_configuration);
|
||||||
|
iv_quit();
|
||||||
|
}
|
||||||
|
--
|
||||||
|
cgit v0.8.3.4-1-gaabc
|
@ -0,0 +1,139 @@
|
|||||||
|
From 4b450a09da83bc8e27bd7c8adccea3f125387fa7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gergely Nagy <algernon@balabit.hu>
|
||||||
|
Date: Tue, 5 Jun 2012 14:40:08 +0200
|
||||||
|
Subject: [PATCH] afuser: Use utmpx when available, instead of utmp
|
||||||
|
|
||||||
|
FreeBSD 9 removed support for utmp, and one must use the
|
||||||
|
POSIX-specified utmpx instead. The same utmpx is available on Linux
|
||||||
|
too (and it is the same as utmp there).
|
||||||
|
|
||||||
|
The patch below converts afuser to use utmpx when available, utmp
|
||||||
|
otherwise. It is based on the post-build sed magic applied to
|
||||||
|
syslog-ng within the FreeBSD ports collection, with other bits based
|
||||||
|
on a patch from Alex Zimnitsky.
|
||||||
|
|
||||||
|
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
||||||
|
---
|
||||||
|
configure.in | 4 ++--
|
||||||
|
lib/utils.c | 2 +-
|
||||||
|
lib/utils.h | 7 ++++++-
|
||||||
|
modules/afuser/afuser.c | 20 +++++++++++++++++++-
|
||||||
|
4 files changed, 28 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/configure.in b/configure.in
|
||||||
|
index aafb980..c76d7d9 100644
|
||||||
|
--- a/configure.in
|
||||||
|
+++ b/configure.in
|
||||||
|
@@ -383,7 +383,7 @@ dnl ***************************************************************************
|
||||||
|
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AC_CHECK_HEADER(dmalloc.h)
|
||||||
|
-AC_CHECK_HEADERS(strings.h getopt.h stropts.h sys/strlog.h door.h sys/capability.h sys/prctl.h)
|
||||||
|
+AC_CHECK_HEADERS(strings.h getopt.h stropts.h sys/strlog.h door.h sys/capability.h sys/prctl.h utmpx.h)
|
||||||
|
AC_CHECK_HEADERS(tcpd.h)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -479,7 +479,7 @@ if test "x$enable_linux_caps" = "xyes" -o "x$enable_linux_caps" = "xauto"; then
|
||||||
|
AC_CHECK_LIB(cap, cap_set_proc, LIBCAP_LIBS="-lcap")
|
||||||
|
fi
|
||||||
|
|
||||||
|
-AC_CHECK_FUNCS(strdup strtol strtoll strtoimax inet_aton inet_ntoa getopt_long getaddrinfo getutent pread pwrite strcasestr memrchr localtime_r gmtime_r)
|
||||||
|
+AC_CHECK_FUNCS(strdup strtol strtoll strtoimax inet_aton inet_ntoa getopt_long getaddrinfo getutent getutxent pread pwrite strcasestr memrchr localtime_r gmtime_r)
|
||||||
|
old_LIBS=$LIBS
|
||||||
|
LIBS=$BASE_LIBS
|
||||||
|
AC_CHECK_FUNCS(clock_gettime)
|
||||||
|
diff --git a/lib/utils.c b/lib/utils.c
|
||||||
|
index 2b5c525..3c05426 100644
|
||||||
|
--- a/lib/utils.c
|
||||||
|
+++ b/lib/utils.c
|
||||||
|
@@ -47,7 +47,7 @@ int inet_aton(const char *cp, struct in_addr *addr)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#ifndef HAVE_GETUTENT
|
||||||
|
+#if !defined(HAVE_GETUTENT) && !defined(HAVE_GETUTXENT)
|
||||||
|
|
||||||
|
static int utent_fd = -1;
|
||||||
|
|
||||||
|
diff --git a/lib/utils.h b/lib/utils.h
|
||||||
|
index 86e3a7f..a0f3dcc 100644
|
||||||
|
--- a/lib/utils.h
|
||||||
|
+++ b/lib/utils.h
|
||||||
|
@@ -28,13 +28,18 @@
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
+
|
||||||
|
+#ifdef HAVE_UTMPX_H
|
||||||
|
+#include <utmpx.h>
|
||||||
|
+#else
|
||||||
|
#include <utmp.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_INET_ATON
|
||||||
|
int inet_aton(const char *cp, struct in_addr *addr);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#ifndef HAVE_GETUTENT
|
||||||
|
+#if !defined(HAVE_GETUTENT) && !defined(HAVE_GETUTXENT)
|
||||||
|
struct utmp *getutent(void);
|
||||||
|
void endutent(void);
|
||||||
|
#endif
|
||||||
|
diff --git a/modules/afuser/afuser.c b/modules/afuser/afuser.c
|
||||||
|
index 8f170e5..7d082b2 100644
|
||||||
|
--- a/modules/afuser/afuser.c
|
||||||
|
+++ b/modules/afuser/afuser.c
|
||||||
|
@@ -25,7 +25,13 @@
|
||||||
|
#include "alarms.h"
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
|
+#ifdef HAVE_UTMPX_H
|
||||||
|
+#include <utmpx.h>
|
||||||
|
+#define ut_name ut_user
|
||||||
|
+#else
|
||||||
|
#include <utmp.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <string.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
@@ -46,7 +52,11 @@
|
||||||
|
{
|
||||||
|
AFUserDestDriver *self = (AFUserDestDriver *) s;
|
||||||
|
gchar buf[8192];
|
||||||
|
+#ifdef HAVE_UTMPX_H
|
||||||
|
+ struct utmpx *ut;
|
||||||
|
+#else
|
||||||
|
struct utmp *ut;
|
||||||
|
+#endif
|
||||||
|
GString *timestamp;
|
||||||
|
time_t now;
|
||||||
|
|
||||||
|
@@ -63,7 +73,11 @@
|
||||||
|
g_string_free(timestamp, TRUE);
|
||||||
|
|
||||||
|
/* NOTE: there's a private implementations of getutent in utils.c on Systems which do not provide one. */
|
||||||
|
- while ((ut = getutent()))
|
||||||
|
+#ifdef HAVE_GETUTXENT
|
||||||
|
+ while ((ut = getutxent()))
|
||||||
|
+#else
|
||||||
|
+ while ((ut = getutent()))
|
||||||
|
+#endif
|
||||||
|
{
|
||||||
|
#if HAVE_MODERN_UTMP
|
||||||
|
if (ut->ut_type == USER_PROCESS &&
|
||||||
|
@@ -106,7 +120,11 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+#if HAVE_UTMPX_H
|
||||||
|
+ endutxent();
|
||||||
|
+#else
|
||||||
|
endutent();
|
||||||
|
+#endif
|
||||||
|
finish:
|
||||||
|
log_msg_ack(msg, path_options);
|
||||||
|
log_msg_unref(msg);
|
||||||
|
--
|
||||||
|
1.7.10
|
||||||
|
|
@ -0,0 +1,131 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/syslog-ng-3.3.5-r1.ebuild,v 1.1 2012/06/08 18:50:14 mr_bones_ Exp $
|
||||||
|
|
||||||
|
EAPI=2
|
||||||
|
inherit autotools eutils multilib
|
||||||
|
|
||||||
|
MY_PV=${PV/_/}
|
||||||
|
DESCRIPTION="syslog replacement with advanced filtering features"
|
||||||
|
HOMEPAGE="http://www.balabit.com/products/syslog_ng/"
|
||||||
|
SRC_URI="http://www.balabit.com/downloads/files/syslog-ng/sources/${MY_PV}/source/syslog-ng_${MY_PV}.tar.gz"
|
||||||
|
|
||||||
|
LICENSE="GPL-2"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
|
||||||
|
IUSE="caps hardened ipv6 json mongodb +pcre selinux spoof-source sql ssl static tcpd"
|
||||||
|
RESTRICT="test"
|
||||||
|
|
||||||
|
LIBS_DEPEND="
|
||||||
|
spoof-source? ( net-libs/libnet )
|
||||||
|
ssl? ( dev-libs/openssl )
|
||||||
|
tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
|
||||||
|
!static? (
|
||||||
|
>=dev-libs/eventlog-0.2.12
|
||||||
|
>=dev-libs/glib-2.10.1:2 )
|
||||||
|
json? ( >=dev-libs/json-glib-0.12 )
|
||||||
|
caps? ( sys-libs/libcap )
|
||||||
|
sql? ( >=dev-db/libdbi-0.8.3 )"
|
||||||
|
RDEPEND="
|
||||||
|
!static? (
|
||||||
|
pcre? ( dev-libs/libpcre )
|
||||||
|
${LIBS_DEPEND}
|
||||||
|
)"
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
${LIBS_DEPEND}
|
||||||
|
static? (
|
||||||
|
>=dev-libs/eventlog-0.2.12[static-libs]
|
||||||
|
>=dev-libs/glib-2.10.1:2[static-libs] )
|
||||||
|
virtual/pkgconfig
|
||||||
|
sys-devel/flex"
|
||||||
|
|
||||||
|
S=${WORKDIR}/${PN}-${MY_PV}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
epatch \
|
||||||
|
"${FILESDIR}"/${P}-compile.patch \
|
||||||
|
"${FILESDIR}"/${P}-afsocket.patch \
|
||||||
|
"${FILESDIR}"/${P}-gprocess.patch \
|
||||||
|
"${FILESDIR}"/${P}-include.patch \
|
||||||
|
"${FILESDIR}"/${P}-threading.patch \
|
||||||
|
"${FILESDIR}"/${P}-utmpx.patch
|
||||||
|
sed -i \
|
||||||
|
-e '/libsyslog_ng_crypto_la_LIBADD/s/$/ -lssl -lcrypto/' \
|
||||||
|
lib/Makefile.am || die
|
||||||
|
eautoreconf
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
local myconf
|
||||||
|
|
||||||
|
if use static ; then
|
||||||
|
myconf="${myconf} --enable-static-linking"
|
||||||
|
else
|
||||||
|
myconf="${myconf} --enable-dynamic-linking"
|
||||||
|
fi
|
||||||
|
econf \
|
||||||
|
--disable-dependency-tracking \
|
||||||
|
--disable-systemd \
|
||||||
|
--with-ivykis=internal \
|
||||||
|
--sysconfdir=/etc/syslog-ng \
|
||||||
|
--localstatedir=/var/lib/misc \
|
||||||
|
--with-pidfile-dir=/var/run \
|
||||||
|
--with-module-dir=/usr/$(get_libdir)/syslog-ng \
|
||||||
|
$(use_enable caps linux-caps) \
|
||||||
|
$(use_enable ipv6) \
|
||||||
|
$(use_enable json) \
|
||||||
|
$(use_with json json-glib) \
|
||||||
|
$(use_enable mongodb) \
|
||||||
|
$(use_enable pcre) \
|
||||||
|
$(use_enable spoof-source) \
|
||||||
|
$(use_enable sql) \
|
||||||
|
$(use_enable ssl) \
|
||||||
|
$(use_enable tcpd tcp-wrapper) \
|
||||||
|
${myconf}
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
emake DESTDIR="${D}" install || die "emake install failed"
|
||||||
|
|
||||||
|
dodoc AUTHORS ChangeLog NEWS \
|
||||||
|
contrib/syslog-ng.conf* \
|
||||||
|
contrib/syslog2ng "${FILESDIR}/syslog-ng.conf."*
|
||||||
|
|
||||||
|
# Install default configuration
|
||||||
|
insinto /etc/syslog-ng
|
||||||
|
if use hardened || use selinux ; then
|
||||||
|
newins "${FILESDIR}/syslog-ng.conf.gentoo.hardened.${PV%.*}" syslog-ng.conf || die
|
||||||
|
elif use userland_BSD ; then
|
||||||
|
newins "${FILESDIR}/syslog-ng.conf.gentoo.fbsd.${PV%.*}" syslog-ng.conf || die
|
||||||
|
else
|
||||||
|
newins "${FILESDIR}/syslog-ng.conf.gentoo.${PV%.*}" syslog-ng.conf || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
insinto /etc/logrotate.d
|
||||||
|
# Install snippet for logrotate, which may or may not be installed
|
||||||
|
if use hardened || use selinux ; then
|
||||||
|
newins "${FILESDIR}/syslog-ng.logrotate.hardened" syslog-ng || die
|
||||||
|
else
|
||||||
|
newins "${FILESDIR}/syslog-ng.logrotate" syslog-ng || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
newinitd "${FILESDIR}/syslog-ng.rc6.${PV%.*}" syslog-ng || die
|
||||||
|
newconfd "${FILESDIR}/syslog-ng.confd" syslog-ng || die
|
||||||
|
keepdir /etc/syslog-ng/patterndb.d
|
||||||
|
find "${D}" -type f -name '*.la' -exec rm {} + || die
|
||||||
|
rmdir "${D}"/usr/libexec
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
elog "For detailed documentation please see the upstream website:"
|
||||||
|
elog "http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.3-guides/syslog-ng-ose-v3.3-guide-admin-en.html/index.html"
|
||||||
|
|
||||||
|
# bug #355257
|
||||||
|
if ! has_version app-admin/logrotate ; then
|
||||||
|
echo
|
||||||
|
elog "It is highly recommended that app-admin/logrotate be emerged to"
|
||||||
|
elog "manage the log files. ${PN} installs a file in /etc/logrotate.d"
|
||||||
|
elog "for logrotate to use."
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/app-arch/dpkg/dpkg-1.16.4.ebuild,v 1.1 2012/06/08 15:58:27 jer Exp $
|
||||||
|
|
||||||
|
EAPI=4
|
||||||
|
|
||||||
|
inherit eutils multilib autotools toolchain-funcs
|
||||||
|
|
||||||
|
DESCRIPTION="Package maintenance system for Debian"
|
||||||
|
HOMEPAGE="http://packages.qa.debian.org/dpkg"
|
||||||
|
SRC_URI="mirror://debian/pool/main/d/${PN}/${P/-/_}.tar.bz2"
|
||||||
|
|
||||||
|
LICENSE="GPL-2"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-solaris ~x86-solaris"
|
||||||
|
IUSE="bzip2 dselect nls test unicode zlib"
|
||||||
|
|
||||||
|
LANGS="
|
||||||
|
ast bs ca cs da de dz el eo es et eu fr gl hu id it ja km ko ku lt mr nb ne
|
||||||
|
nl nn pa pl pt_BR pt ro ru sk sv th tl vi zh_CN zh_TW
|
||||||
|
"
|
||||||
|
|
||||||
|
for X in ${LANGS} ; do
|
||||||
|
IUSE="${IUSE} linguas_${X}"
|
||||||
|
done
|
||||||
|
|
||||||
|
RDEPEND=">=dev-lang/perl-5.6.0
|
||||||
|
dev-perl/TimeDate
|
||||||
|
>=sys-libs/ncurses-5.2-r7
|
||||||
|
zlib? ( >=sys-libs/zlib-1.1.4 )
|
||||||
|
bzip2? ( app-arch/bzip2 )"
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
sys-devel/flex
|
||||||
|
virtual/pkgconfig
|
||||||
|
nls? ( app-text/po4a )
|
||||||
|
test? (
|
||||||
|
dev-perl/DateTime-Format-DateParse
|
||||||
|
dev-perl/IO-String
|
||||||
|
dev-perl/Test-Pod
|
||||||
|
)"
|
||||||
|
REQUIRED_USE="dselect? ( nls )"
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
# don't mess with linker optimisation, respect user's flags (don't break!)
|
||||||
|
sed -i -e '/DPKG_LINKER_OPTIMISATIONS/d' configure.ac || die
|
||||||
|
|
||||||
|
# Force the use of the running bash for get-version (this file is never
|
||||||
|
# installed, so no need to worry about hardcoding a temporary bash)
|
||||||
|
sed -i -e '1c\#!'"${BASH}" get-version || die
|
||||||
|
|
||||||
|
# this test depends on a Debian only gzip extension that adds --rsyncable
|
||||||
|
# which will therefore always fail on Gentoo. (bug #310847).
|
||||||
|
sed -i scripts/Makefile.am \
|
||||||
|
-e '/850_Dpkg_Compression.t/d' \
|
||||||
|
|| die "sed failed"
|
||||||
|
|
||||||
|
eautoreconf
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
tc-export CC
|
||||||
|
econf \
|
||||||
|
${myconf} \
|
||||||
|
$(use_enable dselect) \
|
||||||
|
$(use_enable unicode) \
|
||||||
|
$(use_with bzip2 bz2) \
|
||||||
|
$(use_with zlib) \
|
||||||
|
--disable-compiler-warnings \
|
||||||
|
--without-selinux \
|
||||||
|
--disable-start-stop-daemon
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
strip-linguas ${LANGS}
|
||||||
|
if [ -z "${LINGUAS}" ] ; then
|
||||||
|
LINGUAS=none
|
||||||
|
fi
|
||||||
|
|
||||||
|
emake DESTDIR="${D}" LINGUAS="${LINGUAS}" install || die "emake install failed"
|
||||||
|
rm "${ED}"/usr/sbin/install-info || die "rm install-info failed"
|
||||||
|
dodoc ChangeLog THANKS TODO
|
||||||
|
keepdir /usr/$(get_libdir)/db/methods/{mnt,floppy,disk}
|
||||||
|
keepdir /usr/$(get_libdir)/db/{alternatives,info,methods,parts,updates}
|
||||||
|
}
|
@ -1,2 +1 @@
|
|||||||
DIST deja-dup-22.0.tar.xz 772832 RMD160 4913e9e3b40708fdb2a0ccbe82cf1a436ea39e4e SHA1 f11adb6054ff91e7fc9981fbb46a46f355db5ff0 SHA256 28eb77a6006d21df56d9ee1f73e422d0974f9c75da201b6a5b9ef38e37836420
|
|
||||||
DIST deja-dup-22.1.tar.xz 777248 RMD160 d85ac85436851f3843a472265323fc8f6476c66a SHA1 be6b9bb94c78461c3a32424825850a0b2bc401dd SHA256 44cb8fcd45799a369c8da2717792a87e3e183eeca1b07fa8f2aac8664f00ca5e
|
DIST deja-dup-22.1.tar.xz 777248 RMD160 d85ac85436851f3843a472265323fc8f6476c66a SHA1 be6b9bb94c78461c3a32424825850a0b2bc401dd SHA256 44cb8fcd45799a369c8da2717792a87e3e183eeca1b07fa8f2aac8664f00ca5e
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-backup/deja-dup/deja-dup-22.0.ebuild,v 1.8 2012/05/05 15:24:07 jlec Exp $
|
|
||||||
|
|
||||||
EAPI=4
|
|
||||||
|
|
||||||
GNOME2_LA_PUNT="yes"
|
|
||||||
|
|
||||||
inherit eutils gnome2
|
|
||||||
|
|
||||||
DESCRIPTION="Simple backup tool using duplicity back-end"
|
|
||||||
HOMEPAGE="https://launchpad.net/deja-dup/"
|
|
||||||
SRC_URI="http://launchpad.net/${PN}/22/${PV}/+download/${P}.tar.xz"
|
|
||||||
|
|
||||||
LICENSE="GPL-3"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="amd64 x86"
|
|
||||||
IUSE="nautilus"
|
|
||||||
|
|
||||||
RESTRICT="test"
|
|
||||||
|
|
||||||
COMMON_DEPEND="
|
|
||||||
dev-libs/glib:2
|
|
||||||
x11-libs/gtk+:3
|
|
||||||
x11-libs/libnotify
|
|
||||||
|
|
||||||
app-backup/duplicity
|
|
||||||
dev-libs/dbus-glib
|
|
||||||
gnome-base/gnome-keyring
|
|
||||||
|
|
||||||
nautilus? ( gnome-base/nautilus )"
|
|
||||||
RDEPEND="${COMMON_DEPEND}
|
|
||||||
gnome-base/gvfs[fuse]"
|
|
||||||
DEPEND="${COMMON_DEPEND}
|
|
||||||
app-text/yelp-tools
|
|
||||||
dev-lang/vala:0.14
|
|
||||||
dev-perl/Locale-gettext
|
|
||||||
virtual/pkgconfig
|
|
||||||
dev-util/intltool
|
|
||||||
sys-devel/gettext"
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
DOCS="NEWS AUTHORS"
|
|
||||||
G2CONF="${G2CONF}
|
|
||||||
$(use_with nautilus)
|
|
||||||
--without-ccpanel
|
|
||||||
--without-unity
|
|
||||||
--disable-schemas-compile
|
|
||||||
--disable-static"
|
|
||||||
export VALAC=$(type -p valac-0.14)
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
gnome2_src_install
|
|
||||||
domenu data/deja-dup.desktop
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-benchmarks/i7z/i7z-0.27-r1.ebuild,v 1.4 2012/03/24 20:17:50 hwoarang Exp $
|
|
||||||
|
|
||||||
EAPI="4"
|
|
||||||
|
|
||||||
inherit eutils flag-o-matic qt4-r2 toolchain-funcs
|
|
||||||
|
|
||||||
DESCRIPTION="A better i7 (and now i3, i5) reporting tool for Linux"
|
|
||||||
HOMEPAGE="http://code.google.com/p/i7z/"
|
|
||||||
SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
|
|
||||||
IUSE="X"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
sys-libs/ncurses
|
|
||||||
X? ( x11-libs/qt-gui:4 )"
|
|
||||||
DEPEND="${RDEPEND}"
|
|
||||||
|
|
||||||
S="${WORKDIR}"/${PN}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PV}-gentoo.patch
|
|
||||||
epatch "${FILESDIR}"/${P}-cpuid.patch
|
|
||||||
tc-export CC
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
default
|
|
||||||
if use X; then
|
|
||||||
append-cxxflags -fno-inline-small-functions -fno-caller-saves
|
|
||||||
cd GUI
|
|
||||||
eqmake4 GUI.pro
|
|
||||||
emake
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${ED}" install
|
|
||||||
if use X; then
|
|
||||||
newsbin GUI/GUI i7z_GUI
|
|
||||||
fi
|
|
||||||
dodoc put_cores_o*line.sh MAKEDEV-cpuid-msr
|
|
||||||
}
|
|
@ -0,0 +1,22 @@
|
|||||||
|
--- lispref-orig/elisp.texi
|
||||||
|
+++ lispref/elisp.texi
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
\input texinfo @c -*-texinfo-*-
|
||||||
|
@c %**start of header
|
||||||
|
-@setfilename elisp
|
||||||
|
+@setfilename elisp23.info
|
||||||
|
@settitle GNU Emacs Lisp Reference Manual
|
||||||
|
@c %**end of header
|
||||||
|
|
||||||
|
@@ -63,9 +63,9 @@
|
||||||
|
@end quotation
|
||||||
|
@end copying
|
||||||
|
|
||||||
|
-@dircategory GNU Emacs Lisp
|
||||||
|
+@dircategory Emacs
|
||||||
|
@direntry
|
||||||
|
-* Elisp: (elisp). The Emacs Lisp Reference Manual.
|
||||||
|
+* Elisp 23: (elisp23). The Emacs Lisp Reference Manual for Emacs 23.
|
||||||
|
@end direntry
|
||||||
|
|
||||||
|
@titlepage
|
@ -1,2 +1 @@
|
|||||||
DIST ledit-2.02.1.tgz 24289 RMD160 5a3cd2ed19d346d133616414ff4b0d30315620a1 SHA1 3c103531f1c3947fa9195540efd2f74883146d6a SHA256 d2433b4fb9fcda95a5438b3d9c715d41db6f2882046bdcc0b5d14933ee39ad28
|
|
||||||
DIST ledit-2.03.tgz 24319 RMD160 5a8366deaf668c595d48d10c68b583f1f9c2388e SHA1 8fef728f38e8d6fc30dd5f71dd5b6b647212a43a SHA256 ce08a8568c964009ccb0cbba45ae78b9a96c823f42a4fd61431a5b0c2c7a19ce
|
DIST ledit-2.03.tgz 24319 RMD160 5a8366deaf668c595d48d10c68b583f1f9c2388e SHA1 8fef728f38e8d6fc30dd5f71dd5b6b647212a43a SHA256 ce08a8568c964009ccb0cbba45ae78b9a96c823f42a4fd61431a5b0c2c7a19ce
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
# Copyright 1999-2011 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-misc/ledit/ledit-2.02.1.ebuild,v 1.4 2011/01/13 22:06:32 ranger Exp $
|
|
||||||
|
|
||||||
EAPI=2
|
|
||||||
inherit eutils
|
|
||||||
|
|
||||||
RESTRICT="installsources"
|
|
||||||
IUSE="+ocamlopt"
|
|
||||||
|
|
||||||
DESCRIPTION="A line editor to be used with interactive commands."
|
|
||||||
SRC_URI="http://pauillac.inria.fr/~ddr/ledit/distrib/src/${P}.tgz"
|
|
||||||
HOMEPAGE="http://pauillac.inria.fr/~ddr/ledit/"
|
|
||||||
|
|
||||||
DEPEND=">=dev-lang/ocaml-3.09[ocamlopt?]
|
|
||||||
dev-ml/camlp5"
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
SLOT="0"
|
|
||||||
LICENSE="BSD"
|
|
||||||
KEYWORDS="amd64 ppc x86 ~x86-fbsd"
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
emake -j1 all || die "make failed"
|
|
||||||
if use ocamlopt; then
|
|
||||||
emake -j1 ledit.opt || die "make failed"
|
|
||||||
else
|
|
||||||
# If using bytecode we dont want to strip the binary as it would remove the
|
|
||||||
# bytecode and only leave ocamlrun...
|
|
||||||
export STRIP_MASK="*/bin/*"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use ocamlopt; then
|
|
||||||
newbin ledit.opt ledit || die
|
|
||||||
else
|
|
||||||
newbin ledit.out ledit || die
|
|
||||||
fi
|
|
||||||
doman ledit.1
|
|
||||||
dodoc CHANGES README
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
diff -Naur lyx-1.5.0.orig/lib/configure.py lyx-1.5.0/lib/configure.py
|
|
||||||
--- lyx-1.5.0.orig/lib/configure.py 2007-07-25 06:08:25.000000000 +0900
|
|
||||||
+++ lyx-1.5.0/lib/configure.py 2007-07-27 08:05:53.000000000 +0900
|
|
||||||
@@ -214,7 +214,7 @@
|
|
||||||
\\@@end
|
|
||||||
''')
|
|
||||||
# run latex on chklatex.ltx and check result
|
|
||||||
- if cmdOutput(LATEX + ' chklatex.ltx').find('ThisIsLaTeX2e') != -1:
|
|
||||||
+ if cmdOutput(LATEX + ' --no-mktex=tfm chklatex.ltx').find('ThisIsLaTeX2e') != -1:
|
|
||||||
# valid latex2e
|
|
||||||
return LATEX
|
|
||||||
else:
|
|
||||||
@@ -386,7 +386,7 @@
|
|
||||||
checkProg('a DVI to TXT converter', ['catdvi $$i > $$o'],
|
|
||||||
rc_entry = [ r'\converter dvi text4 "%%" ""' ])
|
|
||||||
#
|
|
||||||
- checkProg('a DVI to PS converter', ['dvips -o $$o $$i'],
|
|
||||||
+ checkProg('a DVI to PS converter', ['dvips -R0 -o $$o $$i'],
|
|
||||||
rc_entry = [ r'\converter dvi ps "%%" ""' ])
|
|
||||||
#
|
|
||||||
checkProg('a DVI to PDF converter', ['dvipdfmx -o $$o $$i', 'dvipdfm -o $$o $$i'],
|
|
||||||
@@ -650,7 +650,7 @@
|
|
||||||
cl.close()
|
|
||||||
#
|
|
||||||
# we have chklayouts.tex, then process it
|
|
||||||
- fout = os.popen(LATEX + ' wrap_chkconfig.ltx')
|
|
||||||
+ fout = os.popen(LATEX + ' --no-mktex=tfm wrap_chkconfig.ltx')
|
|
||||||
while True:
|
|
||||||
line = fout.readline()
|
|
||||||
if not line:
|
|
@ -1,10 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Name=Lyx
|
|
||||||
Comment=Latex WYSIWYM Editor
|
|
||||||
Icon=/usr/share/lyx/images/lyx.xpm
|
|
||||||
Exec=lyx
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
StartupNotify=false
|
|
||||||
Categories=GNOME;Application;Office;
|
|
||||||
MimeType=application/x-lyx;
|
|
@ -1,3 +1,3 @@
|
|||||||
DIST calibre-0.8.52.tar.xz 24690364 RMD160 3041d07f0c9b8a67fc0457550968814be4d826e9 SHA1 7ec70aa251f90991be876cac9ea731ddd619b4da SHA256 29eebc8c82dd2cacc70e3fb5bc309020348028752a23765d8956769b79deaf2a
|
DIST calibre-0.8.52.tar.xz 24690364 RMD160 3041d07f0c9b8a67fc0457550968814be4d826e9 SHA1 7ec70aa251f90991be876cac9ea731ddd619b4da SHA256 29eebc8c82dd2cacc70e3fb5bc309020348028752a23765d8956769b79deaf2a
|
||||||
DIST calibre-0.8.53.tar.xz 24703236 RMD160 1c785efada730f7996f5fd561f0cb0967c4236b1 SHA1 6f374e4c3f985768e6b0c7d42bf0652046e393f4 SHA256 3f9b2c530c240c07a7d5d83479f78df588334d705f4c98b0535a04f5cdac544c
|
|
||||||
DIST calibre-0.8.54.tar.xz 24733284 RMD160 08dc646b72e6244fe8522f13fd724107c7c401c4 SHA1 9d13634db38e73d6ff8b015c57691eca90e60b97 SHA256 063b733e163b9bf78002f9cb35c2041a5f5550c9b91b38c8aa2b4d256877c847
|
DIST calibre-0.8.54.tar.xz 24733284 RMD160 08dc646b72e6244fe8522f13fd724107c7c401c4 SHA1 9d13634db38e73d6ff8b015c57691eca90e60b97 SHA256 063b733e163b9bf78002f9cb35c2041a5f5550c9b91b38c8aa2b4d256877c847
|
||||||
|
DIST calibre-0.8.55.tar.xz 24913320 RMD160 047f676dee0c5e2a544622d07cf06eac33a5b557 SHA1 20dcbd67136e5251a596ced487356b8e01eb618a SHA256 00e0a7c304229b85eabc8331914110f9de22a155cb5e71e68b5e842b313e8305
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-0.8.53.ebuild,v 1.1 2012/05/26 00:06:19 zmedico Exp $
|
# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-0.8.55.ebuild,v 1.1 2012/06/08 20:01:53 zmedico Exp $
|
||||||
|
|
||||||
EAPI=4
|
EAPI=4
|
||||||
PYTHON_DEPEND=2:2.7
|
PYTHON_DEPEND=2:2.7
|
@ -1,104 +0,0 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/app-text/evince/evince-3.2.1.ebuild,v 1.6 2012/05/10 01:32:11 tetromino Exp $
|
|
||||||
|
|
||||||
EAPI="4"
|
|
||||||
GCONF_DEBUG="yes"
|
|
||||||
GNOME2_LA_PUNT="yes"
|
|
||||||
|
|
||||||
inherit eutils gnome2
|
|
||||||
|
|
||||||
DESCRIPTION="Simple document viewer for GNOME"
|
|
||||||
HOMEPAGE="http://www.gnome.org/projects/evince/"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="dbus debug djvu doc dvi gnome-keyring +introspection nautilus +ps t1lib tiff xps"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~x64-solaris"
|
|
||||||
|
|
||||||
# Since 2.26.2, can handle poppler without cairo support. Make it optional ?
|
|
||||||
# not mature enough
|
|
||||||
# atk used in libview
|
|
||||||
# gdk-pixbuf used all over the place
|
|
||||||
# libX11 used for totem-screensaver
|
|
||||||
RDEPEND="
|
|
||||||
dev-libs/atk
|
|
||||||
>=dev-libs/glib-2.25.11:2
|
|
||||||
>=dev-libs/libxml2-2.5:2
|
|
||||||
sys-libs/zlib
|
|
||||||
x11-libs/gdk-pixbuf:2
|
|
||||||
>=x11-libs/gtk+-3.0.2:3[introspection?]
|
|
||||||
x11-libs/libX11
|
|
||||||
>=x11-libs/libSM-1
|
|
||||||
x11-libs/libICE
|
|
||||||
gnome-base/gsettings-desktop-schemas
|
|
||||||
|| (
|
|
||||||
>=x11-themes/gnome-icon-theme-2.17.1
|
|
||||||
>=x11-themes/hicolor-icon-theme-0.10 )
|
|
||||||
>=x11-libs/cairo-1.10.0
|
|
||||||
>=app-text/poppler-0.16[cairo]
|
|
||||||
djvu? ( >=app-text/djvu-3.5.17 )
|
|
||||||
dvi? (
|
|
||||||
virtual/tex-base
|
|
||||||
dev-libs/kpathsea
|
|
||||||
t1lib? ( >=media-libs/t1lib-5.0.0 ) )
|
|
||||||
gnome-keyring? ( >=gnome-base/gnome-keyring-2.22.0 )
|
|
||||||
introspection? ( >=dev-libs/gobject-introspection-0.6 )
|
|
||||||
nautilus? ( >=gnome-base/nautilus-2.91.4[introspection?] )
|
|
||||||
ps? ( >=app-text/libspectre-0.2.0 )
|
|
||||||
tiff? ( >=media-libs/tiff-3.6:0 )
|
|
||||||
xps? ( >=app-text/libgxps-0.0.1 )
|
|
||||||
"
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
app-text/scrollkeeper
|
|
||||||
>=app-text/gnome-doc-utils-0.3.2
|
|
||||||
app-text/docbook-xml-dtd:4.3
|
|
||||||
virtual/pkgconfig
|
|
||||||
sys-devel/gettext
|
|
||||||
>=dev-util/intltool-0.35
|
|
||||||
>=dev-util/gtk-doc-am-1.13
|
|
||||||
doc? ( >=dev-util/gtk-doc-1.13 )"
|
|
||||||
|
|
||||||
ELTCONF="--portage"
|
|
||||||
|
|
||||||
# Needs dogtail and pyspi from http://fedorahosted.org/dogtail/
|
|
||||||
# Releases: http://people.redhat.com/zcerza/dogtail/releases/
|
|
||||||
RESTRICT="test"
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
# Passing --disable-help would drop offline help, that would be inconsistent
|
|
||||||
# with helps of the most of Gnome apps that doesn't require network for that.
|
|
||||||
G2CONF="${G2CONF}
|
|
||||||
--disable-schemas-compile
|
|
||||||
--disable-scrollkeeper
|
|
||||||
--disable-static
|
|
||||||
--disable-tests
|
|
||||||
--enable-pdf
|
|
||||||
--enable-comics
|
|
||||||
--enable-thumbnailer
|
|
||||||
--with-smclient=xsmp
|
|
||||||
--with-platform=gnome
|
|
||||||
--enable-help
|
|
||||||
$(use_enable dbus)
|
|
||||||
$(use_enable djvu)
|
|
||||||
$(use_enable dvi)
|
|
||||||
$(use_with gnome-keyring keyring)
|
|
||||||
$(use_enable introspection)
|
|
||||||
$(use_enable nautilus)
|
|
||||||
$(use_enable ps)
|
|
||||||
$(use_enable t1lib)
|
|
||||||
$(use_enable tiff)
|
|
||||||
$(use_enable xps)"
|
|
||||||
DOCS="AUTHORS ChangeLog NEWS README TODO"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# Fix .desktop file so menu item shows up
|
|
||||||
epatch "${FILESDIR}"/${PN}-0.7.1-display-menu.patch
|
|
||||||
|
|
||||||
gnome2_src_prepare
|
|
||||||
|
|
||||||
# Do not depend on gnome-icon-theme, bug #326855, #391859
|
|
||||||
sed -e 's/gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED//g' \
|
|
||||||
-i configure || die "sed failed"
|
|
||||||
}
|
|
@ -1 +1,2 @@
|
|||||||
DIST phpPgAdmin-5.0.3.tar.bz2 779305 RMD160 3f89e2f744d6d2ea0618e0187fcc7a610cd4e823 SHA1 6c7c9c6e8ca73a37f6471e09efd5f873da0e7e9f SHA256 13827e51b6c635ae81cfdeaad6a027dc3c17165bc929a5f8d4c702bb05ff84c9
|
DIST phpPgAdmin-5.0.3.tar.bz2 779305 RMD160 3f89e2f744d6d2ea0618e0187fcc7a610cd4e823 SHA1 6c7c9c6e8ca73a37f6471e09efd5f873da0e7e9f SHA256 13827e51b6c635ae81cfdeaad6a027dc3c17165bc929a5f8d4c702bb05ff84c9
|
||||||
|
DIST phpPgAdmin-5.0.4.tar.bz2 778547 RMD160 d3cad1238e9c89b7e20b5032cf932cd6e15a9b8d SHA1 fb8cad25b33de7c777f1c69287e7f264a9e22b5f SHA256 cd4b16008c9b5b2b8b9f20708e51e77690d910a7b3d85f9f66386c79994a4349
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/dev-db/phppgadmin/phppgadmin-5.0.4.ebuild,v 1.1 2012/06/08 17:04:27 titanofold Exp $
|
||||||
|
|
||||||
|
EAPI="4"
|
||||||
|
|
||||||
|
inherit webapp
|
||||||
|
|
||||||
|
MY_P="phpPgAdmin-${PV}"
|
||||||
|
|
||||||
|
DESCRIPTION="Web-based administration for Postgres database in php"
|
||||||
|
HOMEPAGE="http://phppgadmin.sourceforge.net/"
|
||||||
|
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
|
||||||
|
|
||||||
|
LICENSE="GPL-2"
|
||||||
|
KEYWORDS="~amd64 ~hppa ~ppc ~x86"
|
||||||
|
IUSE=""
|
||||||
|
|
||||||
|
RDEPEND="dev-lang/php[postgres,session]
|
||||||
|
|| ( <dev-lang/php-5.3[pcre] >=dev-lang/php-5.3 )"
|
||||||
|
|
||||||
|
S="${WORKDIR}/${MY_P}"
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
webapp_src_preinst
|
||||||
|
|
||||||
|
local doc
|
||||||
|
local docs="CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS"
|
||||||
|
dodoc ${docs}
|
||||||
|
mv conf/config.inc.php-dist conf/config.inc.php
|
||||||
|
|
||||||
|
cp -r * "${D}"${MY_HTDOCSDIR}
|
||||||
|
for doc in ${docs} INSTALL LICENSE; do
|
||||||
|
rm -f "${D}"${MY_HTDOCSDIR}/${doc}
|
||||||
|
done
|
||||||
|
|
||||||
|
webapp_configfile ${MY_HTDOCSDIR}/conf/config.inc.php
|
||||||
|
webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
|
||||||
|
webapp_src_install
|
||||||
|
}
|
@ -0,0 +1,339 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.3.19-r1.ebuild,v 1.1 2012/06/08 16:29:46 titanofold Exp $
|
||||||
|
|
||||||
|
EAPI="4"
|
||||||
|
|
||||||
|
WANT_AUTOMAKE="none"
|
||||||
|
inherit autotools eutils multilib pam prefix user versionator
|
||||||
|
|
||||||
|
SLOT="$(get_version_component_range 1-2)"
|
||||||
|
|
||||||
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
|
||||||
|
|
||||||
|
DESCRIPTION="PostgreSQL server"
|
||||||
|
HOMEPAGE="http://www.postgresql.org/"
|
||||||
|
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-patches-8.3-r2.tbz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-initscript-2.1.1.tbz2"
|
||||||
|
LICENSE="POSTGRESQL"
|
||||||
|
|
||||||
|
S="${WORKDIR}/postgresql-${PV}"
|
||||||
|
|
||||||
|
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW"
|
||||||
|
IUSE="doc kernel_linux nls pam perl python selinux tcl uuid xml"
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS} ; do
|
||||||
|
IUSE+=" linguas_${lingua}"
|
||||||
|
done
|
||||||
|
|
||||||
|
wanted_languages() {
|
||||||
|
local enable_langs
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS} ; do
|
||||||
|
use linguas_${lingua} && enable_langs+="${lingua} "
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -n ${enable_langs}
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pam?,nls=]
|
||||||
|
perl? ( >=dev-lang/perl-5.8 )
|
||||||
|
selinux? ( sec-policy/selinux-postgresql )
|
||||||
|
tcl? ( >=dev-lang/tcl-8 )
|
||||||
|
uuid? ( dev-libs/ossp-uuid )
|
||||||
|
xml? ( dev-libs/libxml2 dev-libs/libxslt )"
|
||||||
|
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
sys-devel/flex
|
||||||
|
xml? ( virtual/pkgconfig )"
|
||||||
|
|
||||||
|
PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
|
||||||
|
|
||||||
|
# Support /var/run or /run for the socket directory
|
||||||
|
[[ ! -d /run ]] && RUNDIR=/var
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
enewgroup postgres 70
|
||||||
|
enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
epatch "${WORKDIR}/autoconf.patch" \
|
||||||
|
"${WORKDIR}/bool.patch" \
|
||||||
|
"${WORKDIR}/darwin.patch" \
|
||||||
|
"${WORKDIR}/pg_ctl-exit-status.patch" \
|
||||||
|
"${WORKDIR}/server.patch" \
|
||||||
|
"${WORKDIR}/SuperH.patch"
|
||||||
|
|
||||||
|
eprefixify src/include/pg_config_manual.h
|
||||||
|
|
||||||
|
if use test ; then
|
||||||
|
epatch "${WORKDIR}/regress.patch"
|
||||||
|
sed -e "s|@SOCKETDIR@|${T}|g" -i src/test/regress/pg_regress{,_main}.c
|
||||||
|
sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" \
|
||||||
|
-i src/test/regress/{input,output}/tablespace.source
|
||||||
|
else
|
||||||
|
echo "all install:" > "${S}/src/test/regress/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -e "s|@RUNDIR@|${RUNDIR}|g" \
|
||||||
|
-i src/include/pg_config_manual.h "${WORKDIR}/postgresql.init" || \
|
||||||
|
die "RUNDIR sed failed"
|
||||||
|
sed -e "s|@SLOT@|${SLOT}|g" \
|
||||||
|
-i "${WORKDIR}/postgresql.init" "${WORKDIR}/postgresql.confd" || \
|
||||||
|
die "SLOT sed failed"
|
||||||
|
|
||||||
|
eautoconf
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
# eval is needed to get along with pg_config quotation of space-rich entities.
|
||||||
|
eval econf "$(${EPREFIX%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
|
||||||
|
--with-includes="${EPREFIX%/}/usr/include/postgresql-${SLOT}/" \
|
||||||
|
--with-system-tzdata="${EPREFIX%/}/usr/share/zoneinfo" \
|
||||||
|
$(use_with perl) \
|
||||||
|
$(use_with python) \
|
||||||
|
$(use_with tcl) \
|
||||||
|
$(use_with xml libxml) \
|
||||||
|
$(use_with xml libxslt) \
|
||||||
|
$(use_with uuid ossp-uuid) \
|
||||||
|
"$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2); do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake -C $bd -j1 \
|
||||||
|
PGXS=$(${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
|
||||||
|
PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \
|
||||||
|
NO_PGXS=0 USE_PGXS=1 docdir=${EROOT%/}/usr/share/doc/${PF}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
if use perl ; then
|
||||||
|
mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
|
||||||
|
sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
|
||||||
|
"${S}/src/pl/plperl/GNUmakefile_orig" \
|
||||||
|
> "${S}/src/pl/plperl/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2) ; do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake install -C $bd -j1 DESTDIR="${D}" \
|
||||||
|
PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \
|
||||||
|
PGXS=$(${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
|
||||||
|
NO_PGXS=0 USE_PGXS=1 docdir=${EROOT%/}/usr/share/doc/${PF}
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -r "${ED}/usr/share/postgresql-${SLOT}/man/man7/" \
|
||||||
|
"${ED}/usr/share/doc/${PF}/html"
|
||||||
|
rm "${ED}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1
|
||||||
|
docompress /usr/share/postgresql-${SLOT}/man/man1
|
||||||
|
|
||||||
|
dodoc README HISTORY doc/{README.*,TODO,bug.template}
|
||||||
|
|
||||||
|
dodir /etc/eselect/postgresql/slots/${SLOT}
|
||||||
|
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" \
|
||||||
|
> "${ED}/etc/eselect/postgresql/slots/${SLOT}/server"
|
||||||
|
|
||||||
|
newconfd "${WORKDIR}/postgresql.confd" postgresql-${SLOT}
|
||||||
|
newinitd "${WORKDIR}/postgresql.init" postgresql-${SLOT}
|
||||||
|
|
||||||
|
use pam && pamd_mimic system-auth postgresql auth account session
|
||||||
|
|
||||||
|
if use prefix ; then
|
||||||
|
keepdir ${RUNDIR}/run/postgresql
|
||||||
|
fperms 0770 ${RUNDIR}/run/postgresql
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
postgresql-config update
|
||||||
|
|
||||||
|
elog "Gentoo specific documentation:"
|
||||||
|
elog "http://www.gentoo.org/doc/en/postgres-howto.xml"
|
||||||
|
elog
|
||||||
|
elog "Official documentation:"
|
||||||
|
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
|
||||||
|
elog
|
||||||
|
elog "The default location of the Unix-domain socket is:"
|
||||||
|
elog " ${EROOT%/}${RUNDIR}/run/postgresql/"
|
||||||
|
elog
|
||||||
|
elog "If you have users and/or services that you would like to utilize the"
|
||||||
|
elog "socket, you must add them to the 'postgres' system group:"
|
||||||
|
elog " usermod -a -G postgres <user>"
|
||||||
|
elog
|
||||||
|
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
|
||||||
|
elog "so that it contains your preferred locale in:"
|
||||||
|
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
elog
|
||||||
|
elog "Then, execute the following command to setup the initial database"
|
||||||
|
elog "environment:"
|
||||||
|
elog " emerge --config =${CATEGORY}/${PF}"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm() {
|
||||||
|
postgresql-config update
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_config() {
|
||||||
|
[[ -f ${EROOT%/}/etc/conf.d/postgresql-${SLOT} ]] && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
[[ -z ${PGDATA} ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
|
||||||
|
[[ -z ${DATA_DIR} ]] && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
|
||||||
|
|
||||||
|
# environment.bz2 may not contain the same locale as the current system
|
||||||
|
# locale. Unset and source from the current system locale.
|
||||||
|
if [[ -f ${EROOT%/}/etc/env.d/02locale ]] ; then
|
||||||
|
unset LANG
|
||||||
|
unset LC_CTYPE
|
||||||
|
unset LC_NUMERIC
|
||||||
|
unset LC_TIME
|
||||||
|
unset LC_COLLATE
|
||||||
|
unset LC_MONETARY
|
||||||
|
unset LC_MESSAGES
|
||||||
|
unset LC_ALL
|
||||||
|
source ${EROOT%/}/etc/env.d/02locale
|
||||||
|
[[ -n ${LANG} ]] && export LANG
|
||||||
|
[[ -n ${LC_CTYPE} ]] && export LC_CTYPE
|
||||||
|
[[ -n ${LC_NUMERIC} ]] && export LC_NUMERIC
|
||||||
|
[[ -n ${LC_TIME} ]] && export LC_TIME
|
||||||
|
[[ -n ${LC_COLLATE} ]] && export LC_COLLATE
|
||||||
|
[[ -n ${LC_MONETARY} ]] && export LC_MONETARY
|
||||||
|
[[ -n ${LC_MESSAGES} ]] && export LC_MESSAGES
|
||||||
|
[[ -n ${LC_ALL} ]] && export LC_ALL
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "You can modify the paths and options passed to initdb by editing:"
|
||||||
|
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
einfo
|
||||||
|
einfo "Information on options that can be passed to initdb are found at:"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
|
||||||
|
einfo
|
||||||
|
einfo "PG_INITDB_OPTS is currently set to:"
|
||||||
|
if [[ -z ${PG_INITDB_OPTS} ]] ; then
|
||||||
|
einfo " (none)"
|
||||||
|
else
|
||||||
|
einfo " ${PG_INITDB_OPTS}"
|
||||||
|
fi
|
||||||
|
einfo
|
||||||
|
einfo "Configuration files will be installed to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo
|
||||||
|
einfo "The database cluster will be created in:"
|
||||||
|
einfo " ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
while [[ $correct != "true" ]] ; do
|
||||||
|
einfo "Are you ready to continue? (y/n)"
|
||||||
|
read answer
|
||||||
|
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
|
||||||
|
correct="true"
|
||||||
|
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
|
||||||
|
die "Aborting initialization."
|
||||||
|
else
|
||||||
|
echo "Answer not recognized."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ]] ; then
|
||||||
|
eerror "The given directory, '${DATA_DIR}', is not empty."
|
||||||
|
eerror "Modify DATA_DIR to point to an empty directory."
|
||||||
|
die "${DATA_DIR} is not empty."
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ -z ${PG_MAX_CONNECTIONS} ]] && PG_MAX_CONNECTIONS=128
|
||||||
|
einfo "Checking system parameters..."
|
||||||
|
|
||||||
|
if ! use kernel_linux ; then
|
||||||
|
einfo "Skipped."
|
||||||
|
einfo "Tests not supported on this OS (yet)."
|
||||||
|
else
|
||||||
|
if [[ -z ${SKIP_SYSTEM_TESTS} ]] ; then
|
||||||
|
ebegin "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections"
|
||||||
|
|
||||||
|
local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
|
||||||
|
local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
|
||||||
|
local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
|
||||||
|
local SHMMAX=$(sysctl -n kernel.shmmax)
|
||||||
|
|
||||||
|
local SEMMSL_MIN=17
|
||||||
|
local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
|
||||||
|
local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
|
||||||
|
local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
|
||||||
|
|
||||||
|
for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
|
||||||
|
if [[ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ]] ; then
|
||||||
|
eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
|
||||||
|
eerror "You have now several options:"
|
||||||
|
eerror " - Change the mentioned system parameter"
|
||||||
|
eerror " - Lower the number of max connections by setting PG_MAX_CONNECTIONS to a"
|
||||||
|
eerror " value lower than ${PG_MAX_CONNECTIONS}"
|
||||||
|
eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
|
||||||
|
eerror "More information can be found here:"
|
||||||
|
eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
|
||||||
|
die "System test failed."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
eend
|
||||||
|
else
|
||||||
|
ewarn "SKIP_SYSTEM_TESTS is set, so skipping."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
einfo "Creating the data directory ..."
|
||||||
|
mkdir -p "${DATA_DIR}"
|
||||||
|
chown -Rf postgres:postgres "${DATA_DIR}"
|
||||||
|
chmod 0700 "${DATA_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "Initializing the database ..."
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
|
||||||
|
else
|
||||||
|
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
|
||||||
|
fi
|
||||||
|
mv "${DATA_DIR%/}"/*.conf "${PGDATA}"
|
||||||
|
|
||||||
|
einfo "The autovacuum function, which was in contrib, has been moved to the main"
|
||||||
|
einfo "PostgreSQL functions starting with 8.1. You can enable it in the clusters"
|
||||||
|
einfo "postgresql.conf."
|
||||||
|
einfo
|
||||||
|
if use prefix ; then
|
||||||
|
einfo "The location of the configuration files have moved to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo
|
||||||
|
einfo "To start the server:"
|
||||||
|
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
|
||||||
|
einfo
|
||||||
|
einfo "To stop:"
|
||||||
|
einfo " pg_ctl stop -D ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
einfo "Or move the configuration files back:"
|
||||||
|
einfo " mv ${PGDATA}*.conf ${DATA_DIR}"
|
||||||
|
else
|
||||||
|
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
|
||||||
|
einfo "instead of 'pg_ctl'."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
|
||||||
|
|
||||||
|
if [[ ${UID} != 0 ]] ; then
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/:${PATH}" \
|
||||||
|
emake check \
|
||||||
|
PGXS=$(${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
|
||||||
|
NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT}
|
||||||
|
|
||||||
|
einfo "If you think other tests besides the regression tests are necessary, please"
|
||||||
|
einfo "submit a bug including a patch for this ebuild to enable them."
|
||||||
|
else
|
||||||
|
ewarn "Tests cannot be run as root. Skipping."
|
||||||
|
ewarn "HINT: FEATURES=\"userpriv\""
|
||||||
|
fi
|
||||||
|
}
|
@ -0,0 +1,348 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.4.12-r1.ebuild,v 1.1 2012/06/08 16:29:46 titanofold Exp $
|
||||||
|
|
||||||
|
EAPI="4"
|
||||||
|
PYTHON_DEPEND="python? 2"
|
||||||
|
|
||||||
|
WANT_AUTOMAKE="none"
|
||||||
|
inherit autotools eutils multilib pam prefix python user versionator
|
||||||
|
|
||||||
|
SLOT="$(get_version_component_range 1-2)"
|
||||||
|
|
||||||
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
|
||||||
|
|
||||||
|
DESCRIPTION="PostgreSQL server"
|
||||||
|
HOMEPAGE="http://www.postgresql.org/"
|
||||||
|
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-patches-8.4-r2.tbz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-initscript-2.1.1.tbz2"
|
||||||
|
LICENSE="POSTGRESQL"
|
||||||
|
|
||||||
|
S="${WORKDIR}/postgresql-${PV}"
|
||||||
|
|
||||||
|
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW"
|
||||||
|
IUSE="doc kernel_linux nls pam perl -pg_legacytimestamp python selinux tcl uuid xml"
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS} ; do
|
||||||
|
IUSE+=" linguas_${lingua}"
|
||||||
|
done
|
||||||
|
|
||||||
|
wanted_languages() {
|
||||||
|
local enable_langs
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS} ; do
|
||||||
|
use linguas_${lingua} && enable_langs+="${lingua} "
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -n ${enable_langs}
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pam?,pg_legacytimestamp=,nls=]
|
||||||
|
perl? ( >=dev-lang/perl-5.8 )
|
||||||
|
selinux? ( sec-policy/selinux-postgresql )
|
||||||
|
tcl? ( >=dev-lang/tcl-8 )
|
||||||
|
uuid? ( dev-libs/ossp-uuid )
|
||||||
|
xml? ( dev-libs/libxml2 dev-libs/libxslt )"
|
||||||
|
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
sys-devel/flex
|
||||||
|
xml? ( virtual/pkgconfig )"
|
||||||
|
|
||||||
|
PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
|
||||||
|
|
||||||
|
# Support /var/run or /run for the socket directory
|
||||||
|
[[ ! -d /run ]] && RUNDIR=/var
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
enewgroup postgres 70
|
||||||
|
enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
|
||||||
|
|
||||||
|
use python && python_set_active_version 2
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
epatch "${WORKDIR}/autoconf.patch" \
|
||||||
|
"${WORKDIR}/bool.patch" \
|
||||||
|
"${WORKDIR}/darwin.patch" \
|
||||||
|
"${WORKDIR}/ldflags.patch" \
|
||||||
|
"${WORKDIR}/pg_ctl-exit-status.patch" \
|
||||||
|
"${WORKDIR}/server.patch" \
|
||||||
|
"${WORKDIR}/SuperH.patch"
|
||||||
|
|
||||||
|
eprefixify src/include/pg_config_manual.h
|
||||||
|
|
||||||
|
if use test ; then
|
||||||
|
epatch "${WORKDIR}/regress.patch"
|
||||||
|
sed -e "s|@SOCKETDIR@|${T}|g" -i src/test/regress/pg_regress{,_main}.c
|
||||||
|
sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" \
|
||||||
|
-i src/test/regress/{input,output}/tablespace.source
|
||||||
|
else
|
||||||
|
echo "all install:" > "${S}/src/test/regress/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -e "s|@RUNDIR@|${RUNDIR}|g" \
|
||||||
|
-i src/include/pg_config_manual.h "${WORKDIR}/postgresql.init" || \
|
||||||
|
die "RUNDIR sed failed"
|
||||||
|
sed -e "s|@SLOT@|${SLOT}|g" \
|
||||||
|
-i "${WORKDIR}/postgresql.init" "${WORKDIR}/postgresql.confd" || \
|
||||||
|
die "SLOT sed failed"
|
||||||
|
|
||||||
|
eautoconf
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
# eval is needed to get along with pg_config quotation of space-rich entities.
|
||||||
|
eval econf "$(${EPREFIX%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
|
||||||
|
--with-includes="${EPREFIX%/}/usr/include/postgresql-${SLOT}/" \
|
||||||
|
--with-libraries="${EPREFIX%/}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \
|
||||||
|
--with-system-tzdata="${EPREFIX%/}/usr/share/zoneinfo" \
|
||||||
|
$(use_with perl) \
|
||||||
|
$(use_with python) \
|
||||||
|
$(use_with tcl) \
|
||||||
|
$(use_with xml libxml) \
|
||||||
|
$(use_with xml libxslt) \
|
||||||
|
$(use_with uuid ossp-uuid) \
|
||||||
|
"$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2) ; do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake -C $bd -j1 || die "emake in $bd failed"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
if use perl ; then
|
||||||
|
mv -f "${S}/src/pl/plperl/GNUmakefile" \
|
||||||
|
"${S}/src/pl/plperl/GNUmakefile_orig"
|
||||||
|
sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
|
||||||
|
"${S}/src/pl/plperl/GNUmakefile_orig" \
|
||||||
|
> "${S}/src/pl/plperl/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2) ; do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake install -C $bd -j1 DESTDIR="${D}" \
|
||||||
|
|| die "emake install in $bd failed"
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -r "${ED}/usr/share/postgresql-${SLOT}/man/man7/" \
|
||||||
|
"${ED}/usr/share/doc/postgresql-${SLOT}/html"
|
||||||
|
rm "${ED}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1
|
||||||
|
|
||||||
|
dodoc README HISTORY doc/{README.*,TODO,bug.template}
|
||||||
|
|
||||||
|
dodir /etc/eselect/postgresql/slots/${SLOT}
|
||||||
|
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" \
|
||||||
|
> "${ED}/etc/eselect/postgresql/slots/${SLOT}/server"
|
||||||
|
|
||||||
|
newconfd "${WORKDIR}"/postgresql.confd postgresql-${SLOT} \
|
||||||
|
|| die "Inserting conf.d file failed"
|
||||||
|
|
||||||
|
newinitd "${WORKDIR}"/postgresql.init postgresql-${SLOT} \
|
||||||
|
|| die "Inserting init.d file failed"
|
||||||
|
|
||||||
|
use pam && pamd_mimic system-auth postgresql auth account session
|
||||||
|
|
||||||
|
if use prefix ; then
|
||||||
|
keepdir ${RUNDIR}/run/postgresql
|
||||||
|
fperms 0770 ${RUNDIR}/run/postgresql
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
postgresql-config update
|
||||||
|
|
||||||
|
elog "The time stamp format is 64 bit integers now. If you upgrade from older"
|
||||||
|
elog "databases, this may force you to either do a dump and reload of enable"
|
||||||
|
elog "pg_legacytimestamp until you find time to do so. If the database can't start"
|
||||||
|
elog "please try enabling pg_legacytimestamp and rebuild."
|
||||||
|
elog
|
||||||
|
elog "Gentoo specific documentation:"
|
||||||
|
elog "http://www.gentoo.org/doc/en/postgres-howto.xml"
|
||||||
|
elog
|
||||||
|
elog "Official documentation:"
|
||||||
|
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
|
||||||
|
elog
|
||||||
|
elog "The default location of the Unix-domain socket is:"
|
||||||
|
elog " ${EROOT%/}${RUNDIR}/run/postgresql/"
|
||||||
|
elog
|
||||||
|
elog "If you have users and/or services that you would like to utilize the"
|
||||||
|
elog "socket, you must add them to the 'postgres' system group:"
|
||||||
|
elog " usermod -a -G postgres <user>"
|
||||||
|
elog
|
||||||
|
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
|
||||||
|
elog "so that it contains your preferred locale in:"
|
||||||
|
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
elog
|
||||||
|
elog "Then, execute the following command to setup the initial database"
|
||||||
|
elog "environment:"
|
||||||
|
elog " emerge --config =${CATEGORY}/${PF}"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm() {
|
||||||
|
postgresql-config update
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_config() {
|
||||||
|
[[ -f ${EROOT%/}/etc/conf.d/postgresql-${SLOT} ]] && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
[[ -z ${PGDATA} ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
|
||||||
|
[[ -z ${DATA_DIR} ]] && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
|
||||||
|
|
||||||
|
# environment.bz2 may not contain the same locale as the current system
|
||||||
|
# locale. Unset and source from the current system locale.
|
||||||
|
if [[ -f ${EROOT%/}/etc/env.d/02locale ]] ; then
|
||||||
|
unset LANG
|
||||||
|
unset LC_CTYPE
|
||||||
|
unset LC_NUMERIC
|
||||||
|
unset LC_TIME
|
||||||
|
unset LC_COLLATE
|
||||||
|
unset LC_MONETARY
|
||||||
|
unset LC_MESSAGES
|
||||||
|
unset LC_ALL
|
||||||
|
source "${EROOT%/}/etc/env.d/02locale"
|
||||||
|
[[ -n ${LANG} ]] && export LANG
|
||||||
|
[[ -n ${LC_CTYPE} ]] && export LC_CTYPE
|
||||||
|
[[ -n ${LC_NUMERIC} ]] && export LC_NUMERIC
|
||||||
|
[[ -n ${LC_TIME} ]] && export LC_TIME
|
||||||
|
[[ -n ${LC_COLLATE} ]] && export LC_COLLATE
|
||||||
|
[[ -n ${LC_MONETARY} ]] && export LC_MONETARY
|
||||||
|
[[ -n ${LC_MESSAGES} ]] && export LC_MESSAGES
|
||||||
|
[[ -n ${LC_ALL} ]] && export LC_ALL
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "You can modify the paths and options passed to initdb by editing:"
|
||||||
|
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
einfo
|
||||||
|
einfo "Information on options that can be passed to initdb are found at:"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
|
||||||
|
einfo
|
||||||
|
einfo "PG_INITDB_OPTS is currently set to:"
|
||||||
|
if [[ -z ${PG_INITDB_OPTS} ]] ; then
|
||||||
|
einfo " (none)"
|
||||||
|
else
|
||||||
|
einfo " ${PG_INITDB_OPTS}"
|
||||||
|
fi
|
||||||
|
einfo
|
||||||
|
einfo "Configuration files will be installed to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo
|
||||||
|
einfo "The database cluster will be created in:"
|
||||||
|
einfo " ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
while [[ $correct != "true" ]] ; do
|
||||||
|
einfo "Are you ready to continue? (y/n)"
|
||||||
|
read answer
|
||||||
|
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
|
||||||
|
correct="true"
|
||||||
|
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
|
||||||
|
die "Aborting initialization."
|
||||||
|
else
|
||||||
|
echo "Answer not recognized"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ]] ; then
|
||||||
|
eerror "The given directory, '${DATA_DIR}', is not empty."
|
||||||
|
eerror "Modify DATA_DIR to point to an empty directory."
|
||||||
|
die "${DATA_DIR} is not empty."
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ -z ${PG_MAX_CONNECTIONS} ]] && PG_MAX_CONNECTIONS=128
|
||||||
|
einfo "Checking system parameters..."
|
||||||
|
|
||||||
|
if ! use kernel_linux ; then
|
||||||
|
einfo "Skipped."
|
||||||
|
einfo " Tests not supported on this OS (yet)"
|
||||||
|
else
|
||||||
|
if [[ -z ${SKIP_SYSTEM_TESTS} ]] ; then
|
||||||
|
einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
|
||||||
|
|
||||||
|
local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
|
||||||
|
local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
|
||||||
|
local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
|
||||||
|
local SHMMAX=$(sysctl -n kernel.shmmax)
|
||||||
|
|
||||||
|
local SEMMSL_MIN=17
|
||||||
|
local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
|
||||||
|
local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
|
||||||
|
local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
|
||||||
|
|
||||||
|
for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
|
||||||
|
if [[ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ]] ; then
|
||||||
|
eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
|
||||||
|
eerror "You have now several options:"
|
||||||
|
eerror " - Change the mentioned system parameter"
|
||||||
|
eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a"
|
||||||
|
eerror " value lower than ${PG_MAX_CONNECTIONS}"
|
||||||
|
eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
|
||||||
|
eerror "More information can be found here:"
|
||||||
|
eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
|
||||||
|
die "System test failed."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
einfo "Passed."
|
||||||
|
else
|
||||||
|
ewarn "SKIP_SYSTEM_TESTS set, so skipping."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
einfo "Creating the data directory ..."
|
||||||
|
mkdir -p "${DATA_DIR}"
|
||||||
|
chown -Rf postgres:postgres "${DATA_DIR}"
|
||||||
|
chmod 0700 "${DATA_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "Initializing the database ..."
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
|
||||||
|
else
|
||||||
|
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
|
||||||
|
fi
|
||||||
|
mv "${DATA_DIR%/}"/*.conf "${PGDATA}"
|
||||||
|
|
||||||
|
einfo "The autovacuum function, which was in contrib, has been moved to the main"
|
||||||
|
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled by"
|
||||||
|
einfo "default. You can disable it in the cluster's:"
|
||||||
|
einfo " ${PGDATA%/}/postgresql.conf"
|
||||||
|
einfo
|
||||||
|
einfo "The PostgreSQL server, by default, will log events to:"
|
||||||
|
einfo " ${DATA_DIR%/}/postmaster.log"
|
||||||
|
einfo
|
||||||
|
if use prefix ; then
|
||||||
|
einfo "The location of the configuration files have moved to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo
|
||||||
|
einfo "To start the server:"
|
||||||
|
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
|
||||||
|
einfo
|
||||||
|
einfo "To stop:"
|
||||||
|
einfo " pg_ctl stop -D ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
einfo "Or move the configuration files back:"
|
||||||
|
einfo " mv ${PGDATA}*.conf ${DATA_DIR}"
|
||||||
|
else
|
||||||
|
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
|
||||||
|
einfo "instead of 'pg_ctl'."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
|
||||||
|
|
||||||
|
if [[ ${UID} != 0 ]] ; then
|
||||||
|
emake check || die "Make check failed. See above for details."
|
||||||
|
|
||||||
|
einfo "If you think other tests besides the regression tests are necessary, please"
|
||||||
|
einfo "submit a bug including a patch for this ebuild to enable them."
|
||||||
|
else
|
||||||
|
ewarn "Tests cannot be run as root. Skipping."
|
||||||
|
ewarn "HINT: FEATURES=\"userpriv\""
|
||||||
|
fi
|
||||||
|
}
|
@ -0,0 +1,342 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.0.8-r1.ebuild,v 1.1 2012/06/08 16:29:46 titanofold Exp $
|
||||||
|
|
||||||
|
EAPI="4"
|
||||||
|
PYTHON_DEPEND="python? 2"
|
||||||
|
|
||||||
|
WANT_AUTOMAKE="none"
|
||||||
|
inherit autotools eutils multilib pam prefix python user versionator
|
||||||
|
|
||||||
|
SLOT="$(get_version_component_range 1-2)"
|
||||||
|
|
||||||
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~ppc-macos ~x86-solaris"
|
||||||
|
|
||||||
|
DESCRIPTION="PostgreSQL server"
|
||||||
|
HOMEPAGE="http://www.postgresql.org/"
|
||||||
|
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-patches-9.0-r3.tbz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-initscript-2.1.1.tbz2"
|
||||||
|
LICENSE="POSTGRESQL"
|
||||||
|
|
||||||
|
S="${WORKDIR}/postgresql-${PV}"
|
||||||
|
|
||||||
|
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW"
|
||||||
|
IUSE="doc kernel_linux nls pam perl -pg_legacytimestamp python selinux tcl uuid xml"
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS}; do
|
||||||
|
IUSE+=" linguas_${lingua}"
|
||||||
|
done
|
||||||
|
|
||||||
|
wanted_languages() {
|
||||||
|
local enable_langs
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS} ; do
|
||||||
|
use linguas_${lingua} && enable_langs+="${lingua} "
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -n ${enable_langs}
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pam?,pg_legacytimestamp=,nls=]
|
||||||
|
perl? ( >=dev-lang/perl-5.8 )
|
||||||
|
selinux? ( sec-policy/selinux-postgresql )
|
||||||
|
tcl? ( >=dev-lang/tcl-8 )
|
||||||
|
uuid? ( dev-libs/ossp-uuid )
|
||||||
|
xml? ( dev-libs/libxml2 dev-libs/libxslt )"
|
||||||
|
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
sys-devel/flex
|
||||||
|
xml? ( virtual/pkgconfig )"
|
||||||
|
|
||||||
|
PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
|
||||||
|
|
||||||
|
# Support /var/run or /run for the socket directory
|
||||||
|
[[ ! -d /run ]] && RUNDIR=/var
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
enewgroup postgres 70
|
||||||
|
enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
|
||||||
|
|
||||||
|
use python && python_set_active_version 2
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
epatch "${WORKDIR}/autoconf.patch" \
|
||||||
|
"${WORKDIR}/bool.patch" \
|
||||||
|
"${WORKDIR}/pg_ctl-exit-status.patch" \
|
||||||
|
"${WORKDIR}/server.patch"
|
||||||
|
|
||||||
|
eprefixify src/include/pg_config_manual.h
|
||||||
|
|
||||||
|
if use test ; then
|
||||||
|
epatch "${WORKDIR}/regress.patch"
|
||||||
|
sed -e "s|@SOCKETDIR@|${T}|g" -i src/test/regress/pg_regress{,_main}.c
|
||||||
|
sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" \
|
||||||
|
-i src/test/regress/{input,output}/tablespace.source
|
||||||
|
else
|
||||||
|
echo "all install:" > "${S}/src/test/regress/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -e "s|@RUNDIR@|${RUNDIR}|g" \
|
||||||
|
-i src/include/pg_config_manual.h "${WORKDIR}/postgresql.init" || \
|
||||||
|
die "RUNDIR sed failed"
|
||||||
|
sed -e "s|@SLOT@|${SLOT}|g" \
|
||||||
|
-i "${WORKDIR}/postgresql.init" "${WORKDIR}/postgresql.confd" || \
|
||||||
|
die "SLOT sed failed"
|
||||||
|
|
||||||
|
eautoconf
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
# eval is needed to get along with pg_config quotation of space-rich entities.
|
||||||
|
eval econf "$(${EPREFIX%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
|
||||||
|
--with-includes="${EPREFIX%/}/usr/include/postgresql-${SLOT}/" \
|
||||||
|
--with-libraries="${EPREFIX%/}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \
|
||||||
|
--with-system-tzdata="${EPREFIX%/}/usr/share/zoneinfo" \
|
||||||
|
$(use_with perl) \
|
||||||
|
$(use_with python) \
|
||||||
|
$(use_with tcl) \
|
||||||
|
$(use_with xml libxml) \
|
||||||
|
$(use_with xml libxslt) \
|
||||||
|
$(use_with uuid ossp-uuid) \
|
||||||
|
"$(use_enable nls nls "$(wanted_languages)")"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2); do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake -C $bd -j1 || die "emake in $bd failed"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
if use perl ; then
|
||||||
|
mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
|
||||||
|
sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
|
||||||
|
"${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2) ; do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake install -C $bd -j1 DESTDIR="${D}" || die "emake install in $bd failed"
|
||||||
|
done
|
||||||
|
|
||||||
|
dodir /usr/share/postgresql-${SLOT}/man/man1/
|
||||||
|
cp "${S}"/doc/src/sgml/man1/{initdb,pg_controldata,pg_ctl,pg_resetxlog,post{gres,master}}.1 \
|
||||||
|
"${ED}"/usr/share/postgresql-${SLOT}/man/man1/ || die
|
||||||
|
|
||||||
|
dodoc README HISTORY doc/{README.*,TODO,bug.template}
|
||||||
|
|
||||||
|
dodir /etc/eselect/postgresql/slots/${SLOT}
|
||||||
|
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" \
|
||||||
|
> "${ED}/etc/eselect/postgresql/slots/${SLOT}/server"
|
||||||
|
|
||||||
|
newconfd "${WORKDIR}/postgresql.confd" postgresql-${SLOT} \
|
||||||
|
|| die "Inserting conf.d file failed"
|
||||||
|
|
||||||
|
newinitd "${WORKDIR}/postgresql.init" postgresql-${SLOT} \
|
||||||
|
|| die "Inserting init.d file failed"
|
||||||
|
|
||||||
|
use pam && pamd_mimic system-auth postgresql auth account session
|
||||||
|
|
||||||
|
if use prefix ; then
|
||||||
|
keepdir ${RUNDIR}/run/postgresql
|
||||||
|
fperms 0770 ${RUNDIR}/run/postgresql
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
postgresql-config update
|
||||||
|
|
||||||
|
elog "Gentoo specific documentation:"
|
||||||
|
elog "http://www.gentoo.org/doc/en/postgres-howto.xml"
|
||||||
|
elog
|
||||||
|
elog "Official documentation:"
|
||||||
|
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
|
||||||
|
elog
|
||||||
|
elog "The default location of the Unix-domain socket is:"
|
||||||
|
elog " ${EROOT%/}${RUNDIR}/run/postgresql/"
|
||||||
|
elog
|
||||||
|
elog "If you have users and/or services that you would like to utilize the"
|
||||||
|
elog "socket, you must add them to the 'postgres' system group:"
|
||||||
|
elog " usermod -a -G postgres <user>"
|
||||||
|
elog
|
||||||
|
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
|
||||||
|
elog "so that it contains your preferred locale in:"
|
||||||
|
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
elog
|
||||||
|
elog "Then, execute the following command to setup the initial database"
|
||||||
|
elog "environment:"
|
||||||
|
elog " emerge --config =${CATEGORY}/${PF}"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm() {
|
||||||
|
postgresql-config update
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_config() {
|
||||||
|
[[ -f ${EROOT%/}/etc/conf.d/postgresql-${SLOT} ]] && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
[[ -z ${PGDATA} ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
|
||||||
|
[[ -z ${DATA_DIR} ]] && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
|
||||||
|
|
||||||
|
# environment.bz2 may not contain the same locale as the current system
|
||||||
|
# locale. Unset and source from the current system locale.
|
||||||
|
if [[ -f ${EROOT%/}/etc/env.d/02locale ]] ; then
|
||||||
|
unset LANG
|
||||||
|
unset LC_CTYPE
|
||||||
|
unset LC_NUMERIC
|
||||||
|
unset LC_TIME
|
||||||
|
unset LC_COLLATE
|
||||||
|
unset LC_MONETARY
|
||||||
|
unset LC_MESSAGES
|
||||||
|
unset LC_ALL
|
||||||
|
source "${EROOT%/}/etc/env.d/02locale"
|
||||||
|
[[ -n ${LANG} ]] && export LANG
|
||||||
|
[[ -n ${LC_CTYPE} ]] && export LC_CTYPE
|
||||||
|
[[ -n ${LC_NUMERIC} ]] && export LC_NUMERIC
|
||||||
|
[[ -n ${LC_TIME} ]] && export LC_TIME
|
||||||
|
[[ -n ${LC_COLLATE} ]] && export LC_COLLATE
|
||||||
|
[[ -n ${LC_MONETARY} ]] && export LC_MONETARY
|
||||||
|
[[ -n ${LC_MESSAGES} ]] && export LC_MESSAGES
|
||||||
|
[[ -n ${LC_ALL} ]] && export LC_ALL
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "You can modify the paths and options passed to initdb by editing:"
|
||||||
|
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
einfo
|
||||||
|
einfo "Information on options that can be passed to initdb are found at:"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
|
||||||
|
einfo
|
||||||
|
einfo "PG_INITDB_OPTS is currently set to:"
|
||||||
|
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
|
||||||
|
einfo " (none)"
|
||||||
|
else
|
||||||
|
einfo " ${PG_INITDB_OPTS}"
|
||||||
|
fi
|
||||||
|
einfo
|
||||||
|
einfo "Configuration files will be installed to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo
|
||||||
|
einfo "The database cluster will be created in:"
|
||||||
|
einfo " ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
while [[ $correct != "true" ]] ; do
|
||||||
|
einfo "Are you ready to continue? (y/n)"
|
||||||
|
read answer
|
||||||
|
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
|
||||||
|
correct="true"
|
||||||
|
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
|
||||||
|
die "Aborting initialization."
|
||||||
|
else
|
||||||
|
echo "Answer not recognized"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ]] ; then
|
||||||
|
eerror "The given directory, '${DATA_DIR}', is not empty."
|
||||||
|
eerror "Modify DATA_DIR to point to an empty directory."
|
||||||
|
die "${DATA_DIR} is not empty."
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ -z ${PG_MAX_CONNECTIONS} ]] && PG_MAX_CONNECTIONS=128
|
||||||
|
einfo "Checking system parameters..."
|
||||||
|
|
||||||
|
if ! use kernel_linux ; then
|
||||||
|
einfo "Skipped."
|
||||||
|
einfo " Tests not supported on this OS (yet)"
|
||||||
|
else
|
||||||
|
if [[ -z ${SKIP_SYSTEM_TESTS} ]] ; then
|
||||||
|
einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
|
||||||
|
|
||||||
|
local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
|
||||||
|
local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
|
||||||
|
local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
|
||||||
|
local SHMMAX=$(sysctl -n kernel.shmmax)
|
||||||
|
|
||||||
|
local SEMMSL_MIN=17
|
||||||
|
local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
|
||||||
|
local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
|
||||||
|
local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
|
||||||
|
|
||||||
|
for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
|
||||||
|
if [[ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ]] ; then
|
||||||
|
eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
|
||||||
|
eerror "You have now several options:"
|
||||||
|
eerror " - Change the mentioned system parameter"
|
||||||
|
eerror " - Lower the number of max connections by setting PG_MAX_CONNECTIONS to a"
|
||||||
|
eerror " value lower than ${PG_MAX_CONNECTIONS}"
|
||||||
|
eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
|
||||||
|
eerror "More information can be found here:"
|
||||||
|
eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
|
||||||
|
die "System test failed."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
einfo "Passed."
|
||||||
|
else
|
||||||
|
ewarn "SKIP_SYSTEM_TESTS set, so skipping."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
einfo "Creating the data directory ..."
|
||||||
|
mkdir -p "${DATA_DIR}"
|
||||||
|
chown -Rf postgres:postgres "${DATA_DIR}"
|
||||||
|
chmod 0700 "${DATA_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "Initializing the database ..."
|
||||||
|
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
su postgres \
|
||||||
|
-c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D '${DATA_DIR}' -L '${EROOT%/}/usr/share/postgresql-${SLOT}/' ${PG_INITDB_OPTS}"
|
||||||
|
else
|
||||||
|
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb \
|
||||||
|
-U postgres -D "${DATA_DIR}" \
|
||||||
|
-L "${EROOT%/}/usr/share/postgresql-${SLOT}/" ${PG_INITDB_OPTS}
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv "${DATA_DIR%/}"/*.conf "${PGDATA}"
|
||||||
|
|
||||||
|
einfo "The autovacuum function, which was in contrib, has been moved to the main"
|
||||||
|
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
|
||||||
|
einfo "by default. You can disable it in the cluster's:"
|
||||||
|
einfo " ${PGDATA%/}/postgresql.conf"
|
||||||
|
einfo
|
||||||
|
einfo "The PostgreSQL server, by default, will log events to:"
|
||||||
|
einfo " ${DATA_DIR%/}/postmaster.log"
|
||||||
|
einfo
|
||||||
|
if use prefix ; then
|
||||||
|
einfo "The location of the configuration files have moved to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo
|
||||||
|
einfo "To start the server:"
|
||||||
|
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
|
||||||
|
einfo
|
||||||
|
einfo "To stop:"
|
||||||
|
einfo " pg_ctl stop -D ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
einfo "Or move the configuration files back:"
|
||||||
|
einfo " mv ${PGDATA}*.conf ${DATA_DIR}"
|
||||||
|
else
|
||||||
|
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
|
||||||
|
einfo "instead of 'pg_ctl'."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
|
||||||
|
|
||||||
|
if [[ ${UID} != 0 ]] ; then
|
||||||
|
emake check || die "Make check failed. See above for details."
|
||||||
|
|
||||||
|
einfo "If you think other tests besides the regression tests are necessary, please"
|
||||||
|
einfo "submit a bug including a patch for this ebuild to enable them."
|
||||||
|
else
|
||||||
|
ewarn "Tests cannot be run as root. Skipping."
|
||||||
|
ewarn "HINT: FEATURES=\"userpriv\""
|
||||||
|
fi
|
||||||
|
}
|
@ -0,0 +1,348 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.1.4-r1.ebuild,v 1.1 2012/06/08 16:29:46 titanofold Exp $
|
||||||
|
|
||||||
|
EAPI="4"
|
||||||
|
PYTHON_DEPEND="python? 2"
|
||||||
|
|
||||||
|
WANT_AUTOMAKE="none"
|
||||||
|
inherit autotools eutils flag-o-matic multilib pam prefix python user versionator
|
||||||
|
|
||||||
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
|
||||||
|
|
||||||
|
SLOT="$(get_version_component_range 1-2)"
|
||||||
|
S="${WORKDIR}/postgresql-${PV}"
|
||||||
|
|
||||||
|
DESCRIPTION="PostgreSQL server"
|
||||||
|
HOMEPAGE="http://www.postgresql.org/"
|
||||||
|
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-patches-9.1-r1.tbz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-initscript-2.1.1.tbz2"
|
||||||
|
LICENSE="POSTGRESQL"
|
||||||
|
|
||||||
|
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW"
|
||||||
|
IUSE="doc kernel_linux nls pam perl -pg_legacytimestamp python selinux tcl uuid xml"
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS}; do
|
||||||
|
IUSE+=" linguas_${lingua}"
|
||||||
|
done
|
||||||
|
|
||||||
|
wanted_languages() {
|
||||||
|
local enable_langs
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS} ; do
|
||||||
|
use linguas_${lingua} && enable_langs+="${lingua} "
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -n ${enable_langs}
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pam?,pg_legacytimestamp=,nls=]
|
||||||
|
perl? ( >=dev-lang/perl-5.8 )
|
||||||
|
selinux? ( sec-policy/selinux-postgresql )
|
||||||
|
tcl? ( >=dev-lang/tcl-8 )
|
||||||
|
uuid? ( dev-libs/ossp-uuid )
|
||||||
|
xml? ( dev-libs/libxml2 dev-libs/libxslt )"
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
sys-devel/flex
|
||||||
|
xml? ( virtual/pkgconfig )"
|
||||||
|
PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
|
||||||
|
|
||||||
|
# Support /var/run or /run for the socket directory
|
||||||
|
[[ ! -d /run ]] && RUNDIR=/var
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
enewgroup postgres 70
|
||||||
|
enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
|
||||||
|
|
||||||
|
use python && python_set_active_version 2
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
epatch "${WORKDIR}/autoconf.patch" \
|
||||||
|
"${WORKDIR}/bool.patch" \
|
||||||
|
"${WORKDIR}/pg_ctl-exit-status.patch" \
|
||||||
|
"${WORKDIR}/server.patch"
|
||||||
|
|
||||||
|
eprefixify src/include/pg_config_manual.h
|
||||||
|
|
||||||
|
if use test ; then
|
||||||
|
epatch "${WORKDIR}/regress.patch"
|
||||||
|
sed -e "s|@SOCKETDIR@|${T}|g" -i src/test/regress/pg_regress{,_main}.c
|
||||||
|
sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" \
|
||||||
|
-i src/test/regress/{input,output}/tablespace.source
|
||||||
|
else
|
||||||
|
echo "all install:" > "${S}/src/test/regress/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -e "s|@RUNDIR@|${RUNDIR}|g" \
|
||||||
|
-i src/include/pg_config_manual.h "${WORKDIR}/postgresql.init" || \
|
||||||
|
die "RUNDIR sed failed"
|
||||||
|
sed -e "s|@SLOT@|${SLOT}|g" \
|
||||||
|
-i "${WORKDIR}/postgresql.init" "${WORKDIR}/postgresql.confd" || \
|
||||||
|
die "SLOT sed failed"
|
||||||
|
|
||||||
|
eautoconf
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
case ${CHOST} in
|
||||||
|
*-darwin*|*-solaris*)
|
||||||
|
use nls && append-libs intl
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local PO="${EPREFIX%/}"
|
||||||
|
|
||||||
|
# eval is needed to get along with pg_config quotation of space-rich entities.
|
||||||
|
eval econf "$(${PO}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
|
||||||
|
$(use_with perl) \
|
||||||
|
$(use_with python) \
|
||||||
|
$(use_with tcl) \
|
||||||
|
$(use_with xml libxml) \
|
||||||
|
$(use_with xml libxslt) \
|
||||||
|
$(use_with uuid ossp-uuid) \
|
||||||
|
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
|
||||||
|
--with-includes="${PO}/usr/include/postgresql-${SLOT}/" \
|
||||||
|
--with-libraries="${PO}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \
|
||||||
|
"$(use_enable nls nls "$(wanted_languages)")"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2); do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake -C $bd || die "emake in $bd failed"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
if use perl ; then
|
||||||
|
mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
|
||||||
|
sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
|
||||||
|
"${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2) ; do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake install -C $bd DESTDIR="${D}" || die "emake install in $bd failed"
|
||||||
|
done
|
||||||
|
|
||||||
|
dodoc README HISTORY doc/{TODO,bug.template}
|
||||||
|
|
||||||
|
dodir /etc/eselect/postgresql/slots/${SLOT}
|
||||||
|
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
|
||||||
|
"${ED}/etc/eselect/postgresql/slots/${SLOT}/server"
|
||||||
|
|
||||||
|
newconfd "${WORKDIR}/postgresql.confd" postgresql-${SLOT} || \
|
||||||
|
die "Inserting conf failed"
|
||||||
|
newinitd "${WORKDIR}/postgresql.init" postgresql-${SLOT} || \
|
||||||
|
die "Inserting conf failed"
|
||||||
|
|
||||||
|
use pam && pamd_mimic system-auth postgresql auth account session
|
||||||
|
|
||||||
|
if use prefix ; then
|
||||||
|
keepdir ${RUNDIR}/run/postgresql
|
||||||
|
fperms 0770 ${RUNDIR}/run/postgresql
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
postgresql-config update
|
||||||
|
|
||||||
|
elog "Gentoo specific documentation:"
|
||||||
|
elog "http://www.gentoo.org/doc/en/postgres-howto.xml"
|
||||||
|
elog
|
||||||
|
elog "Official documentation:"
|
||||||
|
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
|
||||||
|
elog
|
||||||
|
elog "The default location of the Unix-domain socket is:"
|
||||||
|
elog " ${EROOT%/}${RUNDIR}/run/postgresql/"
|
||||||
|
elog
|
||||||
|
elog "If you have users and/or services that you would like to utilize the"
|
||||||
|
elog "socket, you must add them to the 'postgres' system group:"
|
||||||
|
elog " usermod -a -G postgres <user>"
|
||||||
|
elog
|
||||||
|
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
|
||||||
|
elog "so that it contains your preferred locale in:"
|
||||||
|
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
elog
|
||||||
|
elog "Then, execute the following command to setup the initial database"
|
||||||
|
elog "environment:"
|
||||||
|
elog " emerge --config =${CATEGORY}/${PF}"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_prerm() {
|
||||||
|
if [[ -z ${REPLACED_BY_VERSION} ]] ; then
|
||||||
|
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
|
||||||
|
ewarn "\thttp://www.gentoo.org/doc/en/postgres-howto.xml#doc_chap5"
|
||||||
|
|
||||||
|
ebegin "Resuming removal 10 seconds. Control-C to cancel"
|
||||||
|
sleep 10
|
||||||
|
eend 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm() {
|
||||||
|
postgresql-config update
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_config() {
|
||||||
|
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
|
||||||
|
[[ -z "${DATA_DIR}" ]] && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
|
||||||
|
|
||||||
|
# environment.bz2 may not contain the same locale as the current system
|
||||||
|
# locale. Unset and source from the current system locale.
|
||||||
|
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
|
||||||
|
unset LANG
|
||||||
|
unset LC_CTYPE
|
||||||
|
unset LC_NUMERIC
|
||||||
|
unset LC_TIME
|
||||||
|
unset LC_COLLATE
|
||||||
|
unset LC_MONETARY
|
||||||
|
unset LC_MESSAGES
|
||||||
|
unset LC_ALL
|
||||||
|
source "${EROOT%/}/etc/env.d/02locale"
|
||||||
|
[ -n "${LANG}" ] && export LANG
|
||||||
|
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
|
||||||
|
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
|
||||||
|
[ -n "${LC_TIME}" ] && export LC_TIME
|
||||||
|
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
|
||||||
|
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
|
||||||
|
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
|
||||||
|
[ -n "${LC_ALL}" ] && export LC_ALL
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "You can modify the paths and options passed to initdb by editing:"
|
||||||
|
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
einfo
|
||||||
|
einfo "Information on options that can be passed to initdb are found at:"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
|
||||||
|
einfo
|
||||||
|
einfo "PG_INITDB_OPTS is currently set to:"
|
||||||
|
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
|
||||||
|
einfo " (none)"
|
||||||
|
else
|
||||||
|
einfo " ${PG_INITDB_OPTS}"
|
||||||
|
fi
|
||||||
|
einfo
|
||||||
|
einfo "Configuration files will be installed to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo
|
||||||
|
einfo "The database cluster will be created in:"
|
||||||
|
einfo " ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
while [ "$correct" != "true" ] ; do
|
||||||
|
einfo "Are you ready to continue? (y/n)"
|
||||||
|
read answer
|
||||||
|
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
|
||||||
|
correct="true"
|
||||||
|
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
|
||||||
|
die "Aborting initialization."
|
||||||
|
else
|
||||||
|
echo "Answer not recognized"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
|
||||||
|
eerror "The given directory, '${DATA_DIR}', is not empty."
|
||||||
|
eerror "Modify DATA_DIR to point to an empty directory."
|
||||||
|
die "${DATA_DIR} is not empty."
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
|
||||||
|
einfo "Checking system parameters..."
|
||||||
|
|
||||||
|
if ! use kernel_linux ; then
|
||||||
|
einfo "Skipped."
|
||||||
|
einfo " Tests not supported on this OS (yet)"
|
||||||
|
else
|
||||||
|
if [ -z ${SKIP_SYSTEM_TESTS} ] ; then
|
||||||
|
einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
|
||||||
|
|
||||||
|
local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
|
||||||
|
local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
|
||||||
|
local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
|
||||||
|
local SHMMAX=$(sysctl -n kernel.shmmax)
|
||||||
|
|
||||||
|
local SEMMSL_MIN=17
|
||||||
|
local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
|
||||||
|
local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
|
||||||
|
local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
|
||||||
|
|
||||||
|
for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
|
||||||
|
if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then
|
||||||
|
eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
|
||||||
|
eerror "You have now several options:"
|
||||||
|
eerror " - Change the mentioned system parameter"
|
||||||
|
eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a"
|
||||||
|
eerror " value lower than ${PG_MAX_CONNECTIONS}"
|
||||||
|
eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
|
||||||
|
eerror "More information can be found here:"
|
||||||
|
eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
|
||||||
|
die "System test failed."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
einfo "Passed."
|
||||||
|
else
|
||||||
|
ewarn "SKIP_SYSTEM_TESTS set, so skipping."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "Creating the data directory ..."
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
mkdir -p "${DATA_DIR}"
|
||||||
|
chown -Rf postgres:postgres "${DATA_DIR}"
|
||||||
|
chmod 0700 "${DATA_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "Initializing the database ..."
|
||||||
|
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
|
||||||
|
else
|
||||||
|
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv "${DATA_DIR%/}"/*.conf "${PGDATA}"
|
||||||
|
|
||||||
|
einfo "The autovacuum function, which was in contrib, has been moved to the main"
|
||||||
|
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
|
||||||
|
einfo "by default. You can disable it in the cluster's:"
|
||||||
|
einfo " ${PGDATA%/}/postgresql.conf"
|
||||||
|
einfo
|
||||||
|
einfo "The PostgreSQL server, by default, will log events to:"
|
||||||
|
einfo " ${DATA_DIR%/}/postmaster.log"
|
||||||
|
einfo
|
||||||
|
if use prefix ; then
|
||||||
|
einfo "The location of the configuration files have moved to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo "To start the server:"
|
||||||
|
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
|
||||||
|
einfo "To stop:"
|
||||||
|
einfo " pg_ctl stop -D ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
einfo "Or move the configuration files back:"
|
||||||
|
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
|
||||||
|
else
|
||||||
|
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
|
||||||
|
einfo "instead of 'pg_ctl'."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
|
||||||
|
|
||||||
|
if [ ${UID} -ne 0 ] ; then
|
||||||
|
emake -j1 check || die "Make check failed. See above for details."
|
||||||
|
|
||||||
|
einfo "If you think other tests besides the regression tests are necessary, please"
|
||||||
|
einfo "submit a bug including a patch for this ebuild to enable them."
|
||||||
|
else
|
||||||
|
ewarn "Tests cannot be run as root. Skipping."
|
||||||
|
ewarn "HINT: FEATURES=\"userpriv\""
|
||||||
|
fi
|
||||||
|
}
|
@ -0,0 +1,357 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.2.0_beta2-r1.ebuild,v 1.1 2012/06/08 16:29:46 titanofold Exp $
|
||||||
|
|
||||||
|
EAPI="4"
|
||||||
|
PYTHON_DEPEND="python? 2"
|
||||||
|
|
||||||
|
WANT_AUTOMAKE="none"
|
||||||
|
inherit autotools eutils flag-o-matic multilib pam prefix python user versionator
|
||||||
|
|
||||||
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
|
||||||
|
|
||||||
|
SLOT="$(get_version_component_range 1-2)"
|
||||||
|
|
||||||
|
# Comment the following six lines when not a beta or rc.
|
||||||
|
MY_PV="${PV//_}"
|
||||||
|
MY_FILE_PV="${SLOT}$(get_version_component_range 4)"
|
||||||
|
S="${WORKDIR}/postgresql-${MY_FILE_PV}"
|
||||||
|
SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_FILE_PV}.tar.bz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-patches-${MY_FILE_PV}.tbz2
|
||||||
|
http://dev.gentoo.org/~titanofold/postgresql-initscript-2.3.tbz2"
|
||||||
|
|
||||||
|
# Comment the following four lines when a beta or rc.
|
||||||
|
#S="${WORKDIR}/postgresql-${PV}"
|
||||||
|
#SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2
|
||||||
|
# http://dev.gentoo.org/~titanofold/postgresql-patches-${PV}.tbz2
|
||||||
|
# http://dev.gentoo.org/~titanofold/postgresql-initscript-2.1.tbz2"
|
||||||
|
|
||||||
|
LICENSE="POSTGRESQL"
|
||||||
|
DESCRIPTION="PostgreSQL server"
|
||||||
|
HOMEPAGE="http://www.postgresql.org/"
|
||||||
|
|
||||||
|
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW"
|
||||||
|
IUSE="doc kernel_linux nls pam perl -pg_legacytimestamp python selinux tcl uuid xml"
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS}; do
|
||||||
|
IUSE+=" linguas_${lingua}"
|
||||||
|
done
|
||||||
|
|
||||||
|
wanted_languages() {
|
||||||
|
local enable_langs
|
||||||
|
|
||||||
|
for lingua in ${LINGUAS} ; do
|
||||||
|
use linguas_${lingua} && enable_langs+="${lingua} "
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -n ${enable_langs}
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pam?,pg_legacytimestamp=,nls=]
|
||||||
|
perl? ( >=dev-lang/perl-5.8 )
|
||||||
|
selinux? ( sec-policy/selinux-postgresql )
|
||||||
|
tcl? ( >=dev-lang/tcl-8 )
|
||||||
|
uuid? ( dev-libs/ossp-uuid )
|
||||||
|
xml? ( dev-libs/libxml2 dev-libs/libxslt )"
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
sys-devel/flex
|
||||||
|
xml? ( virtual/pkgconfig )"
|
||||||
|
PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
|
||||||
|
|
||||||
|
# Support /var/run or /run for the socket directory
|
||||||
|
[[ ! -d /run ]] && RUNDIR=/var
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
enewgroup postgres 70
|
||||||
|
enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
|
||||||
|
|
||||||
|
use python && python_set_active_version 2
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
epatch "${WORKDIR}/autoconf.patch" \
|
||||||
|
"${WORKDIR}/bool.patch" \
|
||||||
|
"${WORKDIR}/server.patch"
|
||||||
|
|
||||||
|
eprefixify src/include/pg_config_manual.h
|
||||||
|
|
||||||
|
if use test ; then
|
||||||
|
epatch "${WORKDIR}/regress.patch"
|
||||||
|
sed -e "s|@SOCKETDIR@|${T}|g" -i src/test/regress/pg_regress{,_main}.c
|
||||||
|
# sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" \
|
||||||
|
# -i src/test/regress/{input,output}/tablespace.source
|
||||||
|
else
|
||||||
|
echo "all install:" > "${S}/src/test/regress/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -e "s|@RUNDIR@|${RUNDIR}|g" \
|
||||||
|
-i src/include/pg_config_manual.h "${WORKDIR}/postgresql.init" || \
|
||||||
|
die "RUNDIR sed failed"
|
||||||
|
sed -e "s|@SLOT@|${SLOT}|g" \
|
||||||
|
-i "${WORKDIR}/postgresql.init" "${WORKDIR}/postgresql.confd" || \
|
||||||
|
die "SLOT sed failed"
|
||||||
|
|
||||||
|
eautoconf
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
case ${CHOST} in
|
||||||
|
*-darwin*|*-solaris*)
|
||||||
|
use nls && append-libs intl
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local PO="${EPREFIX%/}"
|
||||||
|
|
||||||
|
# eval is needed to get along with pg_config quotation of space-rich entities.
|
||||||
|
eval econf "$(${PO}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
|
||||||
|
$(use_with perl) \
|
||||||
|
$(use_with python) \
|
||||||
|
$(use_with tcl) \
|
||||||
|
$(use_with xml libxml) \
|
||||||
|
$(use_with xml libxslt) \
|
||||||
|
$(use_with uuid ossp-uuid) \
|
||||||
|
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
|
||||||
|
--with-includes="${PO}/usr/include/postgresql-${SLOT}/" \
|
||||||
|
--with-libraries="${PO}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \
|
||||||
|
"$(use_enable nls nls "$(wanted_languages)")"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2); do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake -C $bd || die "emake in $bd failed"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
if use perl ; then
|
||||||
|
mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
|
||||||
|
sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
|
||||||
|
"${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local bd
|
||||||
|
for bd in . contrib $(use xml && echo contrib/xml2) ; do
|
||||||
|
PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
|
||||||
|
emake install -C $bd DESTDIR="${D}" || die "emake install in $bd failed"
|
||||||
|
done
|
||||||
|
|
||||||
|
dodoc README HISTORY doc/{TODO,bug.template}
|
||||||
|
|
||||||
|
dodir /etc/eselect/postgresql/slots/${SLOT}
|
||||||
|
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
|
||||||
|
"${ED}/etc/eselect/postgresql/slots/${SLOT}/server"
|
||||||
|
|
||||||
|
newconfd "${WORKDIR}/postgresql.confd" postgresql-${SLOT} || \
|
||||||
|
die "Inserting conf failed"
|
||||||
|
newinitd "${WORKDIR}/postgresql.init" postgresql-${SLOT} || \
|
||||||
|
die "Inserting conf failed"
|
||||||
|
|
||||||
|
use pam && pamd_mimic system-auth postgresql auth account session
|
||||||
|
|
||||||
|
if use prefix ; then
|
||||||
|
keepdir ${RUNDIR}/run/postgresql
|
||||||
|
fperms 0770 ${RUNDIR}/run/postgresql
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
postgresql-config update
|
||||||
|
|
||||||
|
elog "Gentoo specific documentation:"
|
||||||
|
elog "http://www.gentoo.org/doc/en/postgres-howto.xml"
|
||||||
|
elog
|
||||||
|
elog "Official documentation:"
|
||||||
|
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
|
||||||
|
elog
|
||||||
|
elog "The default location of the Unix-domain socket is:"
|
||||||
|
elog " ${EROOT%/}${RUNDIR}/run/postgresql/"
|
||||||
|
elog
|
||||||
|
elog "If you have users and/or services that you would like to utilize the"
|
||||||
|
elog "socket, you must add them to the 'postgres' system group:"
|
||||||
|
elog " usermod -a -G postgres <user>"
|
||||||
|
elog
|
||||||
|
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
|
||||||
|
elog "so that it contains your preferred locale in:"
|
||||||
|
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
elog
|
||||||
|
elog "Then, execute the following command to setup the initial database"
|
||||||
|
elog "environment:"
|
||||||
|
elog " emerge --config =${CATEGORY}/${PF}"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_prerm() {
|
||||||
|
if [[ -z ${REPLACED_BY_VERSION} ]] ; then
|
||||||
|
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
|
||||||
|
ewarn "\thttp://www.gentoo.org/doc/en/postgres-howto.xml#doc_chap5"
|
||||||
|
|
||||||
|
ebegin "Resuming removal 10 seconds. Control-C to cancel"
|
||||||
|
sleep 10
|
||||||
|
eend 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm() {
|
||||||
|
postgresql-config update
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_config() {
|
||||||
|
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
|
||||||
|
[[ -z "${DATA_DIR}" ]] && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
|
||||||
|
|
||||||
|
# environment.bz2 may not contain the same locale as the current system
|
||||||
|
# locale. Unset and source from the current system locale.
|
||||||
|
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
|
||||||
|
unset LANG
|
||||||
|
unset LC_CTYPE
|
||||||
|
unset LC_NUMERIC
|
||||||
|
unset LC_TIME
|
||||||
|
unset LC_COLLATE
|
||||||
|
unset LC_MONETARY
|
||||||
|
unset LC_MESSAGES
|
||||||
|
unset LC_ALL
|
||||||
|
source "${EROOT%/}/etc/env.d/02locale"
|
||||||
|
[ -n "${LANG}" ] && export LANG
|
||||||
|
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
|
||||||
|
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
|
||||||
|
[ -n "${LC_TIME}" ] && export LC_TIME
|
||||||
|
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
|
||||||
|
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
|
||||||
|
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
|
||||||
|
[ -n "${LC_ALL}" ] && export LC_ALL
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "You can modify the paths and options passed to initdb by editing:"
|
||||||
|
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
|
||||||
|
einfo
|
||||||
|
einfo "Information on options that can be passed to initdb are found at:"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
|
||||||
|
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
|
||||||
|
einfo
|
||||||
|
einfo "PG_INITDB_OPTS is currently set to:"
|
||||||
|
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
|
||||||
|
einfo " (none)"
|
||||||
|
else
|
||||||
|
einfo " ${PG_INITDB_OPTS}"
|
||||||
|
fi
|
||||||
|
einfo
|
||||||
|
einfo "Configuration files will be installed to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo
|
||||||
|
einfo "The database cluster will be created in:"
|
||||||
|
einfo " ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
while [ "$correct" != "true" ] ; do
|
||||||
|
einfo "Are you ready to continue? (y/n)"
|
||||||
|
read answer
|
||||||
|
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
|
||||||
|
correct="true"
|
||||||
|
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
|
||||||
|
die "Aborting initialization."
|
||||||
|
else
|
||||||
|
echo "Answer not recognized"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
|
||||||
|
eerror "The given directory, '${DATA_DIR}', is not empty."
|
||||||
|
eerror "Modify DATA_DIR to point to an empty directory."
|
||||||
|
die "${DATA_DIR} is not empty."
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
|
||||||
|
einfo "Checking system parameters..."
|
||||||
|
|
||||||
|
if ! use kernel_linux ; then
|
||||||
|
einfo "Skipped."
|
||||||
|
einfo " Tests not supported on this OS (yet)"
|
||||||
|
else
|
||||||
|
if [ -z ${SKIP_SYSTEM_TESTS} ] ; then
|
||||||
|
einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
|
||||||
|
|
||||||
|
local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
|
||||||
|
local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
|
||||||
|
local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
|
||||||
|
local SHMMAX=$(sysctl -n kernel.shmmax)
|
||||||
|
|
||||||
|
local SEMMSL_MIN=17
|
||||||
|
local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
|
||||||
|
local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
|
||||||
|
local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
|
||||||
|
|
||||||
|
for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
|
||||||
|
if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then
|
||||||
|
eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
|
||||||
|
eerror "You have now several options:"
|
||||||
|
eerror " - Change the mentioned system parameter"
|
||||||
|
eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a"
|
||||||
|
eerror " value lower than ${PG_MAX_CONNECTIONS}"
|
||||||
|
eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
|
||||||
|
eerror "More information can be found here:"
|
||||||
|
eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
|
||||||
|
die "System test failed."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
einfo "Passed."
|
||||||
|
else
|
||||||
|
ewarn "SKIP_SYSTEM_TESTS set, so skipping."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "Creating the data directory ..."
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
mkdir -p "${DATA_DIR}"
|
||||||
|
chown -Rf postgres:postgres "${DATA_DIR}"
|
||||||
|
chmod 0700 "${DATA_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "Initializing the database ..."
|
||||||
|
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
|
||||||
|
else
|
||||||
|
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv "${DATA_DIR%/}"/*.conf "${PGDATA}"
|
||||||
|
|
||||||
|
einfo "The autovacuum function, which was in contrib, has been moved to the main"
|
||||||
|
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
|
||||||
|
einfo "by default. You can disable it in the cluster's:"
|
||||||
|
einfo " ${PGDATA%/}/postgresql.conf"
|
||||||
|
einfo
|
||||||
|
einfo "The PostgreSQL server, by default, will log events to:"
|
||||||
|
einfo " ${DATA_DIR%/}/postmaster.log"
|
||||||
|
einfo
|
||||||
|
if use prefix ; then
|
||||||
|
einfo "The location of the configuration files have moved to:"
|
||||||
|
einfo " ${PGDATA}"
|
||||||
|
einfo "To start the server:"
|
||||||
|
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
|
||||||
|
einfo "To stop:"
|
||||||
|
einfo " pg_ctl stop -D ${DATA_DIR}"
|
||||||
|
einfo
|
||||||
|
einfo "Or move the configuration files back:"
|
||||||
|
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
|
||||||
|
else
|
||||||
|
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
|
||||||
|
einfo "instead of 'pg_ctl'."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
|
||||||
|
|
||||||
|
if [ ${UID} -ne 0 ] ; then
|
||||||
|
emake check || die "Make check failed. See above for details."
|
||||||
|
|
||||||
|
einfo "If you think other tests besides the regression tests are necessary, please"
|
||||||
|
einfo "submit a bug including a patch for this ebuild to enable them."
|
||||||
|
else
|
||||||
|
ewarn "Tests cannot be run as root. Skipping."
|
||||||
|
ewarn "HINT: FEATURES=\"userpriv\""
|
||||||
|
fi
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
DIST v8-3.10.8.11.tar.bz2 10063581 RMD160 4cc0c3b5b6cd7103c7e7d200fb832600b0f66cee SHA1 338108c0d82aac8c7de8ebf2aefffef8bd500626 SHA256 dc1bf6ff00dc0f530f208d5ad3dccce3ad297ba2f93814d6a762e5c4e10d7d18
|
DIST v8-3.10.8.11.tar.bz2 10063581 RMD160 4cc0c3b5b6cd7103c7e7d200fb832600b0f66cee SHA1 338108c0d82aac8c7de8ebf2aefffef8bd500626 SHA256 dc1bf6ff00dc0f530f208d5ad3dccce3ad297ba2f93814d6a762e5c4e10d7d18
|
||||||
DIST v8-3.10.8.13.tar.bz2 10063660 RMD160 5601591b0ad66fe89f0bd62b5241591d018fd695 SHA1 bc9fda97a98324dc45294b663d49ef611c37cbb5 SHA256 5d9447fef9c6421b0f11501ba1303e7bee41ea08659e19d321d93bdeb9c58e3f
|
DIST v8-3.10.8.13.tar.bz2 10063660 RMD160 5601591b0ad66fe89f0bd62b5241591d018fd695 SHA1 bc9fda97a98324dc45294b663d49ef611c37cbb5 SHA256 5d9447fef9c6421b0f11501ba1303e7bee41ea08659e19d321d93bdeb9c58e3f
|
||||||
DIST v8-3.11.3.tar.bz2 10069593 RMD160 dbf6ab21bafdc5a62751f16988615a33a9f74997 SHA1 d676bd5eb3785069d8d18842cca932143d54ed74 SHA256 52864dcceb50188331b6b6d472bda9988a0c4f3e7365f027b671cc54e78eb96e
|
|
||||||
DIST v8-3.11.6.2.tar.bz2 10070265 RMD160 296d898bc13f86482a07fc6721e1743bacce3de5 SHA1 621aa12f9fc2cd579aea05b84b859da7e257853f SHA256 f648b24296ba326be26d65f99027fbd9bc473c0156291fcd318f5f611bb02ea3
|
DIST v8-3.11.6.2.tar.bz2 10070265 RMD160 296d898bc13f86482a07fc6721e1743bacce3de5 SHA1 621aa12f9fc2cd579aea05b84b859da7e257853f SHA256 f648b24296ba326be26d65f99027fbd9bc473c0156291fcd318f5f611bb02ea3
|
||||||
|
DIST v8-3.11.8.tar.bz2 10089488 RMD160 5ef8f69ea1c947fbda9e0d6628674513848e5323 SHA1 0201ea44e5431a7b0cab62a8d949514c0e65773c SHA256 6840691eaac3740f8715a55a58f7d3b62f829225c2fb1cfe2c72c73cee4b7b73
|
||||||
DIST v8-3.9.24.28.tar.bz2 9975177 RMD160 444565b92e7cce55f0792f2a643f425413e994ea SHA1 6dc38d96ede2a84c9bb9982e99674df1a5254374 SHA256 054f4fc90fc0e1960520058321925272812164b9e9dfd661636d7a4d74d127cd
|
DIST v8-3.9.24.28.tar.bz2 9975177 RMD160 444565b92e7cce55f0792f2a643f425413e994ea SHA1 6dc38d96ede2a84c9bb9982e99674df1a5254374 SHA256 054f4fc90fc0e1960520058321925272812164b9e9dfd661636d7a4d74d127cd
|
||||||
|
DIST v8-3.9.24.29.tar.bz2 9978610 RMD160 7fae3478f2fcb2e8c754a7742b8cf07ad84e9a71 SHA1 12f7e0dd6106ad9cd7e676e3303c97b77f4f7f15 SHA256 12582590f0c4866198d82ec3d3af8f9bfc9d958933a985e58694c88ab5627577
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/v8/v8-3.11.3.ebuild,v 1.3 2012/05/29 08:55:33 naota Exp $
|
# $Header: /var/cvsroot/gentoo-x86/dev-lang/v8/v8-3.11.8.ebuild,v 1.1 2012/06/08 19:31:48 phajdan.jr Exp $
|
||||||
|
|
||||||
EAPI="4"
|
EAPI="4"
|
||||||
|
|
@ -0,0 +1,136 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/dev-lang/v8/v8-3.9.24.29.ebuild,v 1.1 2012/06/08 22:13:15 floppym Exp $
|
||||||
|
|
||||||
|
EAPI="4"
|
||||||
|
|
||||||
|
PYTHON_DEPEND="2:2.6"
|
||||||
|
|
||||||
|
inherit eutils multilib pax-utils python toolchain-funcs versionator
|
||||||
|
|
||||||
|
DESCRIPTION="Google's open source JavaScript engine"
|
||||||
|
HOMEPAGE="http://code.google.com/p/v8"
|
||||||
|
SRC_URI="http://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.bz2"
|
||||||
|
LICENSE="BSD"
|
||||||
|
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~amd64 ~x86 ~x64-macos ~x86-macos"
|
||||||
|
IUSE=""
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
python_set_active_version 2
|
||||||
|
python_pkg_setup
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
# don't force 32-bits mode on Darwin
|
||||||
|
# http://code.google.com/p/v8/issues/detail?id=2085
|
||||||
|
sed -i -e '/-arch i386/d' build/gyp/pylib/gyp/generator/make.py || die
|
||||||
|
# don't refuse to build shared_libs because we build somewhere else
|
||||||
|
# make sure our v8.dylib doesn't end up being empty and give it a proper
|
||||||
|
# install_name (soname)
|
||||||
|
# http://code.google.com/p/v8/issues/detail?id=2086
|
||||||
|
sed -i \
|
||||||
|
-e '/params\.get.*mac.*darwin.*linux/s/mac/darwin/' \
|
||||||
|
-e "/if GetFlavor(params) == 'mac':/s/mac/darwin/" \
|
||||||
|
-e "/^ if flavor == 'mac':/s/mac/darwin/" \
|
||||||
|
-e '/^LINK_COMMANDS_MAC =/,/^SHARED_HEADER =/s#-shared#-dynamiclib -all_load -install_name '"${EPREFIX}/usr/$(get_libdir)/libv8$(get_libname $(get_version_component_range 1-3))"'#' \
|
||||||
|
build/gyp/pylib/gyp/generator/make.py || die
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
tc-export AR CC CXX RANLIB
|
||||||
|
export LINK="${CXX}"
|
||||||
|
|
||||||
|
# Use target arch detection logic from bug #354601.
|
||||||
|
case ${CHOST} in
|
||||||
|
i?86-*) myarch=ia32 ;;
|
||||||
|
x86_64-*)
|
||||||
|
if [[ $ABI = x86 ]] ; then
|
||||||
|
myarch=ia32
|
||||||
|
else
|
||||||
|
myarch=x64
|
||||||
|
fi ;;
|
||||||
|
arm*-*) myarch=arm ;;
|
||||||
|
*) die "Unrecognized CHOST: ${CHOST}"
|
||||||
|
esac
|
||||||
|
mytarget=${myarch}.release
|
||||||
|
|
||||||
|
soname_version="$(get_version_component_range 1-3)"
|
||||||
|
|
||||||
|
local snapshot=on
|
||||||
|
host-is-pax && snapshot=off
|
||||||
|
|
||||||
|
# TODO: Add console=readline option once implemented upstream
|
||||||
|
# http://code.google.com/p/v8/issues/detail?id=1781
|
||||||
|
|
||||||
|
# force using Makefiles, instead of Xcode project file on Darwin
|
||||||
|
emake V=1 GYP_GENERATORS=make \
|
||||||
|
library=shared \
|
||||||
|
werror=no \
|
||||||
|
soname_version=${soname_version} \
|
||||||
|
snapshot=${snapshot} \
|
||||||
|
${mytarget} || die
|
||||||
|
|
||||||
|
pax-mark m out/${mytarget}/{cctest,d8,shell} || die
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
local arg testjobs
|
||||||
|
for arg in ${MAKEOPTS}; do
|
||||||
|
case ${arg} in
|
||||||
|
-j*) testjobs=${arg#-j} ;;
|
||||||
|
--jobs=*) testjobs=${arg#--jobs=} ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
tools/test-wrapper-gypbuild.py \
|
||||||
|
-j${testjobs:-1} \
|
||||||
|
--arch-and-mode=${mytarget} \
|
||||||
|
--no-presubmit \
|
||||||
|
--progress=dots || die
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
insinto /usr
|
||||||
|
doins -r include || die
|
||||||
|
|
||||||
|
dobin out/${mytarget}/d8 || die
|
||||||
|
|
||||||
|
if [[ ${CHOST} == *-darwin* ]] ; then
|
||||||
|
# buildsystem is too horrific to get this built correctly
|
||||||
|
mv out/${mytarget}/lib.target/libv8.so.${soname_version} \
|
||||||
|
out/${mytarget}/lib.target/libv8$(get_libname ${soname_version}) || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
dolib out/${mytarget}/lib.target/libv8$(get_libname ${soname_version}) || die
|
||||||
|
dosym libv8$(get_libname ${soname_version}) /usr/$(get_libdir)/libv8$(get_libname) || die
|
||||||
|
|
||||||
|
dodoc AUTHORS ChangeLog || die
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_preinst() {
|
||||||
|
preserved_libs=()
|
||||||
|
local baselib candidate
|
||||||
|
|
||||||
|
eshopts_push -s nullglob
|
||||||
|
|
||||||
|
for candidate in "${EROOT}usr/$(get_libdir)"/libv8$(get_libname).*; do
|
||||||
|
baselib=${candidate##*/}
|
||||||
|
if [[ ! -e "${ED}usr/$(get_libdir)/${baselib}" ]]; then
|
||||||
|
preserved_libs+=( "${EPREFIX}/usr/$(get_libdir)/${baselib}" )
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
eshopts_pop
|
||||||
|
|
||||||
|
if [[ ${#preserved_libs[@]} -gt 0 ]]; then
|
||||||
|
preserve_old_lib "${preserved_libs[@]}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
if [[ ${#preserved_libs[@]} -gt 0 ]]; then
|
||||||
|
preserve_old_lib_notify "${preserved_libs[@]}"
|
||||||
|
fi
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=76442
|
||||||
|
Gentoo-Bug: https://bugs.gentoo.org/420177
|
||||||
|
--- a/src/C_XS/ToolBox.h
|
||||||
|
+++ b/src/C_XS/ToolBox.h
|
||||||
|
@@ -93,7 +93,10 @@
|
||||||
|
#elif PERL_DARWIN
|
||||||
|
#define boolean bool
|
||||||
|
#else
|
||||||
|
- typedef enum { false = FALSE, true = TRUE } boolean;
|
||||||
|
+ typedef int boolean;
|
||||||
|
+ #ifndef I_STDBOOL
|
||||||
|
+ enum { false, true };
|
||||||
|
+ #endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
@ -1 +1,2 @@
|
|||||||
DIST cdk-perl-20031210.tgz 82357 RMD160 98e1689aa5d310d968ad89cad0094a4b46ebf212 SHA1 db98f1603e6b4079844c3462c0b8f699ac9b4439 SHA256 58e76ab154a41332c296372781958a5b60384460401983a21a439daedaffad40
|
DIST cdk-perl-20031210.tgz 82357 RMD160 98e1689aa5d310d968ad89cad0094a4b46ebf212 SHA1 db98f1603e6b4079844c3462c0b8f699ac9b4439 SHA256 58e76ab154a41332c296372781958a5b60384460401983a21a439daedaffad40
|
||||||
|
DIST cdk-perl-20120324.tar.gz 136019 RMD160 e67255052699665e5a32e6dad53876f22b6019a2 SHA1 0a4ceb3684b6a8529be51c98954c95f076803914 SHA256 a97bc153e1b95cb78fdd6249d03a5298494b30012a7850e0cd98369cd141752b
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/dev-perl/cdk-perl/cdk-perl-20120324.ebuild,v 1.1 2012/06/08 20:07:12 tove Exp $
|
||||||
|
|
||||||
|
EAPI=4
|
||||||
|
|
||||||
|
inherit perl-module
|
||||||
|
|
||||||
|
DESCRIPTION="Perl extension for Cdk"
|
||||||
|
HOMEPAGE="http://dickey.his.com/cdk/cdk.html"
|
||||||
|
SRC_URI="mirror://gentoo/${P}.tar.gz"
|
||||||
|
|
||||||
|
LICENSE="BSD"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~s390 ~sparc ~x86"
|
||||||
|
IUSE=""
|
||||||
|
|
||||||
|
RDEPEND=">=dev-libs/cdk-4.9.10.20031210"
|
||||||
|
DEPEND="${RDEPEND}"
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
default
|
||||||
|
perl-module_src_configure
|
||||||
|
}
|
@ -1,2 +1,2 @@
|
|||||||
DIST pypy-1.7.tar.bz2 14844629 RMD160 8532c1e7fa320de3a12463c9de10d03969253faa SHA1 b4be3a8dc69cd838a49382867db3c41864b9e8d9 SHA256 3236b0870237e2ed8f3af5f899183a5c71d4c8d7ff1163a3352d6ea5b172596a
|
|
||||||
DIST pypy-1.8.tar.bz2 14927806 RMD160 70fe569b466357ee64685c8ce15278d24862c711 SHA1 4ff684619671d6076879eff88343184d7656c699 SHA256 ac98ad6d884207f8325ff4c783104ebea57a3fcddfef32abcdf97fd4307b6287
|
DIST pypy-1.8.tar.bz2 14927806 RMD160 70fe569b466357ee64685c8ce15278d24862c711 SHA1 4ff684619671d6076879eff88343184d7656c699 SHA256 ac98ad6d884207f8325ff4c783104ebea57a3fcddfef32abcdf97fd4307b6287
|
||||||
|
DIST pypy-1.9.tar.bz2 13466551 RMD160 8ac2f53330ae450650f05753985bdbb42e07b526 SHA1 36a05432bbcee5d92a320fa27a627aeb281086b4 SHA256 9fd599acade49ef98017bbce4f179f19cf2680489ff15235d3bad5b20bde0d68
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
--- pypy-pypy-release-1.7/pypy/translator/goal/translate.py.bak 2011-11-29 14:23:55.000000000 +0100
|
|
||||||
+++ pypy-pypy-release-1.7/pypy/translator/goal/translate.py 2011-11-29 14:24:16.000000000 +0100
|
|
||||||
@@ -255,8 +255,6 @@
|
|
||||||
log.event("batch mode, not calling interactive helpers")
|
|
||||||
return
|
|
||||||
|
|
||||||
- log.event("start debugger...")
|
|
||||||
-
|
|
||||||
if translateconfig.view:
|
|
||||||
try:
|
|
||||||
t1 = drv.hint_translator
|
|
||||||
@@ -266,8 +264,6 @@
|
|
||||||
page = graphpage.TranslatorPage(t1, translateconfig.huge)
|
|
||||||
page.display_background()
|
|
||||||
|
|
||||||
- pdb_plus_show.start(tb)
|
|
||||||
-
|
|
||||||
try:
|
|
||||||
drv = driver.TranslationDriver.from_targetspec(targetspec_dic, config, args,
|
|
||||||
empty_translator=t,
|
|
||||||
--- pypy-pypy-release-1.7/pypy/translator/c/gcc/trackgcroot.py.bak 2011-11-29 14:22:29.000000000 +0100
|
|
||||||
+++ pypy-pypy-release-1.7/pypy/translator/c/gcc/trackgcroot.py 2011-11-29 14:22:55.000000000 +0100
|
|
||||||
@@ -1694,6 +1694,7 @@
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
elif self.format in ('elf64', 'darwin64'):
|
|
||||||
+ print >> output, "\t.section .note.GNU-stack,\"\",%progbits"
|
|
||||||
print >> output, "\t.text"
|
|
||||||
print >> output, "\t.globl %s" % _globalname('pypy_asm_stackwalk')
|
|
||||||
_variant(elf64='.type pypy_asm_stackwalk, @function',
|
|
||||||
--- pypy-pypy-release-1.7/pypy/rlib/ropenssl.py.bak 2011-11-29 14:19:10.000000000 +0100
|
|
||||||
+++ pypy-pypy-release-1.7/pypy/rlib/ropenssl.py 2011-11-29 14:19:42.000000000 +0100
|
|
||||||
@@ -159,6 +159,7 @@
|
|
||||||
lltype.Void)
|
|
||||||
|
|
||||||
if HAVE_OPENSSL_RAND:
|
|
||||||
+ eci.includes = eci.includes + ('openssl/rand.h',)
|
|
||||||
ssl_external('RAND_add', [rffi.CCHARP, rffi.INT, rffi.DOUBLE], lltype.Void)
|
|
||||||
ssl_external('RAND_status', [], rffi.INT)
|
|
||||||
ssl_external('RAND_egd', [rffi.CCHARP], rffi.INT)
|
|
@ -0,0 +1,391 @@
|
|||||||
|
--- lib-python/2.7/distutils/ccompiler.py
|
||||||
|
+++ lib-python/2.7/distutils/ccompiler.py
|
||||||
|
@@ -27,10 +27,16 @@
|
||||||
|
varies across Unices and is stored in Python's Makefile.
|
||||||
|
"""
|
||||||
|
if compiler.compiler_type == "unix":
|
||||||
|
- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
|
||||||
|
- _sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
|
||||||
|
- 'CCSHARED', 'LDSHARED', 'SO', 'AR',
|
||||||
|
- 'ARFLAGS')
|
||||||
|
+ cc = ' '.join(compiler.compiler)
|
||||||
|
+ cxx = ' '.join(compiler.compiler_cxx)
|
||||||
|
+ ldshared = ' '.join(compiler.linker_so)
|
||||||
|
+ ldcxxshared = ' '.join(compiler.linker_so_cxx)
|
||||||
|
+ ar = compiler.archiver[0]
|
||||||
|
+
|
||||||
|
+ cflags = ''
|
||||||
|
+ cxxflags = ''
|
||||||
|
+ ccshared = '-fPIC'
|
||||||
|
+ ar_flags = compiler.archiver[1]
|
||||||
|
|
||||||
|
if 'CC' in os.environ:
|
||||||
|
cc = os.environ['CC']
|
||||||
|
@@ -38,19 +44,27 @@
|
||||||
|
cxx = os.environ['CXX']
|
||||||
|
if 'LDSHARED' in os.environ:
|
||||||
|
ldshared = os.environ['LDSHARED']
|
||||||
|
+ if 'LDCXXSHARED' in os.environ:
|
||||||
|
+ ldcxxshared = os.environ['LDCXXSHARED']
|
||||||
|
if 'CPP' in os.environ:
|
||||||
|
cpp = os.environ['CPP']
|
||||||
|
else:
|
||||||
|
cpp = cc + " -E" # not always
|
||||||
|
if 'LDFLAGS' in os.environ:
|
||||||
|
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
|
||||||
|
if 'CFLAGS' in os.environ:
|
||||||
|
- cflags = opt + ' ' + os.environ['CFLAGS']
|
||||||
|
+ cflags = os.environ['CFLAGS']
|
||||||
|
ldshared = ldshared + ' ' + os.environ['CFLAGS']
|
||||||
|
+ if 'CXXFLAGS' in os.environ:
|
||||||
|
+ cxxflags = os.environ['CXXFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
|
||||||
|
if 'CPPFLAGS' in os.environ:
|
||||||
|
cpp = cpp + ' ' + os.environ['CPPFLAGS']
|
||||||
|
cflags = cflags + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
|
||||||
|
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
|
||||||
|
if 'AR' in os.environ:
|
||||||
|
ar = os.environ['AR']
|
||||||
|
if 'ARFLAGS' in os.environ:
|
||||||
|
@@ -59,17 +73,19 @@
|
||||||
|
archiver = ar + ' ' + ar_flags
|
||||||
|
|
||||||
|
cc_cmd = cc + ' ' + cflags
|
||||||
|
+ cxx_cmd = cxx + ' ' + cxxflags
|
||||||
|
compiler.set_executables(
|
||||||
|
preprocessor=cpp,
|
||||||
|
compiler=cc_cmd,
|
||||||
|
compiler_so=cc_cmd + ' ' + ccshared,
|
||||||
|
- compiler_cxx=cxx,
|
||||||
|
+ compiler_cxx=cxx_cmd,
|
||||||
|
+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
|
||||||
|
linker_so=ldshared,
|
||||||
|
linker_exe=cc,
|
||||||
|
+ linker_so_cxx=ldcxxshared,
|
||||||
|
+ linker_exe_cxx=cxx,
|
||||||
|
archiver=archiver)
|
||||||
|
|
||||||
|
- compiler.shared_lib_extension = so_ext
|
||||||
|
-
|
||||||
|
class CCompiler:
|
||||||
|
"""Abstract base class to define the interface that must be implemented
|
||||||
|
by real compiler classes. Also has some utility methods used by
|
||||||
|
--- lib-python/2.7/distutils/cygwinccompiler.py
|
||||||
|
+++ lib-python/2.7/distutils/cygwinccompiler.py
|
||||||
|
@@ -135,9 +135,13 @@
|
||||||
|
self.set_executables(compiler='gcc -mcygwin -O -Wall',
|
||||||
|
compiler_so='gcc -mcygwin -mdll -O -Wall',
|
||||||
|
compiler_cxx='g++ -mcygwin -O -Wall',
|
||||||
|
+ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
|
||||||
|
linker_exe='gcc -mcygwin',
|
||||||
|
linker_so=('%s -mcygwin %s' %
|
||||||
|
- (self.linker_dll, shared_option)))
|
||||||
|
+ (self.linker_dll, shared_option)),
|
||||||
|
+ linker_exe_cxx='g++ -mcygwin',
|
||||||
|
+ linker_so_cxx=('%s -mcygwin %s' %
|
||||||
|
+ (self.linker_dll, shared_option)))
|
||||||
|
|
||||||
|
# cygwin and mingw32 need different sets of libraries
|
||||||
|
if self.gcc_version == "2.91.57":
|
||||||
|
@@ -163,8 +167,12 @@
|
||||||
|
raise CompileError, msg
|
||||||
|
else: # for other files use the C-compiler
|
||||||
|
try:
|
||||||
|
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||||
|
- extra_postargs)
|
||||||
|
+ if self.detect_language(src) == 'c++':
|
||||||
|
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||||
|
+ extra_postargs)
|
||||||
|
+ else:
|
||||||
|
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||||
|
+ extra_postargs)
|
||||||
|
except DistutilsExecError, msg:
|
||||||
|
raise CompileError, msg
|
||||||
|
|
||||||
|
@@ -325,10 +333,15 @@
|
||||||
|
self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
|
||||||
|
compiler_so='gcc -mno-cygwin -mdll -O -Wall',
|
||||||
|
compiler_cxx='g++ -mno-cygwin -O -Wall',
|
||||||
|
+ compiler_so_cxx='g++ -mno-cygwin -mdll -O -Wall',
|
||||||
|
linker_exe='gcc -mno-cygwin',
|
||||||
|
linker_so='%s -mno-cygwin %s %s'
|
||||||
|
% (self.linker_dll, shared_option,
|
||||||
|
- entry_point))
|
||||||
|
+ entry_point),
|
||||||
|
+ linker_exe_cxx='g++ -mno-cygwin',
|
||||||
|
+ linker_so_cxx='%s -mno-cygwin %s %s'
|
||||||
|
+ % (self.linker_dll, shared_option,
|
||||||
|
+ entry_point))
|
||||||
|
# Maybe we should also append -mthreads, but then the finished
|
||||||
|
# dlls need another dll (mingwm10.dll see Mingw32 docs)
|
||||||
|
# (-mthreads: Support thread-safe exception handling on `Mingw32')
|
||||||
|
--- lib-python/2.7/distutils/emxccompiler.py
|
||||||
|
+++ lib-python/2.7/distutils/emxccompiler.py
|
||||||
|
@@ -65,8 +65,12 @@
|
||||||
|
# XXX optimization, warnings etc. should be customizable.
|
||||||
|
self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||||
|
compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||||
|
+ compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||||
|
+ compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||||
|
linker_exe='gcc -Zomf -Zmt -Zcrtdll',
|
||||||
|
- linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
|
||||||
|
+ linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll',
|
||||||
|
+ linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll',
|
||||||
|
+ linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll')
|
||||||
|
|
||||||
|
# want the gcc library statically linked (so that we don't have
|
||||||
|
# to distribute a version dependent on the compiler we have)
|
||||||
|
@@ -83,8 +87,12 @@
|
||||||
|
raise CompileError, msg
|
||||||
|
else: # for other files use the C-compiler
|
||||||
|
try:
|
||||||
|
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||||
|
- extra_postargs)
|
||||||
|
+ if self.detect_language(src) == 'c++':
|
||||||
|
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||||
|
+ extra_postargs)
|
||||||
|
+ else:
|
||||||
|
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||||
|
+ extra_postargs)
|
||||||
|
except DistutilsExecError, msg:
|
||||||
|
raise CompileError, msg
|
||||||
|
|
||||||
|
--- lib-python/2.7/distutils/sysconfig_cpython.py
|
||||||
|
+++ lib-python/2.7/distutils/sysconfig_cpython.py
|
||||||
|
@@ -149,9 +149,12 @@
|
||||||
|
varies across Unices and is stored in Python's Makefile.
|
||||||
|
"""
|
||||||
|
if compiler.compiler_type == "unix":
|
||||||
|
- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext) = \
|
||||||
|
- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
|
||||||
|
- 'CCSHARED', 'LDSHARED', 'SO')
|
||||||
|
+ (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext) = \
|
||||||
|
+ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED',
|
||||||
|
+ 'LDCXXSHARED', 'SO')
|
||||||
|
+
|
||||||
|
+ cflags = ''
|
||||||
|
+ cxxflags = ''
|
||||||
|
|
||||||
|
if 'CC' in os.environ:
|
||||||
|
cc = os.environ['CC']
|
||||||
|
@@ -159,28 +162,40 @@
|
||||||
|
cxx = os.environ['CXX']
|
||||||
|
if 'LDSHARED' in os.environ:
|
||||||
|
ldshared = os.environ['LDSHARED']
|
||||||
|
+ if 'LDCXXSHARED' in os.environ:
|
||||||
|
+ ldcxxshared = os.environ['LDCXXSHARED']
|
||||||
|
if 'CPP' in os.environ:
|
||||||
|
cpp = os.environ['CPP']
|
||||||
|
else:
|
||||||
|
cpp = cc + " -E" # not always
|
||||||
|
if 'LDFLAGS' in os.environ:
|
||||||
|
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
|
||||||
|
if 'CFLAGS' in os.environ:
|
||||||
|
- cflags = opt + ' ' + os.environ['CFLAGS']
|
||||||
|
+ cflags = os.environ['CFLAGS']
|
||||||
|
ldshared = ldshared + ' ' + os.environ['CFLAGS']
|
||||||
|
+ if 'CXXFLAGS' in os.environ:
|
||||||
|
+ cxxflags = os.environ['CXXFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
|
||||||
|
if 'CPPFLAGS' in os.environ:
|
||||||
|
cpp = cpp + ' ' + os.environ['CPPFLAGS']
|
||||||
|
cflags = cflags + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
|
||||||
|
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
|
||||||
|
|
||||||
|
cc_cmd = cc + ' ' + cflags
|
||||||
|
+ cxx_cmd = cxx + ' ' + cxxflags
|
||||||
|
compiler.set_executables(
|
||||||
|
preprocessor=cpp,
|
||||||
|
compiler=cc_cmd,
|
||||||
|
compiler_so=cc_cmd + ' ' + ccshared,
|
||||||
|
- compiler_cxx=cxx,
|
||||||
|
+ compiler_cxx=cxx_cmd,
|
||||||
|
+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
|
||||||
|
linker_so=ldshared,
|
||||||
|
- linker_exe=cc)
|
||||||
|
+ linker_exe=cc,
|
||||||
|
+ linker_so_cxx=ldcxxshared,
|
||||||
|
+ linker_exe_cxx=cxx)
|
||||||
|
|
||||||
|
compiler.shared_lib_extension = so_ext
|
||||||
|
|
||||||
|
@@ -506,7 +521,7 @@
|
||||||
|
for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
|
||||||
|
# a number of derived variables. These need to be
|
||||||
|
# patched up as well.
|
||||||
|
- 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
|
||||||
|
+ 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
|
||||||
|
flags = _config_vars[key]
|
||||||
|
flags = re.sub('-arch\s+\w+\s', ' ', flags)
|
||||||
|
flags = re.sub('-isysroot [^ \t]*', ' ', flags)
|
||||||
|
@@ -525,7 +540,7 @@
|
||||||
|
for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
|
||||||
|
# a number of derived variables. These need to be
|
||||||
|
# patched up as well.
|
||||||
|
- 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
|
||||||
|
+ 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
|
||||||
|
|
||||||
|
flags = _config_vars[key]
|
||||||
|
flags = re.sub('-arch\s+\w+\s', ' ', flags)
|
||||||
|
@@ -549,7 +564,7 @@
|
||||||
|
for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
|
||||||
|
# a number of derived variables. These need to be
|
||||||
|
# patched up as well.
|
||||||
|
- 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
|
||||||
|
+ 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
|
||||||
|
|
||||||
|
flags = _config_vars[key]
|
||||||
|
flags = re.sub('-isysroot\s+\S+(\s|$)', ' ', flags)
|
||||||
|
--- lib-python/2.7/distutils/sysconfig_pypy.py
|
||||||
|
+++ lib-python/2.7/distutils/sysconfig_pypy.py
|
||||||
|
@@ -114,13 +114,56 @@
|
||||||
|
optional C speedup components.
|
||||||
|
"""
|
||||||
|
if compiler.compiler_type == "unix":
|
||||||
|
- compiler.compiler_so.extend(['-fPIC', '-Wimplicit'])
|
||||||
|
+ cc = ' '.join(compiler.compiler)
|
||||||
|
+ cxx = ' '.join(compiler.compiler_cxx)
|
||||||
|
+ ldshared = ' '.join(compiler.linker_so)
|
||||||
|
+ ldcxxshared = ' '.join(compiler.linker_so_cxx)
|
||||||
|
+
|
||||||
|
+ cflags = ''
|
||||||
|
+ cxxflags = ''
|
||||||
|
+ ccshared = '-fPIC'
|
||||||
|
+
|
||||||
|
+ if 'CC' in os.environ:
|
||||||
|
+ cc = os.environ['CC']
|
||||||
|
+ if 'CXX' in os.environ:
|
||||||
|
+ cxx = os.environ['CXX']
|
||||||
|
+ if 'LDSHARED' in os.environ:
|
||||||
|
+ ldshared = os.environ['LDSHARED']
|
||||||
|
+ if 'LDCXXSHARED' in os.environ:
|
||||||
|
+ ldcxxshared = os.environ['LDCXXSHARED']
|
||||||
|
+ if 'CPP' in os.environ:
|
||||||
|
+ cpp = os.environ['CPP']
|
||||||
|
+ else:
|
||||||
|
+ cpp = cc + " -E" # not always
|
||||||
|
+ if 'LDFLAGS' in os.environ:
|
||||||
|
+ ldshared = ldshared + ' ' + os.environ['LDFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
|
||||||
|
+ if 'CFLAGS' in os.environ:
|
||||||
|
+ cflags = os.environ['CFLAGS']
|
||||||
|
+ ldshared = ldshared + ' ' + os.environ['CFLAGS']
|
||||||
|
+ if 'CXXFLAGS' in os.environ:
|
||||||
|
+ cxxflags = os.environ['CXXFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
|
||||||
|
+ if 'CPPFLAGS' in os.environ:
|
||||||
|
+ cpp = cpp + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+ cflags = cflags + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+ ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
|
||||||
|
+
|
||||||
|
+ cc_cmd = cc + ' ' + cflags
|
||||||
|
+ cxx_cmd = cxx + ' ' + cxxflags
|
||||||
|
+ compiler.set_executables(
|
||||||
|
+ preprocessor=cpp,
|
||||||
|
+ compiler=cc_cmd,
|
||||||
|
+ compiler_so=cc_cmd + ' ' + ccshared,
|
||||||
|
+ compiler_cxx=cxx_cmd,
|
||||||
|
+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
|
||||||
|
+ linker_so=ldshared,
|
||||||
|
+ linker_exe=cc,
|
||||||
|
+ linker_so_cxx=ldcxxshared,
|
||||||
|
+ linker_exe_cxx=cxx)
|
||||||
|
compiler.shared_lib_extension = get_config_var('SO')
|
||||||
|
- if "CFLAGS" in os.environ:
|
||||||
|
- cflags = os.environ["CFLAGS"]
|
||||||
|
- compiler.compiler.append(cflags)
|
||||||
|
- compiler.compiler_so.append(cflags)
|
||||||
|
- compiler.linker_so.append(cflags)
|
||||||
|
|
||||||
|
|
||||||
|
from sysconfig_cpython import (
|
||||||
|
--- lib-python/2.7/distutils/unixccompiler.py
|
||||||
|
+++ lib-python/2.7/distutils/unixccompiler.py
|
||||||
|
@@ -114,14 +114,17 @@
|
||||||
|
# are pretty generic; they will probably have to be set by an outsider
|
||||||
|
# (eg. using information discovered by the sysconfig about building
|
||||||
|
# Python extensions).
|
||||||
|
- executables = {'preprocessor' : None,
|
||||||
|
- 'compiler' : ["cc"],
|
||||||
|
- 'compiler_so' : ["cc"],
|
||||||
|
- 'compiler_cxx' : ["cc"],
|
||||||
|
- 'linker_so' : ["cc", "-shared"],
|
||||||
|
- 'linker_exe' : ["cc"],
|
||||||
|
- 'archiver' : ["ar", "-cr"],
|
||||||
|
- 'ranlib' : None,
|
||||||
|
+ executables = {'preprocessor' : None,
|
||||||
|
+ 'compiler' : ["cc"],
|
||||||
|
+ 'compiler_so' : ["cc"],
|
||||||
|
+ 'compiler_cxx' : ["c++"],
|
||||||
|
+ 'compiler_so_cxx' : ["c++"],
|
||||||
|
+ 'linker_so' : ["cc", "-shared"],
|
||||||
|
+ 'linker_exe' : ["cc"],
|
||||||
|
+ 'linker_so_cxx' : ["c++", "-shared"],
|
||||||
|
+ 'linker_exe_cxx' : ["c++"],
|
||||||
|
+ 'archiver' : ["ar", "-cr"],
|
||||||
|
+ 'ranlib' : None,
|
||||||
|
}
|
||||||
|
|
||||||
|
if sys.platform[:6] == "darwin":
|
||||||
|
@@ -186,11 +189,18 @@
|
||||||
|
|
||||||
|
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
|
||||||
|
compiler_so = self.compiler_so
|
||||||
|
+ compiler_so_cxx = self.compiler_so_cxx
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
|
||||||
|
+ compiler_so_cxx = _darwin_compiler_fixup(compiler_so_cxx, cc_args +
|
||||||
|
+ extra_postargs)
|
||||||
|
try:
|
||||||
|
- self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||||
|
- extra_postargs)
|
||||||
|
+ if self.detect_language(src) == 'c++':
|
||||||
|
+ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||||
|
+ extra_postargs)
|
||||||
|
+ else:
|
||||||
|
+ self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||||
|
+ extra_postargs)
|
||||||
|
except DistutilsExecError, msg:
|
||||||
|
raise CompileError, msg
|
||||||
|
|
||||||
|
@@ -247,23 +257,16 @@
|
||||||
|
ld_args.extend(extra_postargs)
|
||||||
|
self.mkpath(os.path.dirname(output_filename))
|
||||||
|
try:
|
||||||
|
- if target_desc == CCompiler.EXECUTABLE:
|
||||||
|
- linker = self.linker_exe[:]
|
||||||
|
+ if target_lang == "c++":
|
||||||
|
+ if target_desc == CCompiler.EXECUTABLE:
|
||||||
|
+ linker = self.linker_exe_cxx[:]
|
||||||
|
+ else:
|
||||||
|
+ linker = self.linker_so_cxx[:]
|
||||||
|
else:
|
||||||
|
- linker = self.linker_so[:]
|
||||||
|
- if target_lang == "c++" and self.compiler_cxx:
|
||||||
|
- # skip over environment variable settings if /usr/bin/env
|
||||||
|
- # is used to set up the linker's environment.
|
||||||
|
- # This is needed on OSX. Note: this assumes that the
|
||||||
|
- # normal and C++ compiler have the same environment
|
||||||
|
- # settings.
|
||||||
|
- i = 0
|
||||||
|
- if os.path.basename(linker[0]) == "env":
|
||||||
|
- i = 1
|
||||||
|
- while '=' in linker[i]:
|
||||||
|
- i = i + 1
|
||||||
|
-
|
||||||
|
- linker[i] = self.compiler_cxx[i]
|
||||||
|
+ if target_desc == CCompiler.EXECUTABLE:
|
||||||
|
+ linker = self.linker_exe[:]
|
||||||
|
+ else:
|
||||||
|
+ linker = self.linker_so[:]
|
||||||
|
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
linker = _darwin_compiler_fixup(linker, ld_args)
|
@ -0,0 +1,11 @@
|
|||||||
|
--- lib-python/2.7/distutils/unixccompiler.py
|
||||||
|
+++ lib-python/2.7/distutils/unixccompiler.py
|
||||||
|
@@ -297,7 +297,7 @@
|
||||||
|
# this time, there's no way to determine this information from
|
||||||
|
# the configuration data stored in the Python installation, so
|
||||||
|
# we use this hack.
|
||||||
|
- compiler = os.path.basename(sysconfig.get_config_var("CC"))
|
||||||
|
+ compiler = os.path.basename(self.compiler[0])
|
||||||
|
if sys.platform[:6] == "darwin":
|
||||||
|
# MacOSX's linker doesn't understand the -R flag at all
|
||||||
|
return "-L" + dir
|
@ -0,0 +1,27 @@
|
|||||||
|
# HG changeset patch
|
||||||
|
# User Armin Rigo <arigo@tunes.org>
|
||||||
|
# Date 1339165065 -7200
|
||||||
|
# Node ID 4151f9c406b62f6c4a1fdd669389eb46eb90f9cb
|
||||||
|
# Parent 68f8d7152a45fa7856a2a013799874614fcd9c33
|
||||||
|
issue1043 3rd issue fixed
|
||||||
|
|
||||||
|
diff -r 68f8d7152a45fa7856a2a013799874614fcd9c33 -r 4151f9c406b62f6c4a1fdd669389eb46eb90f9cb pypy/translator/goal/app_main.py
|
||||||
|
--- a/pypy/translator/goal/app_main.py Fri Jun 08 16:06:33 2012 +0200
|
||||||
|
+++ b/pypy/translator/goal/app_main.py Fri Jun 08 16:17:45 2012 +0200
|
||||||
|
@@ -457,13 +457,13 @@
|
||||||
|
|
||||||
|
if PYTHON26 and not options["ignore_environment"]:
|
||||||
|
if os.getenv('PYTHONNOUSERSITE'):
|
||||||
|
- options["no_user_site"] = True
|
||||||
|
+ options["no_user_site"] = 1
|
||||||
|
if os.getenv('PYTHONDONTWRITEBYTECODE'):
|
||||||
|
- options["dont_write_bytecode"] = True
|
||||||
|
+ options["dont_write_bytecode"] = 1
|
||||||
|
|
||||||
|
if (options["interactive"] or
|
||||||
|
(not options["ignore_environment"] and os.getenv('PYTHONINSPECT'))):
|
||||||
|
- options["inspect"] = True
|
||||||
|
+ options["inspect"] = 1
|
||||||
|
|
||||||
|
if PYTHON26 and we_are_translated():
|
||||||
|
flags = [options[flag] for flag in sys_flags]
|
@ -0,0 +1,11 @@
|
|||||||
|
--- pypy-pypy-release-1.7/lib-python/2.7/distutils/command/install.py
|
||||||
|
+++ pypy-pypy-release-1.7/lib-python/2.7/distutils/command/install.py
|
||||||
|
@@ -87,7 +87,7 @@
|
||||||
|
'purelib': '$base/site-packages',
|
||||||
|
'platlib': '$base/site-packages',
|
||||||
|
'headers': '$base/include',
|
||||||
|
- 'scripts': '$base/bin',
|
||||||
|
+ 'scripts': '/usr/bin',
|
||||||
|
'data' : '$base',
|
||||||
|
},
|
||||||
|
}
|
@ -1,101 +0,0 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/pypy-1.8.ebuild,v 1.4 2012/02/14 02:16:50 floppym Exp $
|
|
||||||
|
|
||||||
EAPI="4"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs check-reqs python versionator
|
|
||||||
|
|
||||||
DESCRIPTION="PyPy is a fast, compliant alternative implementation of the Python language"
|
|
||||||
HOMEPAGE="http://pypy.org/"
|
|
||||||
SRC_URI="https://bitbucket.org/pypy/pypy/get/release-${PV}.tar.bz2 -> ${P}.tar.bz2"
|
|
||||||
SLOTVER=$(get_version_component_range 1-2 ${PV})
|
|
||||||
|
|
||||||
LICENSE="MIT"
|
|
||||||
SLOT="${SLOTVER}"
|
|
||||||
PYTHON_ABI="2.7-pypy-${SLOTVER}"
|
|
||||||
KEYWORDS="~amd64 ~x86"
|
|
||||||
IUSE="bzip2 doc examples +jit ncurses sandbox shadowstack sqlite stackless ssl xml"
|
|
||||||
|
|
||||||
RDEPEND=">=sys-libs/zlib-1.1.3
|
|
||||||
virtual/libffi
|
|
||||||
virtual/libintl
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
ncurses? ( sys-libs/ncurses )
|
|
||||||
sqlite? ( dev-db/sqlite:3 )
|
|
||||||
ssl? ( dev-libs/openssl )
|
|
||||||
xml? ( dev-libs/expat )"
|
|
||||||
DEPEND="${RDEPEND}"
|
|
||||||
PDEPEND="app-admin/python-updater"
|
|
||||||
|
|
||||||
DOC="README LICENSE"
|
|
||||||
|
|
||||||
pkg_pretend() {
|
|
||||||
CHECKREQS_MEMORY="2G"
|
|
||||||
use amd64 && CHECKREQS_MEMORY="4G"
|
|
||||||
check-reqs_pkg_pretend
|
|
||||||
}
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
default
|
|
||||||
mv pypy-pypy-* "${S}" || die
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}/1.7-patches.patch"
|
|
||||||
epatch "${FILESDIR}/1.7-scripts-location.patch"
|
|
||||||
epatch "${FILESDIR}/pypy-1.7-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
|
||||||
epatch "${FILESDIR}/pypy-1.7-distutils-fix_handling_of_executables_and_flags.patch"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
local conf
|
|
||||||
if use jit; then
|
|
||||||
conf="-Ojit"
|
|
||||||
else
|
|
||||||
conf="-O2"
|
|
||||||
fi
|
|
||||||
if use shadowstack; then
|
|
||||||
conf+=" --gcrootfinder=shadowstack"
|
|
||||||
fi
|
|
||||||
if use sandbox; then
|
|
||||||
conf+=" --sandbox"
|
|
||||||
fi
|
|
||||||
if use stackless; then
|
|
||||||
conf+=" --stackless"
|
|
||||||
fi
|
|
||||||
|
|
||||||
conf+=" ./pypy/translator/goal/targetpypystandalone.py"
|
|
||||||
# Avoid linking against libraries disabled by use flags
|
|
||||||
local optional_use=("bzip2" "ncurses" "xml" "ssl")
|
|
||||||
local optional_mod=("bz2" "_minimal_curses" "pyexpat" "_ssl")
|
|
||||||
for ((i = 0; i < ${#optional_use[*]}; i++)); do
|
|
||||||
if use ${optional_use[$i]}; then
|
|
||||||
conf+=" --withmod-${optional_mod[$i]}"
|
|
||||||
else
|
|
||||||
conf+=" --withoutmod-${optional_mod[$i]}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
local translate_cmd="$(PYTHON -2) ./pypy/translator/goal/translate.py $conf"
|
|
||||||
echo ${_BOLD}"${translate_cmd}"${_NORMAL}
|
|
||||||
${translate_cmd} || die "compile error"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
local INSPATH="/usr/$(get_libdir)/pypy${SLOT}"
|
|
||||||
insinto ${INSPATH}
|
|
||||||
doins -r include lib_pypy lib-python pypy-c
|
|
||||||
fperms a+x ${INSPATH}/pypy-c
|
|
||||||
dosym ../$(get_libdir)/pypy${SLOT}/pypy-c /usr/bin/pypy-c${SLOT}
|
|
||||||
|
|
||||||
if ! use sqlite; then
|
|
||||||
rm -fr "${ED}${INSPATH}/lib-python/2.7/sqlite3"
|
|
||||||
rm -fr "${ED}${INSPATH}/lib-python/modified-2.7/sqlite3"
|
|
||||||
rm -f "${ED}${INSPATH}/lib_pypy/_sqlite3.py"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
$(PYTHON -2) ./pypy/test_all.py --pypy=./pypy-c lib-python
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue