summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO35
-rw-r--r--PKGBUILD53
-rw-r--r--postgresql.conf1
-rw-r--r--postgresql.install36
-rw-r--r--postgresql.service27
5 files changed, 152 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..198f80b5256e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,35 @@
+# Generated by makepkg 4.2.1
+# Sat Aug 29 08:44:40 UTC 2015
+pkgbase = postgresql-1c
+ pkgdesc = Custom version of PostgreSQL 9.4 for 1C system
+ pkgver = 9.4.2
+ pkgrel = 2
+ url = http://v8.1c.ru/overview/postgres_patches_notes.htm
+ install = postgresql.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = rpmextract
+ makedepends = gcc
+ makedepends = make
+ makedepends = flex
+ makedepends = bison
+ depends = libxml2
+ depends = libxslt
+ depends = icu
+ depends = openssl
+ conflicts = postgresql
+ conflicts = postgresql-libs
+ replaces = postgresql
+ replaces = postgresql-libs
+ source = http://v8.1c.ru/overview/postgresql_patches/9-4-2/postgresql94-9.4.2-1.1c.src.rpm
+ source = postgresql.conf
+ source = postgresql.service
+ source = postgresql.install
+ md5sums = 1b673a15fed9df8ca058bb8674dfd88a
+ md5sums = 7a510b5bcd4a5acb394a5dbf4286bb41
+ md5sums = 9baf4f9dd1a5283b1577de5c4970f728
+ md5sums = febdfca7e698211aa1ecf529e9a3140c
+
+pkgname = postgresql-1c
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..908d7f70d186
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,53 @@
+# Maintainer: Ivan Agarkov <ivan.agarkov@gmail.com>
+pkgname=postgresql-1c
+pkgver=9.4.2
+pkgrel=2
+pkgdesc="Custom version of PostgreSQL 9.4 for 1C system"
+arch=('i686' 'x86_64')
+url="http://v8.1c.ru/overview/postgres_patches_notes.htm"
+license=('GPL')
+depends=('libxml2' 'libxslt' 'icu' 'openssl')
+makedepends=('rpmextract' 'gcc' 'make' 'flex' 'bison')
+#checkdepends=()
+#optdepends=()
+#provides=()
+conflicts=('postgresql' 'postgresql-libs')
+replaces=('postgresql' 'postgresql-libs')
+source=("http://v8.1c.ru/overview/postgresql_patches/9-4-2/postgresql94-9.4.2-1.1c.src.rpm"
+"postgresql.conf" "postgresql.service" "postgresql.install")
+md5sums=('1b673a15fed9df8ca058bb8674dfd88a'
+ '7a510b5bcd4a5acb394a5dbf4286bb41'
+ '9baf4f9dd1a5283b1577de5c4970f728'
+ 'febdfca7e698211aa1ecf529e9a3140c')
+install=postgresql.install
+
+prepare() {
+#tar xfj "postgresql-9.4.2.tar.bz2"
+#cd "postgresql-9.4.2"
+#patch -p1 < ../1c_FULL_94-0.23
+#patch -p1 < ../applock-1c-9.4.patch
+#patch -p1 < ../online_analyze-9.4.patch
+#patch -p1 < ../plantuner.patch
+#patch -p1 < ../postgresql-1c-9.4.patch
+#patch -p1 < ../postgresql-logging.patch
+#patch -p1 < ../postgresql-perl-rpath.patch
+#patch -p1 < ../postgresql-prefer-ncurses.patch
+#patch -p1 < ../rpm-pgsql.patch
+echo "ok"
+}
+
+build() {
+#cd "postgresql-9.4.2"
+#./configure --disable-rpath --prefix=/usr --libdir=/usr/lib/postgresql/ --with-openssl --with-libxml --with-libxslt --enable-nls
+#make all
+#make -C contrib all
+echo "ok"
+}
+
+package() {
+ cd "postgresql-9.4.2"
+ make DESTDIR="$pkgdir/" install
+ make -C contrib DESTDIR="$pkgdir/" install
+ install -D -c -m 0644 "$srcdir/postgresql.conf" "$pkgdir/etc/ld.so.conf.d/postgresql.conf"
+ install -D -c -m 0644 "$srcdir/postgresql.service" "$pkgdir/usr/lib/systemd/system/postgresql.service"
+}
diff --git a/postgresql.conf b/postgresql.conf
new file mode 100644
index 000000000000..1cf5c3b4a12f
--- /dev/null
+++ b/postgresql.conf
@@ -0,0 +1 @@
+/usr/lib/postgresql/
diff --git a/postgresql.install b/postgresql.install
new file mode 100644
index 000000000000..203e0040fda8
--- /dev/null
+++ b/postgresql.install
@@ -0,0 +1,36 @@
+# This is a default template for a post-install scriptlet.
+# Uncomment only required functions and remove any functions
+# you don't need (and this header).
+
+## arg 1: the new package version
+#pre_install() {
+ # do something here
+#}
+
+## arg 1: the new package version
+post_install() {
+ ldconfig
+ grep -q postgres /etc/passwd && useradd -d /var/lib/postgres -m postgres && su - postgres -c 'initdb -D /var/lib/postgres/data'
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+#pre_upgrade() {
+ # do something here
+#}
+
+## arg 1: the new package version
+## arg 2: the old package version
+#post_upgrade() {
+ # do something here
+#}
+
+## arg 1: the old package version
+#pre_remove() {
+ # do something here
+#}
+
+## arg 1: the old package version
+post_remove() {
+ ldconfig
+}
diff --git a/postgresql.service b/postgresql.service
new file mode 100644
index 000000000000..76f6dd2f499e
--- /dev/null
+++ b/postgresql.service
@@ -0,0 +1,27 @@
+[Unit]
+Description=PostgreSQL-1C database server
+After=network.target
+
+[Service]
+Type=forking
+TimeoutSec=120
+User=postgres
+Group=postgres
+
+Environment=PGROOT=/var/lib/postgres
+
+SyslogIdentifier=postgres
+PIDFile=/var/lib/postgres/postmaster.pid
+
+#ExecStartPre=/usr/bin/bin/postgresql-check-db-dir ${PGROOT}/data
+ExecStart=/usr/bin/pg_ctl -D ${PGROOT}/data start
+ExecReload=/usr/bin/pg_ctl -D ${PGROOT}/data reload
+ExecStop=/usr/bin/pg_ctl -D ${PGROOT}/data stop
+
+# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
+# killing Postgres, so adjust it downward
+OOMScoreAdjust=-200
+
+[Install]
+WantedBy=multi-user.target
+