upgrade base version 8.4.x -> 9.0alpha5

This commit is contained in:
KaiGai Kohei 2010-04-03 12:09:31 +00:00
commit 9ec59cc87f
8 changed files with 19098 additions and 22950 deletions

View file

@ -1,2 +1 @@
postgresql-8.4.2.tar.bz2
postgresql-8.4.3.tar.bz2
postgresql-9.0alpha5.tar.bz2

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

19003
sepostgresql-9.0-fullset.patch Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
Index: sepgsql/src/Makefile.global.in
===================================================================
--- sepgsql/src/Makefile.global.in (revision 2237)
+++ sepgsql/src/Makefile.global.in (working copy)
@@ -75,14 +75,14 @@
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 0e3bed5..aee6064 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -74,14 +74,14 @@ bindir := @bindir@
datadir := @datadir@
ifeq "$(findstring pgsql, $(datadir))" ""
ifeq "$(findstring postgres, $(datadir))" ""
@ -19,7 +19,7 @@ Index: sepgsql/src/Makefile.global.in
endif
endif
@@ -91,7 +91,7 @@
@@ -90,7 +90,7 @@ libdir := @libdir@
pkglibdir = $(libdir)
ifeq "$(findstring pgsql, $(pkglibdir))" ""
ifeq "$(findstring postgres, $(pkglibdir))" ""
@ -28,7 +28,7 @@ Index: sepgsql/src/Makefile.global.in
endif
endif
@@ -100,7 +100,7 @@
@@ -99,7 +99,7 @@ includedir := @includedir@
pkgincludedir = $(includedir)
ifeq "$(findstring pgsql, $(pkgincludedir))" ""
ifeq "$(findstring postgres, $(pkgincludedir))" ""
@ -37,7 +37,7 @@ Index: sepgsql/src/Makefile.global.in
endif
endif
@@ -109,7 +109,7 @@
@@ -108,7 +108,7 @@ mandir := @mandir@
docdir := @docdir@
ifeq "$(findstring pgsql, $(docdir))" ""
ifeq "$(findstring postgres, $(docdir))" ""
@ -46,37 +46,55 @@ Index: sepgsql/src/Makefile.global.in
endif
endif
Index: sepgsql/src/bin/pg_ctl/pg_ctl.c
===================================================================
--- sepgsql/src/bin/pg_ctl/pg_ctl.c (revision 2237)
+++ sepgsql/src/bin/pg_ctl/pg_ctl.c (working copy)
@@ -643,7 +643,7 @@
postmaster_path = pg_malloc(MAXPGPATH);
- if ((ret = find_other_exec(argv0, "postgres", PG_BACKEND_VERSIONSTR,
+ if ((ret = find_other_exec(argv0, "sepostgres", PG_BACKEND_VERSIONSTR,
postmaster_path)) < 0)
{
char full_path[MAXPGPATH];
Index: sepgsql/src/bin/initdb/initdb.c
===================================================================
--- sepgsql/src/bin/initdb/initdb.c (revision 2237)
+++ sepgsql/src/bin/initdb/initdb.c (working copy)
@@ -2763,7 +2763,7 @@
sprintf(pgdenv, "PGDATA=%s", pg_data);
putenv(pgdenv);
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 497bdf0..54908f8 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -2722,7 +2722,7 @@ main(int argc, char *argv[])
*/
putenv("TZ=GMT");
- if ((ret = find_other_exec(argv[0], "postgres", PG_BACKEND_VERSIONSTR,
+ if ((ret = find_other_exec(argv[0], "sepostgres", PG_BACKEND_VERSIONSTR,
backend_exec)) < 0)
{
char full_path[MAXPGPATH];
Index: sepgsql/src/bin/pg_dump/pg_dumpall.c
===================================================================
--- sepgsql/src/bin/pg_dump/pg_dumpall.c (revision 2237)
+++ sepgsql/src/bin/pg_dump/pg_dumpall.c (working copy)
@@ -157,7 +157,7 @@
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 814ce97..2550e57 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -654,7 +654,7 @@ do_init(void)
char cmd[MAXPGPATH];
if (exec_path == NULL)
- exec_path = find_other_exec_or_die(argv0, "initdb", "initdb (PostgreSQL) " PG_VERSION "\n");
+ exec_path = find_other_exec_or_die(argv0, "initdb.sepgsql", "initdb (PostgreSQL) " PG_VERSION "\n");
if (pgdata_opt == NULL)
pgdata_opt = "";
@@ -699,7 +699,7 @@ do_start(void)
pgdata_opt = "";
if (exec_path == NULL)
- exec_path = find_other_exec_or_die(argv0, "postgres", PG_BACKEND_VERSIONSTR);
+ exec_path = find_other_exec_or_die(argv0, "sepostgres", PG_BACKEND_VERSIONSTR);
#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_CORE)
if (allow_core_files)
@@ -1069,7 +1069,7 @@ pgwin32_CommandLine(bool registration)
}
else
{
- ret = find_other_exec(argv0, "postgres", PG_BACKEND_VERSIONSTR,
+ ret = find_other_exec(argv0, "sepostgres", PG_BACKEND_VERSIONSTR,
cmdLine);
if (ret != 0)
{
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 83f1678..a0a9444 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -156,7 +156,7 @@ main(int argc, char *argv[])
}
}

View file

@ -7,7 +7,7 @@
# pidfile: /var/run/postmaster.pid
#---------------------------------------------------------------------
PGVERSION="8.4.1"
PGVERSION="`/bin/rpm --queryformat=%{version} -q sepostgresql`"
PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\.[0-9a-z]*\).*$/\1/'`
# source function library
@ -23,21 +23,18 @@ if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ]; then
fi
# set defaults for configurable variables
SEPGSQL_BIN="/usr/bin"
SEPGSQL_CTL="/usr/bin/sepg_ctl"
SEPGSQL_DATA="/var/lib/sepgsql/data"
SEPGSQL_OPTS="-i -p 5432"
SEPGSQL_STARTUP_LOG="/var/lib/sepgsql/pgstartup.log"
SEPGSQL_LOG="/var/log/sepostgresql.log"
SEPGSQL_FALLBACK_CONTEXT="user_u:user_r:user_t"
# override defaults from /etc/sysconfig/sepostgresql
test -f /etc/sysconfig/${NAME} && . /etc/sysconfig/${NAME}
export SEPGSQL_FALLBACK_CONTEXT
# Check that networking is up.
test "${NETWORKING}" = "no" && exit 0
test -f "${SEPGSQL_BIN}/sepostgres" || exit 1
test -f "/usr/bin/sepostgres" || exit 1
script_result=0
@ -77,11 +74,10 @@ do_start() {
chmod 600 ${SEPGSQL_LOG}
test -x /sbin/restorecon && /sbin/restorecon ${SEPGSQL_LOG}
cd ${SEPGSQL_BIN}
/sbin/runuser sepgsql -c "./sepg_ctl -w -t 10 -l ${SEPGSQL_LOG} -D ${SEPGSQL_DATA} -o '${SEPGSQL_OPTS}' start" \
/sbin/runuser sepgsql -c "${SEPGSQL_CTL} -w -t 10 -l ${SEPGSQL_LOG} -D ${SEPGSQL_DATA} -o '${SEPGSQL_OPTS}' start" \
>> ${SEPGSQL_STARTUP_LOG} 2>&1 < /dev/null
sleep 1
PID=`/sbin/runuser sepgsql -c "./sepg_ctl -D ${SEPGSQL_DATA} status 2>/dev/null \
PID=`/sbin/runuser sepgsql -c "${SEPGSQL_CTL} -D ${SEPGSQL_DATA} status 2>/dev/null \
| sed 's/^.*PID: //g' | sed 's/[^0-9].*$//g'"`
if [ ${PIPESTATUS[0]} -eq 0 ]; then
echo "$PID" > "/var/run/${NAME}.pid"
@ -96,8 +92,7 @@ do_start() {
do_stop() {
echo -n $"Stopping ${NAME} service: "
cd ${SEPGSQL_BIN}
/sbin/runuser sepgsql -c "./sepg_ctl -D ${SEPGSQL_DATA} stop" \
/sbin/runuser sepgsql -c "${SEPGSQL_CTL} -D ${SEPGSQL_DATA} stop" \
>> ${SEPGSQL_STARTUP_LOG} 2>&1 < /dev/null
ret=$?
if [ $ret -eq 0 ]; then
@ -112,8 +107,7 @@ do_stop() {
}
do_status() {
cd ${SEPGSQL_BIN}
/sbin/runuser sepgsql -- -c "./sepg_ctl -D ${SEPGSQL_DATA} status" 2>/dev/null \
/sbin/runuser sepgsql -- -c "${SEPGSQL_CTL} -D ${SEPGSQL_DATA} status" 2>/dev/null \
| head -1 | sed "s/^sepg_ctl:/${NAME}:/g"
if [ ${PIPESTATUS[0]} -ne 0 ]; then
@ -125,18 +119,18 @@ do_status() {
do_condrestart() {
cd ${SEPGSQL_BIN}
/sbin/runuser sepgsql -- -c "./sepg_ctl -D ${SEPGSQL_DATA} status" &>/dev/null && do_stop && do_start
/sbin/runuser sepgsql -- -c "${SEPGSQL_CTL} -D ${SEPGSQL_DATA} status" &>/dev/null && do_stop && do_start
}
do_condstop() {
cd ${SEPGSQL_BIN}
/sbin/runuser sepgsql -- -c "./sepg_ctl -D ${SEPGSQL_DATA} status" &>/dev/null && do_stop
/sbin/runuser sepgsql -- -c "${SEPGSQL_CTL} -D ${SEPGSQL_DATA} status" &>/dev/null && do_stop
}
do_reload() {
echo -n $"Reloading ${NAME} service: "
cd ${SEPGSQL_BIN}
/sbin/runuser sepgsql -- -c "./sepg_ctl -D ${SEPGSQL_DATA} reload" &>/dev/null < /dev/null
/sbin/runuser sepgsql -- -c "${SEPGSQL_CTL} -D ${SEPGSQL_DATA} reload" &>/dev/null < /dev/null
if [ $? -eq 0 ]; then
echo_success
else
@ -163,8 +157,7 @@ do_initdb() {
# cleanup SELinux labeling for "${SEPGSQL_DATA}"
test -x /sbin/restorecon && /sbin/restorecon -R "${SEPGSQL_DATA}"
# Initialize the database
cd ${SEPGSQL_BIN}
/sbin/runuser -- sepgsql -c "./initdb.sepgsql --enable-selinux --pgdata='${SEPGSQL_DATA}' --auth='ident'" \
/sbin/runuser -- sepgsql -c "${SEPGSQL_CTL} initdb -o '--enable-selinux --pgdata=${SEPGSQL_DATA} --auth=ident' -D ${SEPGSQL_DATA}" \
>> "${SEPGSQL_STARTUP_LOG}" 2>&1 < /dev/null
if [ -f "${SEPGSQL_DATA}/PG_VERSION" ]; then
echo_success

View file

@ -8,22 +8,24 @@
%define selinux_policy_stores targeted mls
%{!?ssl:%define ssl 1}
%{!?beta:%define beta .alpha5}
Summary: Security Enhanced PostgreSQL
Name: sepostgresql
Version: 8.4.3
Release: 2582%{?dist}
License: BSD
Version: 9.0.0
Release: 20100404%{?beta}%{?dist}
License: PostgreSQL
Group: Applications/Databases
Url: http://code.google.com/p/sepgsql/
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
#XXX - to be revert later
#Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
Source0: postgresql-9.0alpha5.tar.bz2
Source1: sepostgresql.init
Source2: sepostgresql.8
Source3: sepostgresql.logrotate
Patch0: sepostgresql-fedora-prefix.patch
Patch1: pgsql-01-8.4-blobs.patch
Patch2: pgsql-02-8.4-sepgsql.patch
Patch1: sepostgresql-9.0-fullset.patch
BuildRequires: perl glibc-devel bison flex readline-devel zlib-devel >= 1.0.4
BuildRequires: checkpolicy libselinux-devel >= 2.0.80
BuildRequires: selinux-policy >= 3.6.8
@ -34,7 +36,6 @@ Requires(pre): shadow-utils
Requires(post): policycoreutils /sbin/chkconfig
Requires(preun): /sbin/chkconfig /sbin/service
Requires(postun): policycoreutils
Requires: postgresql-server = %{version}
Requires: policycoreutils >= 2.0.16 libselinux >= 2.0.80
Requires: selinux-policy >= 3.6.8
Requires: tzdata logrotate
@ -48,10 +49,11 @@ the operating system. SE-PostgreSQL works as a userspace
reference monitor to check any SQL query.
%prep
%setup -q -n postgresql-%{version}
#XXX - to be revert later
#%setup -q -n postgresql-%{version}
%setup -q -n postgresql-9.0alpha5
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS
@ -65,36 +67,38 @@ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS
%endif
--enable-debug \
--enable-cassert \
--libdir=%{_libdir}/pgsql \
--datadir=%{_datadir}/sepgsql \
--with-system-tzdata=/usr/share/zoneinfo
# parallel build, if possible
rm -f src/Makefile.custom
make %{?_smp_mflags}
touch src/backend/security/sepgsql/policy/sepostgresql-devel.fc
make -C src/backend/security/sepgsql/policy
%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
install -d %{buildroot}%{_datadir}/selinux/packages
install -p -m 644 src/backend/security/sepgsql/policy/sepostgresql-devel.pp \
%{buildroot}%{_datadir}/selinux/packages
# avoid to conflict with native postgresql package
mv %{buildroot}%{_bindir} %{buildroot}%{_bindir}.orig
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_bindir}/
mv %{buildroot}%{_bindir}.orig/initdb %{buildroot}%{_bindir}/initdb.sepgsql
mv %{buildroot}%{_bindir}.orig/pg_ctl %{buildroot}%{_bindir}/sepg_ctl
mv %{buildroot}%{_bindir}.orig/postgres %{buildroot}%{_bindir}/sepostgres
mv %{buildroot}%{_bindir}.orig/pg_dump %{buildroot}%{_bindir}/sepg_dump
mv %{buildroot}%{_bindir}.orig/pg_dumpall %{buildroot}%{_bindir}/sepg_dumpall
mv %{buildroot}%{_bindir}.orig/pg_restore %{buildroot}%{_bindir}/sepg_restore
mv %{buildroot}%{_libdir} %{buildroot}%{_libdir}.orig
install -d %{buildroot}%{_libdir}/sepgsql
mv %{buildroot}%{_libdir}.orig/sepgsql/dict_snowball.so \
%{buildroot}%{_libdir}.orig/sepgsql/plpgsql.so \
%{buildroot}%{_libdir}.orig/sepgsql/*_and_*.so \
%{buildroot}%{_libdir}.orig/sepgsql/euc2004_sjis2004.so \
%{buildroot}%{_libdir}/sepgsql
# remove unnecessary files
rm -rf %{buildroot}%{_bindir}.orig
rm -rf %{buildroot}%{_libdir}
rm -rf %{buildroot}%{_libdir}.orig
rm -rf %{buildroot}%{_includedir}
rm -rf %{buildroot}%{_datadir}/doc
rm -rf %{buildroot}%{_datadir}/sepgsql/timezone
@ -123,24 +127,13 @@ rm -rf %{buildroot}
%pre
getent group sepgsql >/dev/null || groupadd -r sepgsql
getent passwd sepgsql >/dev/null || \
useradd -r -g sepgsql -d %{_localstatedir}/lib/sepgsql -s /bin/bash \
-c "SE-PostgreSQL server" sepgsql
useradd -r -g sepgsql -s /bin/bash -c "SE-PostgreSQL" sepgsql
exit 0
%post
/sbin/chkconfig --add %{name}
/sbin/ldconfig
for store in %{selinux_policy_stores}
do
# clean up legacy policy module (now it is unnecessary)
%{_sbindir}/semodule -s ${store} -r sepostgresql >& /dev/null || :
if %{_sbindir}/semodule -s ${store} -l 2>/dev/null | grep -Eq "^sepostgresql-devel"; then
%{_sbindir}/semodule -s ${store} \
-i %{_datadir}/selinux/packages/sepostgresql-devel.pp >& /dev/null || :
fi
done
# Fix up non-standard file contexts
/sbin/fixfiles -R %{name} restore || :
/sbin/restorecon -R %{_localstatedir}/lib/sepgsql || :
@ -157,12 +150,9 @@ if [ $1 -ge 1 ]; then # rpm -U case
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
if [ $1 -eq 0 ]; then # rpm -e case
for store in %{selinux_policy_stores}
do
%{_sbindir}/semodule -s ${store} -r sepostgresql-devel >& /dev/null || :
done
/sbin/fixfiles -R %{name} restore || :
test -d %{_localstatedir}/lib/sepgsql && /sbin/restorecon -R %{_localstatedir}/lib/sepgsql || :
test -d %{_localstatedir}/lib/sepgsql && \
/sbin/restorecon -R %{_localstatedir}/lib/sepgsql || :
fi
%files
@ -175,6 +165,8 @@ fi
%{_bindir}/sepostgres
%{_bindir}/sepg_dump
%{_bindir}/sepg_dumpall
%{_bindir}/sepg_restore
%{_libdir}/sepgsql/*.so
%{_mandir}/man8/sepostgresql.*
%dir %{_datadir}/sepgsql
%{_datadir}/sepgsql/postgres.bki
@ -188,12 +180,14 @@ fi
%{_datadir}/sepgsql/conversion_create.sql
%{_datadir}/sepgsql/information_schema.sql
%{_datadir}/sepgsql/sql_features.txt
%attr(644,root,root) %{_datadir}/selinux/packages/sepostgresql-devel.pp
%attr(700,sepgsql,sepgsql) %dir %{_localstatedir}/lib/sepgsql
%attr(700,sepgsql,sepgsql) %dir %{_localstatedir}/lib/sepgsql/data
%attr(700,sepgsql,sepgsql) %dir %{_localstatedir}/lib/sepgsql/backups
%changelog
* Sun Apr 4 2010 KaiGai Kohei <kaigai@kaigai.gr.jp> - 9.0.0-20100404
- upgrade base version 8.4.3->9.0alpha5
* Thu Mar 18 2010 KaiGai Kohei <kaigai@ak.jp.nec.com> - 8.4.3-2582
- upgrade base version 8.4.2->8.4.3

View file

@ -1,2 +1 @@
d738227e2f1f742d2f2d4ab56496c5c6 postgresql-8.4.2.tar.bz2
7f70e7b140fb190f268837255582b07e postgresql-8.4.3.tar.bz2
df7a869e7a1fdbe5c5ffc3928eb3d234 postgresql-9.0alpha5.tar.bz2