diff options
Diffstat (limited to 'www-apps/liquid_feedback_core/files')
7 files changed, 103 insertions, 49 deletions
diff --git a/www-apps/liquid_feedback_core/files/lf_update.sh b/www-apps/liquid_feedback_core/files/lf_update.sh new file mode 100644 index 000000000000..5cd452d81153 --- /dev/null +++ b/www-apps/liquid_feedback_core/files/lf_update.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +while true; do + nice /usr/bin/lf_update dbname=$1 + nice /usr/bin/lf_update_issue_order dbname=$1 + nice /usr/bin/lf_update_suggestion_order dbname=$1 + sleep 5m +done diff --git a/www-apps/liquid_feedback_core/files/liquid_feedback_core-2.2.3-gentoo.patch b/www-apps/liquid_feedback_core/files/liquid_feedback_core-2.2.3-gentoo.patch deleted file mode 100644 index bd5874583e3a..000000000000 --- a/www-apps/liquid_feedback_core/files/liquid_feedback_core-2.2.3-gentoo.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -1,16 +1,10 @@ - all:: lf_update lf_update_suggestion_order - --lf_update: lf_update.c -- cc -Wall -O2 \ -- -I "`pg_config --includedir`" \ -- -L "`pg_config --libdir`" \ -- -o lf_update lf_update.c -lpq -- --lf_update_suggestion_order: lf_update_suggestion_order.c -- cc -Wall -O2 \ -- -I "`pg_config --includedir`" \ -- -L "`pg_config --libdir`" \ -- -o lf_update_suggestion_order lf_update_suggestion_order.c -lpq -+CPPFLAGS=-I `pg_config --includedir` -+LDFLAGS=-L `pg_config --libdir` -+CFLAGS=-Wall -O2 -+CC=cc -+LDLIBS=-lpq - - clean:: - rm -f lf_update lf_update_suggestion_order diff --git a/www-apps/liquid_feedback_core/files/liquid_feedback_core-4.0.0-gentoo.patch b/www-apps/liquid_feedback_core/files/liquid_feedback_core-4.0.0-gentoo.patch new file mode 100644 index 000000000000..cb57a08870ec --- /dev/null +++ b/www-apps/liquid_feedback_core/files/liquid_feedback_core-4.0.0-gentoo.patch @@ -0,0 +1,51 @@ +--- a/lf_update_issue_order.c 2021-04-10 18:32:19.101947834 +0200 ++++ b/lf_update_issue_order.c 2021-04-10 18:36:07.377117090 +0200 +@@ -1,3 +1,5 @@ ++#define _GNU_SOURCE ++ + #include <stdlib.h> + #include <stdio.h> + #include <string.h> +@@ -417,7 +419,7 @@ + logging = 1; + } + for (i=argb; i<argc; i++) len += strlen(argv[i]) + 1; +- conninfo = malloc(len * sizeof(char)); ++ conninfo = malloc(len * sizeof(char) + 1); + if (!conninfo) { + fprintf(stderr, "Error: Could not allocate memory for conninfo string.\n"); + abort(); +--- a/lf_update_suggestion_order.c 2021-04-10 18:38:31.138743181 +0200 ++++ b/lf_update_suggestion_order.c 2021-04-10 18:39:29.851786017 +0200 +@@ -1,3 +1,5 @@ ++#define _GNU_SOURCE ++ + #include <stdlib.h> + #include <stdio.h> + #include <string.h> +@@ -474,7 +476,7 @@ + logging = 1; + } + for (i=argb; i<argc; i++) len += strlen(argv[i]) + 1; +- conninfo = malloc(len * sizeof(char)); ++ conninfo = malloc(len * sizeof(char) + 1); + if (!conninfo) { + fprintf(stderr, "Error: Could not allocate memory for conninfo string.\n"); + abort(); +--- a/lf_update.c 2021-04-10 18:40:48.036510216 +0200 ++++ b/lf_update.c 2021-04-10 18:55:46.869758233 +0200 +@@ -1,3 +1,5 @@ ++#define _GNU_SOURCE ++ + #include <stdlib.h> + #include <stdio.h> + #include <string.h> +@@ -78,7 +78,7 @@ + } + len += seglen; + } +- conninfo = malloc(len * sizeof(char)); ++ conninfo = malloc(len * sizeof(char) + 1); + if (!conninfo) { + fprintf(stderr, "Error: Could not allocate memory for conninfo string\n"); + return 1; diff --git a/www-apps/liquid_feedback_core/files/liquid_feedback_core.confd b/www-apps/liquid_feedback_core/files/liquid_feedback_core.confd new file mode 100644 index 000000000000..1e1ed6b29296 --- /dev/null +++ b/www-apps/liquid_feedback_core/files/liquid_feedback_core.confd @@ -0,0 +1,2 @@ +# name of db for liquid feedback +dbname=liquid_feedback diff --git a/www-apps/liquid_feedback_core/files/liquid_feedback_core.initd b/www-apps/liquid_feedback_core/files/liquid_feedback_core.initd new file mode 100644 index 000000000000..fe97906ee4ee --- /dev/null +++ b/www-apps/liquid_feedback_core/files/liquid_feedback_core.initd @@ -0,0 +1,10 @@ +#!/sbin/openrc-run +description="liquid feedback updator" + +command="/usr/bin/lf_update.sh" +command_args="$dbname" +command_background=yes +command_user="apache:apache" +error_log=/var/log/liquid_feedback/lf_update.err +output_log=/var/log/liquid_feedback/lf_update.log +pidfile=/run/lqfb_core.pid diff --git a/www-apps/liquid_feedback_core/files/postinstall-en-4.txt b/www-apps/liquid_feedback_core/files/postinstall-en-4.txt new file mode 100644 index 000000000000..1ce7b7431495 --- /dev/null +++ b/www-apps/liquid_feedback_core/files/postinstall-en-4.txt @@ -0,0 +1,32 @@ +To use Liquid Feedback you have to follow these +simple steps, which have to be done as the postgres system user (or +which ever is the database superuser): + +$ createuser -d apache + +$ psql +postgres=# ALTER USER apache WITH PASSWORD 'the_new_password'; + +$ createdb -U apache liquid_feedback +$ psql -U apache liquid_feedback +\i /usr/share/liquid_feedback_core/core.sql +\i /usr/share/liquid_feedback_core/geoindex_install.sql +INSERT INTO system_setting (member_ttl) VALUES ('1 year'); +INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 hour', 20, 6); +INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12); +INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60); +INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120); + +and Create an invite code for an admin user: + +$ psql -U liquid_feedback liquid_feedback +liquid_feedback=# INSERT INTO member (invite_code, admin) VALUES ('sesam', true); + +Then you can start the periodic task of liquid_feedback_core by running +/etc/init.d/liquid_feedback_core restart + +and eventually adding this to the default level + +rc-update add liquid_feedback_core + +For other info look at the README file diff --git a/www-apps/liquid_feedback_core/files/postinstall-en.txt b/www-apps/liquid_feedback_core/files/postinstall-en.txt deleted file mode 100644 index 128c7b20ee7d..000000000000 --- a/www-apps/liquid_feedback_core/files/postinstall-en.txt +++ /dev/null @@ -1,25 +0,0 @@ -Merge info from README file with these. - -To use Liquid Feedback you have to follow these -simple steps, which have to be done as the postgres system user (or -which ever is the database superuser): - -$ createuser liquid_feedback -and answer the following -Shall the new role be a superuser? (y/n) n -Shall the new role be allowed to create databases? (y/n) y -Shall the new role be allowed to create more new roles? (y/n) n - -$ psql -postgres=# ALTER USER liquid_feedback WITH PASSWORD 'the_new_password'; - -$ createdb -U liquid_feedback liquid_feedback -$ psql -U liquid_feedback liquid_feedback -liquid_feedback=# \i /usr/share/liquid_feedback_code/core.sql -liquid_feedback=# \i /usr/share/liquid_feedback_code/init.sql -INSERT INTO system_setting (member_ttl) VALUES ('1 year'); -INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 hour', 20, 6); -INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12); -INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60); -INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120); -INSERT INTO policy (index, name, admission_time, discussion_time, verification_time, voting_time, issue_quorum_num, issue_quorum_den, initiative_quorum_num, initiative_quorum_den) VALUES (1, 'Default policy', '8 days', '15 days', '8 days', '15 days', 10, 100, 10, 100); |