moved into main repo for pisi 2.0

This commit is contained in:
ayhanyalcinsoy
2015-06-19 13:39:29 +03:00
parent 2450ac02c1
commit fae70ecd20
25 changed files with 1273 additions and 0 deletions
+83
View File
@@ -0,0 +1,83 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
from pisi.actionsapi import get
def setup():
autotools.configure("--with-python \
--with-perl \
--include=/usr/include/postgresql \
--with-includes=/usr/include/libxml2/ \
--with-tcl \
--with-krb5 \
--with-openssl \
--enable-nls \
--with-pam \
--with-libxml \
--with-libxslt \
--with-ldap \
--enable-integer-datetimes \
--enable-thread-safety \
--enable-depend \
--host=%s \
--libdir=/usr/lib \
--disable-rpath \
--with-docdir=/usr/share/doc/postgresql" % get.CHOST())
def build():
if get.LDFLAGS():
ld = "-j1 LD=%s %s" % (get.LD(), get.LDFLAGS())
else:
ld = "-j1 LD=%s" % get.LD()
autotools.make(ld)
shelltools.cd("contrib")
autotools.make(ld)
shelltools.cd("..")
shelltools.cd("contrib/xml2")
autotools.make(ld)
shelltools.cd("../..")
shelltools.cd("src/interfaces/libpq")
autotools.make(ld)
shelltools.cd("../../..")
shelltools.cd("doc")
autotools.make(ld)
shelltools.cd("..")
def install():
autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
shelltools.cd("contrib")
autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
shelltools.cd("..")
shelltools.cd("contrib/xml2")
autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
shelltools.cd("../..")
shelltools.cd("src/interfaces/libpq")
autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
shelltools.cd("../../..")
shelltools.cd("doc")
autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
shelltools.cd("..")
# No static libs
pisitools.remove("/usr/lib/*.a")
pisitools.dodoc("README", "HISTORY", "COPYRIGHT")
pisitools.dodoc("doc/MISSING_FEATURES", "doc/KNOWN_BUGS", "doc/TODO", "doc/bug.template")
pisitools.dodir("/var/lib/postgresql")
pisitools.dodir("/var/lib/postgresql/data")
pisitools.dodir("/var/lib/postgresql/backups")
@@ -0,0 +1,15 @@
#!/usr/bin/python
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.system("/bin/chown -R postgres:postgres /var/lib/postgresql")
os.system("/bin/chmod -R 0700 /var/lib/postgresql/data")
os.system("/bin/chmod -R 0700 /var/lib/postgresql/backups")
# On first install...
if not os.path.exists("/var/lib/postgresql/data/base"):
for i in ["LANG", "LANGUAGE", "LC_ALL"]:
os.environ[i] = "en_US.UTF-8"
os.system('/bin/su postgres -s /bin/sh -p -c "/usr/bin/initdb --pgdata /var/lib/postgresql/data"')
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
from comar.service import *
serviceType="server"
serviceDesc = _({"en": "PostgreSQL Database Server",
"tr": "PostgreSQL Veritabanı Sunucusu"})
serviceConf = "postgresql"
MSG_ERR_PGSQLNOTINST = _({"en": "PostgreSQL is not configured properly, please re-install the package.",
"tr": "PostgreSQL düzgün yapılandırılmamış, lütfen paketi tekrar yükleyin.",
})
def check_postgresql():
import os
if not os.path.exists(config.get("PGDATA", "/var/lib/postgresql/data")):
fail(MSG_ERR_PGSQLNOTINST)
PIDFILE = "%s/postmaster.pid" % config.get("PGDATA", "/var/lib/postgresql/data")
@synchronized
def start():
check_postgresql()
startService(command="/usr/bin/pg_ctl",
args=["start", "-D", config.get("PGDATA", "/var/lib/postgresql/data"), "-l", config.get("PGLOG", "/var/lib/postgresql/data/postgresql.log"), "-o", config.get("PGOPTS", "")],
pidfile=PIDFILE,
chuid=config.get("PGUSER", "postgres"),
donotify=True)
@synchronized
def stop():
stopService(command="/usr/bin/pg_ctl",
args=["stop", "-D", config.get("PGDATA", "/var/lib/postgresql/data"), "-s", "-m", "fast"],
chuid=config.get("PGUSER", "postgres"),
donotify=True)
def reload():
stopService(command="/usr/bin/pg_ctl",
args=["reload", "-D", config.get("PGDATA", "/var/lib/postgresql/data"), "-s"],
donotify=True)
def status():
return isServiceRunning(PIDFILE)
@@ -0,0 +1,13 @@
# PostgreSQL's Database Directory
PGDATA=/var/lib/postgresql/data
# Logfile path: (NOTE: This must be uid/gid owned by the value of $PGUSER!)
PGLOG=/var/lib/postgresql/data/postgresql.log
# Run the PostgreSQL user as:
PGUSER=postgres
# Extra options to run postmaster with.
# If you want to enable TCP/IP for PostgreSQL, add -i to the following:
# PGOPTS="-N 1024 -B 2048 -i"
PGOPTS=""
+151
View File
@@ -0,0 +1,151 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>postgresql</Name>
<Homepage>http://www.postgresql.org/</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>GPLv2</License>
<IsA>service</IsA>
<Summary>A powerful, open source relational database system</Summary>
<Description>PostgreSQL is a powerful, open source relational database system.</Description>
<Archive sha1sum="a5b4a63339c26849e8e9b7645436c976e4b40f50" type="tarbz2">http://ftp.postgresql.org/pub/source/v9.3.4/postgresql-9.3.4.tar.bz2</Archive>
<BuildDependencies>
<Dependency>mit-kerberos</Dependency>
<Dependency>tcl-devel</Dependency>
<Dependency>libxslt-devel</Dependency>
<Dependency>libxml2-devel</Dependency>
</BuildDependencies>
<Patches>
<!--Patch level="1">backend_po_translation.patch</Patch-->
</Patches>
</Source>
<Package>
<Name>postgresql-lib</Name>
<IsA>library</IsA>
<Summary>Essential shared libraries for any PostgreSQL client program or interface</Summary>
<RuntimeDependencies>
<Dependency>mit-kerberos</Dependency>
<Dependency>tcl</Dependency>
<Dependency>libxslt</Dependency>
<Dependency>openldap-client</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib</Path>
<Path fileType="header">/usr/include</Path>
<Path fileType="data">/usr/share/postgresql</Path>
<Path fileType="executable">/usr/bin/pg_config</Path>
</Files>
</Package>
<Package>
<Name>postgresql-doc</Name>
<IsA>data:doc</IsA>
<Summary>Postgresql documents</Summary>
<Description>Additional documentation for PostgreSQL.</Description>
<RuntimeDependencies>
<Dependency release="current">postgresql-lib</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="doc">/usr/share/doc</Path>
</Files>
</Package>
<Package>
<Name>postgresql-server</Name>
<IsA>service</IsA>
<RuntimeDependencies>
<Dependency release="current">postgresql-lib</Dependency>
<Dependency>mit-kerberos</Dependency>
<Dependency>openldap-client</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="config">/etc</Path>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="localedata">/usr/share/locale</Path>
<Path fileType="data">/usr/share/postgresql/contrib</Path>
<Path fileType="man">/usr/share/man</Path>
<Path fileType="data">/var/lib</Path>
</Files>
<AdditionalFiles>
<AdditionalFile target="/etc/conf.d/postgresql" owner="root" permission="0644">postgresql.conf-8</AdditionalFile>
</AdditionalFiles>
<Provides>
<COMAR script="package.py">System.Package</COMAR>
<COMAR script="service.py">System.Service</COMAR>
</Provides>
</Package>
<Package>
<Name>postgresql-pl</Name>
<RuntimeDependencies>
<Dependency release="current">postgresql-lib</Dependency>
<Dependency>tcl</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/usr/bin/pltcl_listmod</Path>
<Path fileType="executable">/usr/bin/pltcl_loadmod</Path>
<Path fileType="executable">/usr/bin/pltcl_delmod</Path>
<Path fileType="library">/usr/lib/postgresql/plperl.so</Path>
<Path fileType="library">/usr/lib/postgresql/plpython.so</Path>
<Path fileType="library">/usr/lib/postgresql/pltcl.so</Path>
<Path fileType="data">/usr/share/postgresql/unknown.pltcl</Path>
</Files>
</Package>
<History>
<Update release="7">
<Date>2014-05-19</Date>
<Version>9.3.4</Version>
<Comment>Version bump.</Comment>
<Name>Alihan Öztürk</Name>
<Email>alihan@pisilinux.org</Email>
</Update>
<Update release="6">
<Date>2014-04-23</Date>
<Version>9.3.3</Version>
<Comment>Rebuild for webp.</Comment>
<Name>Kamil Atlı</Name>
<Email>suvarice@gmail.com</Email>
</Update>
<Update release="5">
<Date>2014-02-21</Date>
<Version>9.3.3</Version>
<Comment>Version bump.</Comment>
<Name>Yusuf Aydemir</Name>
<Email>yusuf.aydemir@pisilinux.org</Email>
</Update>
<Update release="4">
<Date>2013-11-17</Date>
<Version>9.3.1</Version>
<Comment>Fix demp</Comment>
<Name>Richard de Bruin</Name>
<Email>richdb@pisilinux.org</Email>
</Update>
<Update release="3">
<Date>2013-11-15</Date>
<Version>9.3.1</Version>
<Comment>Version bump</Comment>
<Name>Aydın Demirel</Name>
<Email>aydin.demirel@pisilinux.org</Email>
</Update>
<Update release="2">
<Date>2013-02-25</Date>
<Version>9.2.3</Version>
<Comment>Version bump</Comment>
<Name>Ertan Güven</Name>
<Email>ertan@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2012-10-04</Date>
<Version>9.2.0</Version>
<Comment>First release</Comment>
<Name>Yusuf Aydemir</Name>
<Email>yusuf.aydemir@pisilinux.org</Email>
</Update>
</History>
</PISI>
@@ -0,0 +1,14 @@
<?xml version="1.0" ?>
<PISI>
<Source>
<Name>postgresql</Name>
<Summary xml:lang="tr">Güçlü bir açık kaynaklı ilişkisel veritabanı sistemi</Summary>
<Description xml:lang="tr">PostgreSQL, açık kaynak kodlu, güçlü bir ilişkisel veritabanıdır</Description>
</Source>
<Package>
<Name>postgresql-doc</Name>
<Summary xml:lang="tr">Postegresql belgeleri</Summary>
<Description xml:lang="tr">PostegreSQL için ek belgelendirme</Description>
</Package>
</PISI>