2020-10-23  Honza Horak  <hhorak@redhat.com>

	Release 8.5

2020-10-23  Pavel Raiskup  <praiskup@redhat.com>

	Add postgresql-upgrade script

	This should be a self-standing script which doesn't need a service file
	for successful data directory upgrade.  It has similar functionality as
	'postgresql-setup --upgrade' script -- but without the need to run it as
	root/postgres user, and without the need to have '*.service' file
	pre-configured.  It's as easy as run 'postgresql-upgrdae <DATADIR>'.

	* bin/Makefile.inc: Administrivia.
	* bin/postgresql-upgrade.in: The new template for the new script.
	* doc/Makefile.inc: Automatically build the manual page for the new
	script.

2020-09-21  sanjay-cpu  <snjkmr32@gmail.com>

	travis: build also on ppc64le architecture

	The -t flag is removed because it is not supported on ppc64le
	archictecture on travis and throws a error
	"The input device is not a TTY"

	Closes: #27

2020-03-12  Honza Horak  <hhorak@redhat.com>

	Fix the variable name in postgresql_pkg_tests.sh

	Originally reported in https://bugzilla.redhat.com/show_bug.cgi?id=1803696

2019-03-05  Pavel Raiskup  <praiskup@redhat.com>

	post-release administrivia

	* NEWS: New 8.5 category.
	* configure.ac: Bump version to 8.5~dev.

2019-03-05  Pavel Raiskup  <praiskup@redhat.com>

	Release 8.4

	* bin/postgresql-setup.in (GLIBC_COLLATION_WARN_STRING): Reformat once more to avoid too-long first line.

2019-03-05  Pavel Raiskup  <praiskup@redhat.com>

	setup: reformat glibc collation warning

	* bin/postgresql-setup.in (GLIBC_COLLATION_WARN_STRING): Align to
	80 characters, and drop the additional WARNING: keyword.

2019-02-28  Pavel Raiskup  <praiskup@redhat.com>

	post-release administrivia

	* NEWS: New 8.4 category.
	* configure.ac: Bump version to 8.4~dev.

2019-02-22  Patrik Novotný  <panovotn@redhat.com>

	Warn about possible glibc collation changes

	* bin/postgresql-setup.in: Print warning about possible glibc collation on
	successful upgrade.

2019-02-21  Pavel Raiskup  <praiskup@redhat.com>

	service: fix ExecStart= for Red Hat Software Collections

	Historically we used `pg_ctl` in ExecStart=, which we later
	wrapped into postgresql-ctl script - and later we moved to
	/bin/postmaster directly.

	The postgresql-ctl script had two purposes:
	(a) some additional/compat logic on top of pg_ctl and
	(b) it enabled the software collection by `scl_source`.
	When we moved to ExecStart=/bin/postmaster we realized that (a) is
	not needed anymore but we forgot about (b).

	Now we got report that server fails to load modules because it
	doesn't have LD_LIBRARY_PATH set accordingly in Software
	Collections scenario.

	Ideally, we would wrap %_bindir/postmaster by something like
	%_bindir/postmaster-scl.  But this would mean that we'd have to
	request selinux-policy change, and wait till it gets updated.  So
	instead of shell wrapper script, invoke /bin/sh directly.  The
	/bin/sh is symlink to /bin/bash, which has shell_exec_t label;
	and SELinux policy allows shell_exec_t -> postgresql_exec_t ->
	postgresql_t transition.

	This started to be an issue after sd_notify switch, done in
	925b34c73a887da5c3d0cfd5cfa578b8c3665211.

	Related: rhbz#1550567, rhbz#1631185

2019-01-23  Pavel Raiskup  <praiskup@redhat.com>

	Add MODULE_COMPAT_SUFFIX variable

	This allows us to easily distinguish packages built against normal
	PostgreSQL server and modular PostgreSQL server.

	* configure.ac (MODULE_COMPAT_SUFFIX): New option.
	* lib/rpm/macros.d/macros.in: Use @MODULE_COMPAT_SUFFIX@.

2018-08-10  Pavel Raiskup  <praiskup@redhat.com>

	fix datadir log directory for PG v10+

	* bin/postgresql-setup.in: Create '$pgdata/log' for PG 10+, and
	'$pgdata/pg_log' for PG < 10.
	* configure.ac: Define PGLOGDIR_BASENAME based on PGVERSION.

2018-08-02  Pavel Raiskup  <praiskup@redhat.com>

	Bump version to 8.2

	* configure.ac (AC_INIT): Bump.

2018-08-02  Pavel Raiskup  <praiskup@redhat.com>

	%postgresql_tests*: print server error log

	* share/postgresql-setup/postgresql_pkg_tests.sh.in
	(__pgtests_start): Print error output if server fails to start.

2018-08-02  Pavel Raiskup  <praiskup@redhat.com>

	%postgresql_tests*: macros use random server port

	* share/postgresql-setup/postgresql_pkg_tests.sh.in
	(try_random_port): New function which tries to portably generate
	random port between 32000 and 32000 + 32767, as a fallback - port
	54321 port is returned.

2018-07-17  Pavel Raiskup  <praiskup@redhat.com>

	macros: the '&& cmd' ignores 'set -e'

	* share/postgresql-setup/postgresql_pkg_tests.sh.in: Don't use
	'cmd && cmd' statements in 'set -e' shell environment - in
	rpmbuild.

2018-05-08  Pavel Raiskup  <praiskup@redhat.com>

	lib: fix debug() so it works with set -e

2018-05-08  Pavel Raiskup  <praiskup@redhat.com>

	aux: fix our-install-sh

	* auxdir/our-install-sh: Fix handling of arguments so actually all
	arguments except for the last one are edited.

2018-05-08  Pavel Raiskup  <praiskup@redhat.com>

	buildsystem: add bin/Makefile.inc

	* Makefile.am (setup, setup_in): Move to bin/Makefile.inc.
	* postgresql-setup.in: Moved under bin/ unchanged.
	* doc/Makefile.inc: Reflect that built postgresql-setup is under
	bin/ subdir.
	* src/Makefile.inc: New file.

2018-04-13  Pavel Raiskup  <praiskup@redhat.com>

	travis: depend on fedora:latest docker image

2018-04-12  Pavel Raiskup  <praiskup@redhat.com>

	travis: install 'make' into docker image

2018-04-12  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: minor doc updates

	* README.rpm-dist: scls don't need the *-upgrade package installed
	since scls are parallel installable.  Mention that 10.1 -> 10.5
	update is not a major update anymore with new versioning scheme.

2018-04-12  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: postgresql-libs subpackage is not mandatory

	* README.rpm-dist.template: Opt-out *-libs docs.
	* configure.ac: Add --without-libs-pkg option.

2018-04-12  Pavel Raiskup  <praiskup@redhat.com>

	macros: split into two files

	* configure.ac: Bump version to 8.1.
	* lib/rpm/Makefile.inc: Build also macros.postgresql-test
	* lib/rpm/macros.d/macros.in: Remove some macros, and move them...
	* lib/rpm/macros.d/macros-test.in: ... here.  New file.

2017-12-19  Pavel Raiskup  <praiskup@redhat.com>

	Release v8.0

	* configure.ac: Bump project version.

2017-12-15  Pavel Raiskup  <praiskup@redhat.com>

	service: disable start/stop killing timeout policy

	* postgresql.service.in (TimeoutSec): Set to 0 (infinity).

2017-12-15  Pavel Raiskup  <praiskup@redhat.com>

	systemd: sd_notify support

	* Makefile.am: Don't generate/install postgresql-ctl for systemd
	systems.
	* postgresql.service.in: Use Type=notify, fix Exec* statements (we
	don't have to use the postgresql-ctl wrapper. KillMode=mixed is
	needed for the master/slave process design of PostgreSQL server.
	Drop the PGSTARTTIMEOUT variable, which is not used now (only the
	TimeoutSec is used now, but see rhbz#1525477).

2017-12-15  Pavel Raiskup  <praiskup@redhat.com>

	post-release administrivia

2017-11-14  Pavel Raiskup  <praiskup@redhat.com>

	Release v7.0

	* configure.ac: Bump project version.

2017-11-14  Pavel Raiskup  <praiskup@redhat.com>

	postgresql_pkg_tests.sh made a template

	This makes the testing macros actually work for SCLs, too;  since
	the script needs to enable the proper collection to make all the
	binaries work.

	* .gitignore: Ignore new product.
	* configure.ac: Non-existing %scl means that %scl expands to
	'%scl' string, not empty string.
	* share/postgresql-setup/Makefile.inc: Generate
	postgresql_pkg_tests.sh from postgresql_pkg_tests.sh.in.
	* share/postgresql-setup/postgresql_pkg_tests.sh: Renamed to
	share/postgresql-setup/postgresql_pkg_tests.sh.in.

2017-11-14  Pavel Raiskup  <praiskup@redhat.com>

	macros: name the file like macros.$(SERVICE_NAME)

	There's no need to convert dashes to underscore in filename.

	* lib/rpm/Makefile.inc (rpm_macros): Substitute
	s/SERVICE_NAME_VARNAME/SERVICE_NAME/.

2017-11-13  Pavel Raiskup  <praiskup@redhat.com>

	macros: provide %pgtest_* macros for compatibility

	But only for 'postgresql' services (not for SCLs).  And also warn
	appropriately that the macro will be removed.

	* configure.ac (COMPAT_MACROS): New automake conditional.
	* lib/rpm/Makefile.inc: Edit the macros file when necessary, and
	warn the user.

2017-11-13  Pavel Raiskup  <praiskup@redhat.com>

	macros: define %postgresql_tests_run

	* lib/rpm/macros.d/macros.in (postgresql_tests_run): New macro for
	the cases when the temporary testing postgresql cluster doesn't
	need any specific configuration.

2017-11-13  Pavel Raiskup  <praiskup@redhat.com>

	macros: generalize them for scls

	Fixes: #4

	* configure.ac: Bump version to 7.0~dev, as we bring incompatible
	changes.
	(NAME_SERVICE_VARNAME): New substitution.
	* lib/rpm/macros.d/macros.in: Use @NAME_SERVICE_VARNAME@
	substitution pattern everywhere.
	* lib/rpm/Makefile.inc: Use rather $NAME_SERVICE_VARNAME for
	macros file name-spacing.  That's better for installing several
	versions of devel packages (system + collections).

2017-11-13  Pavel Raiskup  <praiskup@redhat.com>

	configure: simplify building against scls

	* configure.ac: Add new --with-scl option, which automatically
	detects the %scl macro value and configures everything else.

2017-11-13  Pavel Raiskup  <praiskup@redhat.com>

	macros: define %postgresql_module_requires for convenience

	post-release version bump to 6.1~dev

2017-11-06  Pavel Raiskup  <praiskup@redhat.com>

	upgrade: check that pg_upgrade is installed

	The server package usually depends on package which brings the
	pg_upgrade binary, except for SCLs with PostgreSQL 9.4.

	* postgresql-setup.in (upgrade): Detect non-existent pg_upgrade
	binary.

2017-11-06  Pavel Raiskup  <praiskup@redhat.com>

	Release v6.0

	* configure.ac: Bump project version.

2017-11-06  Pavel Raiskup  <praiskup@redhat.com>

	man pages should depend on pre-generated library

	* doc/Makefile.inc: Man page targets to depend on library.sh.

2017-11-06  Pavel Raiskup  <praiskup@redhat.com>

	security: CVE-2017-12172 CVE-2017-15097

	* postgresql-setup.in: Drop the root permissions ASAP, at the
	beginning of the script.  Removing --datadir and
	--new-systemd-unit options.  Removing the direct calls to
	chown/chmod, since we create the files under 'postgres' user, and
	we have set the umask to 0077.  The root_prereq call dropped,
	the script can be run directly by 'postgres' user now.
	($RESTORECON, $USER): New helper variables.
	($SU_POSTGRES): Dropped, since we don't need to drop root
	permissions on multiple places.
	(generate_systemd_dropin, exit_handler): Drop this functions, not
	needed since we don't support --new-systemd-unit option now.
	(upgrade): Don't add semicolon into env-var hacks, since we
	separate the hacks by new-line, semicolon is redundant.  Switching
	from run_cmd_as_dbadmin to direct call (su is not needed), but to
	keep the semantics of env-var hacks we need to 'eval' them (so
	closing the env-hacks into parentheses to not affect script
	variables.
	* postgresql.init.in ($RESTORECON): New helper variable, must be
	always set to some value, even when /sbin/restorecon is not found.
	(admin_cmd): Replacement for run_cmd_as_dbadmin from library, but
	now working better with arguments which need to be quoted.  Also
	setting umask automatically.
	(start): Use 'admin_cmd' instead of working with files under root,
	or using run_cmd_as_dbadmin.
	* sbin/new-systemd-unit.in: New helper script as a replacement for
	the --new-systemd-unit option in postgresql-setup.
	* share/postgresql-setup/library.sh.in (root_prereq): Since
	this is now used in early state of *-new-systemd-unit script, we
	need to reflect $PGSETUP_TEST variable to be able to run help2man
	script.
	(run_cmd_as_dbadmin): Dropped, no script needs this.
	* configure.ac (PGADMINUSER): New substitution.
	(SU_POSTGRES): Use PGADMINUSER, allows distributors to replace the
	username.
	(SCL_SOURCE): Always define to some value (true by default), this
	simplifies working with the @SCL_SOURCE@ pattern.  Drop the
	trailing semicolon, callers should do this.
	* doc/Makefile.inc: Generate new $(new_unit_man) manpage.  Install
	it only on systemd-aware systems.
	* sbin/Makefile.inc: New file.
	* .gitignore: Ignore new script under sbin/ directory.
	* Makefile.am: Reflect new build subdir sbin/.
	* README.rpm-dist.template: Document the (new) way how to
	automatically generate new systemd unit.

2017-11-01  Pavel Raiskup  <praiskup@redhat.com>

	* .travis.yml: Enable distcheck CI. (#3)

2017-11-01  Pavel Raiskup  <praiskup@redhat.com>

	distcheck: fix it

	* doc/Makefile.inc: Ensure that doc/ directory exists in builddir.

2017-11-01  Pavel Raiskup  <praiskup@redhat.com>

	Drop findutils requirement

	The 'find' binary is often missing in docker images.

	* README: Document requirement.
	* share/postgresql-setup/library.sh.in (parse_upgrade_setup): Use
	'ls -1' instead of 'find'.
	* configure.ac: Bump version for development.

2017-04-24  Nils Philippsen  <nils@redhat.com>

	configury: doc/Makefile.am doesn't exist anymore

	Fixes github pull request #1.

	* doc/Makefile.in: Drop doc/Makefile from AC_CONFIG_FILES.

2017-04-10  Pavel Raiskup  <praiskup@redhat.com>

	docs: properly geneate man page

	* Makefile.am (INSTALL_SCRIPT): Re-define to our wrapper.
	* auxdir/our-install-sh: New wrapper around 'install -c'.
	* doc/Makefile.inc: Ensure manpage source is referenced with
	leading $(builddir) variable.
	* postgresql-setup.in: Add build-time only function which
	translates install-time dirs into source dirs.

2017-04-10  Pavel Raiskup  <praiskup@redhat.com>

	doc: fix distcheck generation of postgresql-setup.1

	Drop one Makefile.am subdir..

	* doc/Makefile.am: Moved to doc/Makefile.inc.
	* Makefile.am: Include doc/Makefile.inc.
	(DISTCLEANFILES): Properly define and append to it.

2017-04-10  Pavel Raiskup  <praiskup@redhat.com>

	build: detect systemd/sysvinit

	The detection is now very trivial, basically if the directory
	/usr/lib/systemd/system exists, we build for systemd.

	* configure.a (--with-sysvinit): Drop the explicit option.
	(systemdunitsdir, systemduserunitsdir, systemdlegacyscriptsdir)
	(initscripts): Point directly to / directory, not ${prefix}.
	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Add systemdunitsdir,
	systemduserunitsdir, systemdlegacyscriptsdir, initscriptsdir to
	pass make distcheck.

2017-04-10  Pavel Raiskup  <praiskup@redhat.com>

	rpmmacrosdir: heuristic for rhel6+

	* configure.ac: Check that /usr/lib/rpm/macros.d exists, and use
	that as rpmmacrosdir when yes.
	* Makefile.am: Add DISTCHECK_CONFIGURE_FLAGS to pass distcheck.

2016-10-04  Pavel Raiskup  <praiskup@redhat.com>

	build: simplify working with template deps

	* Makefile.am: Use text_tpl_deps instead of c_s for automatic
	dependency everywhere.
	* lib/rpm/Makefile.inc, tests/Makefile.am: Likewise.
	* share/postgresql-setup/Makefile.inc: Likewise.
	* configure.ac: Don't define c_s as it is not needed now.
	* m4/_ax_text_tpl.m4: Add Makefile into auto deps for templates,
	that's needed because we don't need to reconfigure to adjust
	template outputs, it is enough to define Makefile.am variable.

2016-10-04  Pavel Raiskup  <praiskup@redhat.com>

	* configure.ac: Fix detection of PGMAJORVERSION.

2016-10-04  Pavel Raiskup  <praiskup@redhat.com>

	pkg-testsuite: add testing helpers

	This is already used by some Fedora packages, and it is worth
	maintaining on one place.

	* Makefile.am (_AX_TEXT_ADDITIONAL_SED_SUBSTITUTIONS): Define new
	empty global.
	* lib/rpm/macros.d/macros.in (%pgtests_init, %pgtests_start): New
	RPM macros.
	* share/postgresql-setup/Makefile.inc (PKG_TESTS_LIB): Expand new
	variable in templates.
	* share/postgresql-setup/postgresql_pkg_tests.sh: New file
	bringing all the trivial helpers.

2016-10-03  Pavel Raiskup  <praiskup@redhat.com>

	rpm macros: install macros file

	For now, only %postgresql_major macro is defined.

	* .gitignore: New file.
	* Makefile.am: Include new makefile snippet.
	* configure.ac: Define rpm macros dir.  This still needs to be
	fixed for SCLs (or defined explicitly during build), or removed
	because we don't build external plugins yet?  Also bump package
	major version because this requires non-trivial update in spec
	files.
	* lib/rpm/Makefile.inc: New file.
	* lib/rpm/macros.d/macros.in: New template file.

2016-09-02  Edgar Hoch  <edgar.hoch@ims.uni-stuttgart.de>

	postgresql-setup.in: fix 'redhat_sockets_hack' semantics

	* postgresql-setup.in (upgrade): Only define the
	REDHAT_PGUPGRADE_FROM_RHEL when the option is set to 'yes'.

2016-09-02  Edgar Hoch  <edgar.hoch@ims.uni-stuttgart.de>

	postgresql-setup.in: umask fix for temporary pg_hba.conf

	Temporary created pg_hba.conf is created under root user.  Having
	umask like 0027 caused that 'postgresql-setup --upgrade' failed
	because 'postgres' user couldn't read pg_hba.conf.

	* postgresql-setup.in (upgrade): Fix ownership, permissions and
	selinux context as is done with other files.

2016-09-02  Pavel Raiskup  <praiskup@redhat.com>

	* configure.ac (AC_INIT): Post-release version bump.

2016-01-07  Pavel Raiskup  <praiskup@redhat.com>

	NEWS: document one missing fix

2016-01-07  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: reflect pg_upgrade movement

	The pg_upgrade binary is not in postgresql-upgrade package now.
	In some upgrade scenarios, postgresql-upgrade is redundant package
	(SCLs/PGRPMSs).  Hack the code so postgresql-setup is able to
	correctly advice which package should be installed to make the
	"old" engine available.

	* postgresql-setup.in (upgrade): Don't check for pg_upgrade binary
	existence but rather for postgres binary, and warn user with
	proper package name if missing.
	* share/postgresql-setup/library.sh.in (parse_upgrade_setup):
	White-list also 'package' constant name.
	* configure.ac: Bump version.

2015-11-30  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: postgres's $HOME must be writeable

	The pg_upgrade fails with confusing error message if there are
	wrong /var/lib/pgsql permissions.  It's not very obvious what is
	the pg_upgrade's work-dir (we use 'runuser' -l) -- for this reason
	exit rather early with understandable error message.

	* postgresql-setup.in: Exit if postgres user is not able to write
	into $POSTGRES_HOMEDIR.

2015-11-16  Pavel Raiskup  <praiskup@redhat.com>

	release: 3.5

	* configure.ac: Version bump.
	* NEWS: Document.

2015-11-16  Pavel Raiskup  <praiskup@redhat.com>

	m4: _AX_TEXT_TPL_SUBST should take default value

	This broke testsuite because it relies on construct
	_AX_TEXT_TPL_SUBST([TEST_GEN_FILES_LIST], [.generated_files])
	set within configure.ac.

	* m4/_ax_text_tpl.m4 (_AX_TEXT_TPL_SUBST): Take optional default
	value.

2015-10-15  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: option --initdb requires root

	While we are on it, use '#' symbol as prompt for root-only
	commands.

	* README.rpm-dist.template (PGSETUP_ROOT_COMMAND): New macro.
	(_PGSETUP_COMMAND): New wrapper macro.
	(PGSETUP_COMMAND): Use _PGSETUP_COMMAND.
	(UPGRADING AN INSTALLATION): s/postgresql/postgresql-setup/.

2015-09-25  Pavel Raiskup  <praiskup@redhat.com>

	* postgresql-setup.in: Fix the 'mountpoint' warning, spotted by Tom Lane.

2015-09-25  Pavel Raiskup  <praiskup@redhat.com>

	release: 3.4

	* configure.ac: Version bump.

2015-09-25  Pavel Raiskup  <praiskup@redhat.com>

	configury: switch to _ax_text_tpl.m4

	The script generation Makefile snippets are now used from
	_ax_text_tpl.m4, DRY principle (the m4 file is maintained
	separately for multiple projects).

	* configure.ac: Remove all the manual work with substitutions,
	start using _AX_TEXT_* macros.
	* Makefile.am: Use $(text_tpl_gen*) variables from _ax_text_tpl.
	* tests/Makefile.am: Likewise.
	* share/postgresql-setup/Makefile.inc: Likewise.
	* m4/_ax_text_tpl.m4: New file, TODO: publish somewhere.
	* m4/packaging.m4: Reuse _ax_text_tpl.

2015-09-25  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: warn for $PGDATA mountpoints

	Resolves: rhbz#1247477

	* configure.ac (MOUNTPOINT): New configure-time variable.
	* postgresql-setup.in: Warn if $pgdata or `dirname $pgdata` is
	a mountpoint.
	* NEWS: Document.
	* README: Document that its better to have util-linux in BR.

2015-09-22  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: don't use .service suffix for sysvinit

	* postgresql-setup.in: Reuse $srvsuff in error msg.

2015-09-22  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: better error message

	* postgresql-setup.in: Give better hint about wrongly selected
	--upgrade-from argument.

2015-09-22  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: fix upgrade bug with non-default unit names

	We can't always use '$upgradefrom_id' as "default" previous
	service name.  This broken in-place upgrades with
	'--unit postgresqlPORT' (old style service files layout) or
	'postgresql@port'.  Now, by default, use the same service name
	for both older and newer PG stack.

	While we are on it, make it a bit more automatic and pick
	'postgresql92@second' as "older stack" if upgrading into unit
	'postgresql93@second'.

	Add new option --upgrade-from-unit which allows us to override
	default decision.

	* postgresql-setup.in: Set 'option_upgradefrom_unit' to hopefully
	correct default.  Add new info message in case we are not
	upgrading from differently named unit.
	(USAGE_STRING): Document new --upgrade-from-unit option.
	(service_configuration): Don't fork based on $mode and simply use
	fourth parameter as 'service'.  Fix the debug message a bit.
	(long_opts): Add new option upgrade-from-unit.
	* NEWS: Document.

2015-04-22  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: fix paths descriptions

	* configure.ac: Substitute more variables.
	* README.rpm-dist.template (Filesystem layout): Fix paths to be
	generated correctly even for non-default builds.
	(UPGRADING AN INSTALLATION): Fix link to old data directory.

2015-03-22  Pavel Raiskup  <praiskup@redhat.com>

	configury: always rebuild manual page

	* doc/Makefile.am (setup_man): Depend on generated
	postgresql-setup instead of source file.

2015-03-22  Pavel Raiskup  <praiskup@redhat.com>

	configury: fix make distcheck

	* Makefile.am: Use $(srcdir)/style.dsl instead of style.dsl.

2015-03-22  Pavel Raiskup  <praiskup@redhat.com>

	initscript: don't block system start-up by default

	This commit should resolve complaints against pg_ctl -w usage from
	initscript (see rhbz#800534 for more info).

	The problem is that pg_ctl -w can block whole system startup too
	long - until the server is fully ready to accept connections.  The
	commit 8c7b2cd5f6d9efb59568382cd8b6e88d9be517bb thus invented
	basically bad approach for initscript.

	Now, the "-w" option is used only if the PGSTARTWAIT is explicitly
	set to 1 by administrator.  In this case, the PGSTARTTIMEOUT
	numeric value (in seconds) is respected (or limit 30 seconds is
	set by default).

	Otherwise, if PGSTARTWAIT is unset (default), initscript keeps
	checking only for the pidfile existence (at most PGSTARTTIMEOUT
	seconds).  The hardwired 'sleep 2' command (activated before
	8c7b2cd5f6 commit) is still not used - regular/default system
	startup should be a bit faster than before.

	* postgresql.init.in (start): Fix handling of PGDATA, PGPORT,
	PGOPTS and PGSCLS - to respect special quoting characters inside,
	we should escape the strings before passing those to command
	evaluation.  Use printf %q as we use bash and we don't care too
	much about portability.  Also, don't call postgresql-ctl with -w
	option if PGSTARTWAIT is empty or undefined.  Implement pidfile
	polling for the cases PGSTARTWAIT is unset.  Return success faster
	if server is already running.
	($PGSTARTWAIT): New env variable.
	* postgresql-ctl.in: Don't parse $PGPORT into -o option as it is
	not needed.  Unset PGPORT if the variable is empty - postgres
	server would fail with empty value.
	* configure.ac: Bump version to 3.3.
	* NEWS: Document bugfixes.

2015-03-20  Pavel Raiskup  <praiskup@redhat.com>

	setup: enhance --new-systemd-unit

	Do not left created dropin directory in case of some initdb
	failure, or so.  This allow user run the same --new-systemd-unit
	repeatedly without changing the command-line.

	* postgresql-setup.in (exit_handler): New exit callback wrapper.
	($cleanup_dropin): Code to be executed to clean drop-in directory.
	(generate_systemd_dropin): Fill $cleanup_dropin callback.
	(initdb): Clean $cleanup_dropin in case of successful initdb.
	This is not needed for upgrade() because we never create drop-ins
	there.

	* NEWS: Document changes.

2015-03-20  Pavel Raiskup  <praiskup@redhat.com>

	setup: fix typos in comment

	* postgresql-setup.in (service_configuration): Fix commente and
	use @NAME_SERVICE@ instead of @SERVICE_NAME@.  This would break
	testsuite.

2015-03-20  Pavel Raiskup  <praiskup@redhat.com>

	setup: don't set default pgdata blindly

	* postgresql-setup.in (service_configuration): Move the setting of
	pgdata into sysvinit-only branch.
	* NEWS: Document fixed bug.
	* configure.ac: Bump version to 3.2.

2015-03-19  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: upgrade & avoid running old server

	* postgresql-setup.in (upgrade): Call old_data_in_use to ensure
	that the old database server is not running.
	(old_data_in_use): New function.
	($cleaup): Rename to $failure_cleanup.
	* NEWS: Document.

2015-03-19  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: keep old-dir usable with pg_upgrade

	* postgresql-setup.in (upgrade): Don't use --link option if we are
	not doing in-place upgrade.
	* NEWS: Document.
	* configure.ac: Bump minor version.

2015-03-19  Pavel Raiskup  <praiskup@redhat.com>

	release 3.0

	* configure.ac: Bump version to full major version 3.

2015-03-19  Pavel Raiskup  <praiskup@redhat.com>

	init: add PGSCLS env variable

	* postgresql-ctl.in: Respect PGSCLS env variable.
	* postgresql.init.in: Export PGSCLS variable possibly sourced from
	sysconfig configuration file.
	* NEWS: Document.

2015-03-19  Pavel Raiskup  <praiskup@redhat.com>

	init: add PGSTARTTIMEOUT config env variable

	* postgresql.init.in (PGSTARTTIMEOUT): New variable.
	(start): Use postgresql-ctl and respect PGSTARTTIMEOUT.
	* postgresql.service.in: Better document the timeouts.
	(PGSTARTTIMEOUT): New env variable.
	(ExecStart): Respect PGSTARTTIMEOUT.
	* NEWS: Document.

2015-03-19  Pavel Raiskup  <praiskup@redhat.com>

	initscript: always use run_cmd_as_dbadmin

	Per hhorak's review.

	* postgresql.init.in (SU_POSTGRES): Remove unused variable.
	(reload): Use run_cmd_as_dbadmin.

2015-03-18  Pavel Raiskup  <praiskup@redhat.com>

	sysvinit: initscript & postgresql-setup fixes

	* postgresql-setup.in($USAGE_STRING): Don't output sysvinit
	not-relevant options.  Generalize the help a bit to match
	sysvinit.  Throw a better warning if user runs 'service initdb
	postgresql@blah', and, the --port was not passed.  In this case,
	postgresql.conf can't be used.
	* postgresql.init.in (initdb, upgrade): Add --unit option to
	postgresql-setup call.

2015-03-18  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: Fixes for sysvinit

	* README.rpm-dist.template: Mainly automatize generation of the
	help for 'MULTIPLE POSTMASTERS' scenario.  Fix other sysv/systemd
	nuances.
	* TODO: Mention some TODOs.

2015-03-18  Pavel Raiskup  <praiskup@redhat.com>

	bunch of rhel{6,7} & scl fixes

	* postgresql.init.in (initdb, upgrade): Use full path to
	postgresql-setup, this is mostly for proper documentation purposes
	in case of failure.
	* legacy-sysv-script.in: Pass --unit before actual unit name.
	* postgresql-ctl.in: Handle better the $port option passed to
	pg_ctl.
	* postgresql-setup.in: Use full path to postgresql-setup, mostly
	for documentation purposes.
	* README: Add elinks to BuildRequires.

2015-03-18  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-ctl: fix SCLs & SELinux

	* postgresql.init.in: Use 'postgres' binary instead of
	'postmaster', because it has proper selinux context.
	* postgresql.service.in: Use postgresql-ctl everywhere, to make
	sure that correct selinux context is used even with SCL.

2015-03-17  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: better error handling

	Fix the bug in handling with already initialized data directory.

	Now, when doing --upgrade, postgresql-setup does not try to
	re-initialize already initialized PGDATA directory and, after
	"this" unsuccessful initdb, the datadir is not removed.

	* postgresql-setup.in (check_not_initialized): New function.
	(perform_initdb): Simplify return value handling.
	(initdb): Use check_not_initialized function.
	(upgrade): Use check_not_initialized to avoid PGDATA removal.  When
	$cleanup is false, don't remove $PGDATA.

2015-03-17  Pavel Raiskup  <praiskup@redhat.com>

	NEWS: Document recent fixes.

	* NEWS: See $subject.

2015-03-17  Pavel Raiskup  <praiskup@redhat.com>

	sysvinit: transform for SCL & RHEL6 usage

	This is mostly about simplification of intiscript and postgresql-setup
	script reuse.  Still WIP, however (some options are not applicable for
	sysvinit system).

	* share/postgresql-setup/library.sh.in (parse_upgrade_setup): Parse new
	variable "pghost_override".
	(run_cmd_as_dbadmin): New wrapper function to run something under
	"postgres" user.  Cut from postgresql-setup.
	* postgresql-setup.in: Optionally source software collections.  Call new
	check_daemon_reload instead of in-place checking.
	(upgrade): Use new library function run_cmd_as_dbadmin.  Add new hack
	for $PGHOST overriding via $pghost_override.  Add more verbose output to
	make clear what tool failed.
	(check_daemon_reload): New function to make the systemd daemon reload
	conditionally on one dedicated place.
	(handle_envfile): New function to abstract environment file parsing,
	works both for systemd & sysvinit env-files.
	(handle_service_envfiles): Use handle_envfile instead of in-place
	parsing.
	(service_configuration): For sysvinit supported configuration, we
	support only one env file per service - take this into account and don't
	try to detect many from systemctl output.
	* postgresql.init.in: Switch to bash script. Parametrize metadata by
	configure results.  Source software collections when needed.  Source
	project library. Don't set PGDATA if admin uses non-default service
	naem.  Do not define PGPORT as PGPORT should be defined in
	postgresql.conf.  Allow passing parameters into initdb/upgrade targets.
	($PREVMAJORVERSION, $PREVPGENGINE): Remove unused variables.
	($PGENGINE): This is @bindir@ equivalent.
	($PGLOG): Spell it so it will not clash with system default PostgreSQL
	installation.
	($pidfile): Use $NAME instead of $PID to distinguish multiple postmaster
	scenarios (mainly because we do not know the PGPORT yet).
	(start): Drop the checking logic and use postgresql-check-db-dir
	instead.  Reuse run_cmd_as_dbadmin instead of $SU_POSTGRES.
	(stop): Use run_cmd_as_dbadmin instead of $SU_POSTGRES.
	(reload): Just coding style fix.
	(perform_initdb): Drop unused function, done in postgresql-setup.
	(__single_comand): Mostly postgresql-setup wrapper with success/failure
	sugar around the call itself.
	(initdb): Substitute the function body with postgresql-setup call.
	(upgrade): Likewise.
	* postgresql-check-db-dir.in: Fix the hint for admin about where the
	service should be initialized.  Do not warn about systemd-only
	unsupported configuration.  Add @bindir@ into "you need --initdb" hint.
	Re-style the warning a bit.
	* etc/postgresql-setup/upgrade/postgresql.conf: Mention new
	configuration option pghost_override.
	* configure.ac (initscriptsconfdir): New configuration directory.
	(PGMAJORVERSION): Use sed and regexp for MAJOR version mining.  It
	failed for micro versions of length >= 2.
	(SCL_SOURCE): Define to be empty by default.
	* README: Document what's needed to bootstrap from git source.  WIP.
	* Makefile.am (initscripts_DATA): Use noinst_DATA.  Firstly, having
	initscripts_DATA installs only non-executable files.  So we needed
	something with _SCRIPTS primary.  But initscripts_SCRIPTS would face the
	automake's limitation that it must be "static" list of files.  So make
	the installation of initscript (of dynamically generated name) via
	automake's install/uninstall.
	($(initscript)): Use $(INSTANTIATE_SCRIPT) instead of $(INSTANTIATE).
	(install-data-hook): Call 'systemctl daemon-reload' only for
	non-sysvinit systems.
	* .gitignore: Ignore 'initscript' filename.

2015-03-17  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: track also style.dsl

	* style.dsl: Just track forgotten file in vcs.

2015-03-04  Pavel Raiskup  <praiskup@redhat.com>

	configury: detect systemd/sysvinit systems

	Fix the AC_ARG_WITH misuse.  If WANT_SYSVINIT is unset, guess
	correct value.

	Don't treat intermediate files as those to be checked for correct
	syntax errors (or unexpanded @variables@).

	* Makefile.am: Move readme_* intermediate files into separate
	variable.
	* configure.ac: If WANT_SYSVINIT is empty (no explicit request),
	try to detect systemd's presence by checking for systemctl
	command.  Print out after AC_OUTPUT information what init system
	will be used.

2015-03-04  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: use docbook2txt for generation

	The benefit is that sgml format we write does not need to be kept
	formated precisely.  The output format still needs some "style"
	fixes, but now docbook2txt is able to generates correct text-file
	README.rpm-dist without problems on RHEL 5.10+.

	* .gitignore: Added all intermediate files of README file.
	* Makefile.am: Generated README file is firstly filtered through
	$(SED_RULES), then macros are expanded by m4 and then docbook2txt
	is called.
	* README: Document subset of dependencies.
	* README.rpm-dist.in: Move to ...
	* README.rpm-dist.template: ... here, with docbook transformation.
	* TODO: Document we should should work docbook docs.
	* configure.ac: AC_SUBST also WANT_SYSVINIT.

2015-03-02  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: better work with @SCLS@

	* configure.ac (SCL_SOURCE): New variable sourcing needed scls.
	* postgresql-setup.in (initdb): Use @SCL_SOURCE@ instead of
	runtime generated $scls_initdb_hacks.
	(upgrade): Use @SCL_SOURCE@.  For this we don't need to specify
	default "current" SCL when upgrading from other SCL in
	upgrade-configuration 'scls' option.

2015-03-02  Pavel Raiskup  <praiskup@redhat.com>

	configury: better handle paths

	.. to avoid FTBFS with SCLs.  Use pgdocdir rather then docdir
	because the 'docdir' is not set by %configure by default.

	* Makefile.am (pkgname): Drop, not needed.
	(pgdoc_DATA): Use this rather than doc_DATA.
	* configure.ac: Fix pgdocdir.
	(PGDATADIR): Define as subdirectory of localstatedir.

2015-03-02  Pavel Raiskup  <praiskup@redhat.com>

	move library functions into library.sh

	* postgresql-setup.in (die, error, error_q, warn, warn_q, info)
	(info_q, debug, set_var, root_prereq): Move to ..
	* share/postgresql-setup/library.sh.in: .. here.

2015-03-02  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-check-db-dir: match configuration approach

	* configure.ac (PGDATADIR): Use /var/lib/pgsql/data when prefix is
	set to /usr.
	(rawpkgdatadir): New directory.  Its different from pkgdatadir,
	because thats often set to /usr/share/postgresql.
	* Makefile.am: Include new rawpkgdatadir Makefile.inc. Fix
	distcheck by mentioning legacyscripts_SCRIPTS in GENERATED_FILES.
	* postgresql-check-db-dir.in: Use library.sh to give user better
	advice.  Use @NAME_BINARYBASE@ prefix.
	(bad_version): New function.
	(PREVMAJORVERSION): Removed unused variable.
	* postgresql-setup.in: Cut out the config-parsing routines into
	library.sh.
	* share/postgresql-setup/library.sh.in: New library file. Added
	new option 'list' for parse_upgrade_setup.
	* share/postgresql-setup/Makefile.inc: New file.
	* share/postgresql-setup/.gitignore: Ignore library.sh.

2015-02-27  Pavel Raiskup  <praiskup@redhat.com>

	configury: another scl-izing commit

	* Makefile.am: Move systemd directory definitions into
	configure.ac.  This is then easily configurable via config.site.
	* configure.ac (PGENGINE, PG_CTL_BIN): Remove, bindir is
	sufficient.
	(PREVMAJORVERSION, PREVPGENGINE): Removed.  It si configurable
	now.
	(INIDB_SCLS): Generalize into SCLS variable.
	(SCLS): Moved from INIDB_SCLS.
	(PGDATADIR): Default changed to have ${prefix} inside.
	(SED_RULES): Remove unused variables (or to not be
	used, TODO for next commit).
	(conf_dir): New macro to define config.site
	friendly directory variable.
	(SCL_SHELL_WRAPPER): Convenient macro to generate appropriate call
	to scl binary (only when building for software collections).
	* postgresql-check-db-dir.in: Use new variable layout.
	* postgresql-ctl.in: Likewise.
	* postgresql-setup.in: Likewise.
	* postgresql.service.in: Likewise. This fixes regression of not
	using ${bindir} properly.

2015-02-27  Pavel Raiskup  <praiskup@redhat.com>

	configury: add INITDB_SCLS variable

	This brings space separated list of Software Collections to be
	enabled with call to 'initdb' binary.

	* configure.ac (INITDB_SCLS): New variable.
	* postgresql-setup.in ($initdb_scls): New global.
	(perform_initdb): Source appropriate environment based on
	$initdb_scls content.

2015-02-27  Pavel Raiskup  <praiskup@redhat.com>

	configury: add NAME_DEFAULT_PREV_SERVICE variable

	We may want to configure postgresql-setup to upgrade from SCL
	version of PostgreSQL, which needs to read
	'postgresql92-postgresq' service files.  Defaults to 'postgresql'.

	* configure.ac (NAME_DEFAULT_PREV_SERVICE): New configure var.
	* postgresql-setup.in ($option_upgradefrom): Default to
	NAME_DEFAULT_PREV_SERVICE contents.

2015-02-26  Pavel Raiskup  <praiskup@redhat.com>

	configuration: SCL hacks

	Its now configurable what software collections will be enabled for
	pg_upgrade run, in case it is needed (new 'scls' option).
	Similarly, pg_upgrade needs to be told to send
	unix_socket_directories instead of unix_socket_directory to
	PostgreSQL server built for RHEL.

	* etc/postgresql-setup/upgrade/postgresql.conf: Add configuration
	examples for new options.
	* postgresql-setup.in (parse_upgrade_setup): Parse 'scls' and
	'redhat_sockets_hack' options.
	(upgrade): Adjust the environment of 'su - postgres' call to
	pg_upgrade, optionally.

2015-02-26  Pavel Raiskup  <praiskup@redhat.com>

	configuration: define upgrade-config directory

	Currently under /etc/postgresql-setup/upgrade.  All '*.conf' files
	are going to be loaded run-time by postgresql-setup.

	* postgresql-setup.in (read_config_file): New helper to safely
	read configuration files.
	(set_var): Remove comment.
	(parse_upgrade_setup): Use new read_config_file().
	(parse_configuration): Rename to service_configuration().
	* Makefile.am: Don't include share/Makefile.inc.  Indent fixes.
	Add install-data-hook helper to install config directory.
	* build-helpers/Makefile.inc: Removed.
	* build-helpers/build-config: Likewise.
	* upgrade_config.template: Removed.
	* etc/postgresql-setup/upgrade/postgresql.conf: New template.
	* configure.ac: Remove --with-upgrade-config.  Package maintainers
	are supposed to provide those for now.
	* share/postgresql-setup/Makefile.inc: Removed.

2015-02-26  Pavel Raiskup  <praiskup@redhat.com>

	configury: remove DISTSUFF variable completely

	And add NAME_SERVICE, NAME_PACKAGE and NAME_BINARYBASE on its
	place.  This allows packager fine-tune how the files are going to
	be generated.

	* Makefile.am: Better work with variables.
	* .gitignore: Ignore any (generated) service file.
	* configure.ac (DISTSUFF): Remove.
	(NAME_BIN_PFX, NAME_BIN_SFX, NAME_PKG_PFX, NAME_PKG_SFX)
	(NAME_SRV_PFX, NAME_SRV_SFX, NAME_SERVICE, NAME_PACKAGE)
	(NAME_BINARYBASE): New variables
	* doc/.gitignore: Ignore any man(1) page.
	* doc/Makefile.am (HELP2MAN_RUN): Fix the call to work also with
	various prefixes/suffixes.
	* README.rpm-dist.in: Use new variables.
	* legacy-sysv-script.in: Likewise.
	* postgresql-setup.in: Likewise.
	* m4/packaging.m4 (PGSETUP_SUBST_OPT): New macro, defines,
	substitutes and also fixes sed-rules.

2015-02-25  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: multi-upgrade configuration

	Turns out we need to support upgrade from more than one previous
	database versions.  The plan is to make this as general as easily
	possible, "run-time" configurable without need to recompile.

	* postgresql-setup.in: Add options --upgrade-from and
	--upgrade-ids.  Require root access (as late as possible).
	($USAGE_STRING): Adjust help output accordingly.
	($PGMAJORVERSION, $PREVMAJORVERSION)
	($PREVPGENGINE): Remove newly useless globals.
	($option_upgradefrom): New option default.
	(set_var, root_prereq): New helper functions.
	(parse_upgrade_setup): Helper function to parse upgrade
	configuration.
	(print_version): Don't print PREVMAJORVERSION as it is (with
	configuration) useless.
	(upgrade): Create new $inplace local to handle in-place and
	copy-like migrations differently.  Use the variable set generated
	by parse_upgrade_setup() function.  Small err message fixes.
	(handle_service_env, handle_pgconf): Remove the MODE argument.
	(parse_configuration): Generalize operations which needed to be
	done on two places.
	* upgrade_config.template: Example of ./configure time config
	file.  Based on files like this the run-time is generated.
	* share/postgresql-setup/.gitignore: New file.
	* share/postgresql-setup/Makefile.inc: New file.
	* build-helpers/build-config: New file, generator of configuration
	files.
	* build-helpers/Makefile.inc: New file.
	* Makefile.am: Distribute upgrade_config.template.  Start the
	conversion to flat Makefile and include two new Makefile.inc
	snippets.
	* configure.ac: New --with-upgrade-config option.  Propagate the
	rawpkgdatadir and UPGRADE_CONFIG_LIST variables into Makefile.
	(INSTANTIATE): Enhance to create the leading path also.
	(INSTANTIATE_CONV): Convenience helper for leading path of target
	creation.
	* auxdir/install_local: New (just-for-git) installation helper.
	* .gitignore: Don't hide share/postgresql-setup.
	* TODO: Mention that KDE folks would like to migrate somehow.

2015-02-10  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: fix version in --version output

	And better spell errors (to let user know that the initdb_log may
	not exist).

	* postgresql-setup.in (print_version): Use "full" @PGVERSION@ and
	@PREVMAJORVERSION@.X to better describe what the package is
	configured for.
	(initdb): Spell better the failure message.
	* postgresql-setup.in: Use $* instead of $@.

2015-02-10  Pavel Raiskup  <praiskup@redhat.com>

	legacy-scripts: generate them from single template

	As we do not consider the postgresql@ unit variants (that would
	require libexec/initscripts/legacy-actions/postgresql@CONCRETE
	symlink to the default legacy-scripts directory), there is no need
	to do run-time checks.

	* Makefile.am (upgrade): Create from legacy-sysv-script.in
	template.
	(initdb): Likewise.
	(systemdlegacyscripts_DATA): Substitute with ..
	(systemdlegacyscripts_SCRIPTS): .. this to have execute bit after
	installation.
	(GENERATED_FILES): Add _SCRIPTS variant for systemdlegacyscripts.
	* legacy-sysv-script.in: New unified template for legacy scripts.
	* initdb.in: Remove.
	* upgrade.in: Likewise.
	* NEWS: Document.

2015-02-10  Pavel Raiskup  <praiskup@redhat.com>

	configury: ChangeLog relevant to postgresql-setup only

	* Makefile.am: Choose better day for ChangeLog begin.

2015-02-10  Pavel Raiskup  <praiskup@redhat.com>

	postgresql.init: use $README_DIST also

	Issue detected by './configure --with-sysvinit && make check'.

	* postgresql.init.in ($PGDOCDIR): Wipe it out.
	($README_DIST): Use on appropriate places.
	* Makefile.am: Add TODO relevant to this commit.

2015-02-10  Pavel Raiskup  <praiskup@redhat.com>

	configury: use one single variable SU_POSTGRES

	We use 'su' only for 'postgres' user purposes.  So have one,
	configure-time-proven command.  Also, in the previous commit I
	forgot to fix sysvinit file.

	* configure.ac (SU_POSTGRES): New variable.
	* postgresql-setup.in ($SU_POSTGRES): Use detected @SU_POSTGRES@.
	($SU, $SU_L_POSTGRES): Avoid usage of those.
	* postgresql.init.in: Likewise.
	* .gitignore: Remove typoed ignore.

2015-02-10  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: mention login shell explicitly

	The setup script was reported to not work if user 'postgres' has
	/sbin/nologin in /etc/passwd (explicitly set by administrator).
	This configuration does not seem to be terribly useful but there
	is no need to fail at all.

	Resolves: rhbz#1122143

	* postgresql-setup.in ($SU_L_POSTGRES): New wrapping variable,
	using '-s /bin/sh' to bypass /sbin/nologin.  This option should be
	supported both by 'su' and 'runuser'.
	* NEWS: Document.

2015-01-07  Pavel Raiskup  <praiskup@redhat.com>

	configury: fix bad usage of srcdir

	Note: Revealed thanks to automake 1.5 rebase.

	* configure.ac ($c_s): Use top_builddir.
	* tests/Makefile.am (CHECK_DEPS): Use top_builddir.

2015-01-07  Pavel Raiskup  <praiskup@redhat.com>

	configury: don't build ChangeLog outside git

	* Makefile.am (GL_GEN): Test the .git exists and exit if not.

2014-12-18  Pavel Raiskup  <praiskup@redhat.com>

	configury: typo in PG version compare

	* NEWS: Mention previous commit.
	* configure.ac: s/lt/le/.

2014-12-18  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: use --username for pg_upgrade 9.4+

	The --user option still works but we should be rather careful for
	the future.  Master only.

	References:
	http://www.postgresql.org/docs/9.4/static/release-9-4.html

	* configure.ac (AC_INIT): Bump to 3.0~dev version.
	(PG_UPGRADE_BIN_USER_OPT): New variable carrying the right format
	of pg_upgrade's username option.
	* postgresql-setup.in (upgrade): Use @PG_UPGRADE_BIN_USER_OPT@.

2014-12-18  Pavel Raiskup  <praiskup@redhat.com>

	Release 1.0

	* NEWS: Mention legacy scripts.
	* configure.ac (AC_INIT): Remove beta stamp.

2014-12-01  Pavel Raiskup  <praiskup@redhat.com>

	configury: remove redundant nodist_* prefix

	.. from targets which are not distributed anyway.  Thanks jmlich
	to forcing me to catch that mistake.

	* Makefile.am: Remove all nodist_ prefixes.

2014-12-01  Jozef Mlich  <imlich@fit.vutbr.cz>

	systemd: added systemd's legacy scripts

	* Makefile.am: (systemdlegacyscriptsdir)
	(nodist_systemdlegacyscrupts_DATA): New variables.
	(initdb, upgrade): New targets.
	* initdb.in: New legacy script template.
	* upgrade.in: Likewise.
	* .gitignore: Ignore newly generated scripts.

2014-11-15  Jozef Mlich  <imlich@fit.vutbr.cz>

	sysvinit: rhel6 /etc/init.d to /etc/rc.d/init.d

	* Makefile.am: s|init.d|rc.d/init.d|.

2014-11-14  Pavel Raiskup  <praiskup@redhat.com>

	sysvinit: install init script without '.init' suffix

	* Makefile.am: Make the target postgresql, not postgresql.init.

2014-11-13  Jozef Mlích  <jmlich@redhat.com>

	init.d: move init script to sysconfdir

	* Makefile.am: s|$(prefix)/etc/init.d|$(sysconfdir)/init.d|.

2014-10-02  Pavel Raiskup  <praiskup@redhat.com>

	sysvinit: generate init file when needed

	From now, if ./configure --with-sysvinit is done, we install init
	script and do not install systemd files.  Original patch written
	by Jozef Mlích (jmlich@redhat.com).

	* Makefile.am (initscriptsdir, nodist_initscripts_DATA): New
	variables.  New postgresql.init target.
	* configure.ac: Add --with-sysvinit option.
	* postgresql.init.in: New sysvinit template.
	* .gitignore: Mention postgresql.init.
	* NEWS: Document.

2014-10-02  Pavel Raiskup  <praiskup@redhat.com>

	buildsystem: better handle distro-README

	Avoid detecting README.rpm-dist as we generate this file and we
	know the best where the file is.

	* configure.ac: Avoid detecting README path.  Also substitute new
	variable README_DIST_BASENAME.
	* Makefile.am: Use the new $(README_DIST_BASENAME).
	* postgres-check-db-dir.in: Use README_DIST instead of PGDOCDIR.

2014-09-23  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-check-db-dir: fix drop-in directory detection

	Backpatch to REL_001.

	* postgresql-check-db-dir.in: Fix drop-in directory to contain
	the 'service' string.

2014-09-23  Pavel Raiskup  <praiskup@redhat.com>

	tests: add basic bash syntax check

	* tests/testsuite.at: New test.
	* configure.ac (AC_INIT): Bump version.  Use only major-minor
	versions.

2014-09-22  Pavel Raiskup  <praiskup@redhat.com>

	release 1.0.0

	* NEWS: Adjust.
	* configure.ac: Likewise.

2014-09-22  Pavel Raiskup  <praiskup@redhat.com>

	docs: fix typo in postgresql-setup --help

	* postgresql-setup.in (USAGE_STRING): Remove brackets around
	mandatory option argument.

2014-09-22  Pavel Raiskup  <praiskup@redhat.com>

	configury: PREV_POSTGRES_BIN may be unset

	* configure.ac: Postpone PREV_POSTGRES_BIN check after
	the PREVPGENGINE check.

2014-09-19  Pavel Raiskup  <praiskup@redhat.com>

	release 0.9.2

	* configure.ac: Bump version.

2014-09-19  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: document multiple-postmaster howto

	* README.rpm-dist.in: Adjust according to latest changes.

2014-09-19  Pavel Raiskup  <praiskup@redhat.com>

	docs: adjust --help output and warning hints

	* postgresql-check-db-dir.in: Just fix typos.
	* postgresql-setup.in: Reorganize --help.
	* TODO: Adjust after some time.

2014-09-19  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: opt --new-systemd-unit, --datadir

	From now, admin may run single command to instantiate secondary
	PostgreSQL server.

	* postgresql-setup.in: Reorganize a little to avoid processing
	of port, datadir, etc. on different places.  Process new options.
	Also make some warnings more clear.
	* postgresql-setup.in (warn_q, info_q): New echo wrappers.
	(generate_systemd_dropin): New function.
	(USAGE_STRING): Document new options.
	* NEWS: Document changes.

2014-09-18  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: detect systemd's NeedDaemonReload

	Because we rely on parsing of `systemctl show -p` outuput heavily,
	we need to detect whether the service file or some dropin did not
	change (or was not added).  So from now we rather instruct admin
	to do daemon-reload when something changed..

	* postgresql-setup.in: Detect the NeedDaemonReload and warn if
	yes.
	* NEWS: Document.

2014-09-18  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: leftovers, user feeling

	* postgresql-setup.in (USAGE_STRING): Mention --port option.
	(initdb): Mention in info output the non-standard port, when used.
	* postgresql-setup.in: Do not throw the default-port message
	always, remved remaining sysconfig leftover.
	* NEWS: Mention that env files are now supported.

2014-09-18  Pavel Raiskup  <praiskup@redhat.com>

	configure: show the configuration results once done

	* configure.ac: Print the basic info about configured
	postgresql-setup project.

2014-09-18  Pavel Raiskup  <praiskup@redhat.com>

	configury: fix make distcheck errors

	* Makefile.am (EXTRA_DIST): Always use $(srcdir) when referencing
	wildcards.
	(install-data-hook): Return true even for non-root make install.
	(DISTCLEANFILES): Mention ChangeLog.
	* configure.ac (TEST_GEN_FILES_LIST): Only use the basename.
	* tests/Makefile.am (CHECK_DEPS): Fix reference to
	TEST_GEN_FILES_LIST.
	(DISTCLEANFILES): Mention also atconfig and atlocal.
	* tests/testsuite.at: Fix reference to $TEST_GEN_FILES_LIST, use
	always $abs_top_builddir when referencing built files.

2014-09-18  Pavel Raiskup  <praiskup@redhat.com>

	configury: generated ChangeLog by make dist

	Use the gitlog-to-changelog binary, if exists on the system.

	* Makefile.am (dist-hook): Add rules for ChangeLog.
	* ChangeLog: Remove file.
	* .gitignore: Ignore .gitignore.

2014-09-18  Pavel Raiskup  <praiskup@redhat.com>

	configury: some steps making the macros more consistent

2014-09-17  Pavel Raiskup  <praiskup@redhat.com>

	man: generate manual page more carefully

	In general, we do not want to distribute help2man binary (to avoid
	license confusions, etc.).  So if the manual needs to be
	re-generated, try to use help2man on system or keep warning about
	its non-existence.

2014-09-17  Pavel Raiskup  <praiskup@redhat.com>

	testsuite: configury & and add first test-case

	This required little bit of generalization so I moved the SED_CALL
	into configure.ac to have it available for tests/Makefile.am also.
	The first testsuite just checks that no un-expanded @pattern@
	exists in generated files.

2014-09-16  Pavel Raiskup  <praiskup@redhat.com>

	sysconfig: remove remaining files

2014-09-16  Pavel Raiskup  <praiskup@redhat.com>

	NEWS: mention move from /etc/postgresql/* configuration

	(and bump version to 0.9.2~beta)

2014-09-16  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-check-db-dir: migrate from /etc/postgresql/*

	README.rpmd-dist: template fixing

2014-09-16  Pavel Raiskup  <praiskup@redhat.com>

	postgresql.service: un-link with postgresql@.service

	We need to create both files separately as (a) the
	'postgresql.service' can not .include 'postgresql@.service' for
	some reason, /usr/lib/ drop-in breaks things (rhbz#1141824) and
	we want to have PGDATA unset for postgresql@.service, unlike the
	postgresql.service file.

2014-09-16  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: don't expect /etc/postgresql/* exists

	That concept was against systemd intentions.  From now we
	should stop using .include statement in service files and
	encourage people using the systemd's drop-in feature.  That
	complicates things a little, at least until the rhbz#1139148
	is not resolved somehow.

2014-07-04  Pavel Raiskup  <praiskup@redhat.com>

	NEWS: previous commit idea by hhorak, thanks

2014-07-04  Pavel Raiskup  <praiskup@redhat.com>

	service: avoid cryptic failure with old config

	If user removes currently provided /etc/postgresql/postgresql
	configuration file, PGDATA env variable is not set.  The
	`systemctl start postgresql` would fail similarly to
	`systemctl start postgresql@NOTCONFIGURED` when the configuration
	file was not created yet with cryptic message
	    "Usage: ... "

	Stop this behavior rather explicitly with proper error in
	check-db-dir script.

	Warn also user in similar fashion that the configuration should be
	adjusted in case the PGDATA was set directly in service file.

2014-07-03  Pavel Raiskup  <praiskup@redhat.com>

	postgresql@.service: install this via install-data-hook

	.. instead of install-exec-hook, which caused race conditions due
	to parallelized run of make.

2014-07-03  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: trim trailing white-spaces

2014-07-03  Pavel Raiskup  <praiskup@redhat.com>

	README.rpm-dist: document recent changes

	Follow the new processes - different options of postgresql-setup,
	instantiable unit files.  Simplify the documentation thanks to
	the template.

2014-07-03  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: --upgrade std{out,err} adjusted

	Use the echo wrappers also in --upgrade.  Previously, e.g. when
	PGDATA pointed to directory without SELinux label, the output from
	postgresql-setup --upgrade was broken by warnings from restorecon:

	  # postgresql-setup --upgrade --service postgresql@SUFFIX
	  Upgrading database: /sbin/restorecon:  Warning no default label
	  for /tmp/data
	  /sbin/restorecon:  Warning no default label for /tmp/data/pg_log
	  OK

2014-07-03  Pavel Raiskup  <praiskup@redhat.com>

	release: 0.9.1

	Merge changes with ChangeLog & NEWS files.  Bump version.

2014-07-03  Pavel Raiskup  <praiskup@redhat.com>

	upgrade/initdb logs: diverge among service names

	Generate separate log file for each service.  Also, don't
	configure with INITDB_LOG or UPGRADE_LOG but rather with
	POSTGRES_HOME.

2014-07-03  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: expect '--port 5432' implictly

	.. only when '--unit=postgresql'.  When user specifies
	--unit=postgresql@unitname, the --port is still required.

	Also, don't adjust the 'port = ' configuration in postgresql.conf
	when not necessary.

2014-07-02  Pavel Raiskup  <praiskup@redhat.com>

	configure.ac: fix for PG_CTL_BIN & README_DIST

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	postgresql.service.in: use %N, not %p

	The %N expands into postgresql@PATTERN when you run
	systemctl start postgresql@PATTERN.service.  The %p expanded only
	to "postgresql".

	Also make the existance of this file optional by dash-prefixing.

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	configury: install postgresql@.service

	.. as a hardlink to postgresql.service.  This allows us to
	instantiate postgresql@PATTERN units which will be easily
	configurable in /etc/postgresql/postgresql@PATTERN conf file.

	We may install separate service file with '.include' statement but
	that does not seem to be necessary ATM.

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-ctl: use detected PG_CTL_BIN

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-check-db-dir generated also

	Also generate files using sed as is suggested by autoconf manual
	(and the autoconf project does so internally).

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	Makefile.am: more readable file generation

	generate also README.rpm-dist

	Generate postgresql.service and configuration file

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-ctl, DISTSUFF: introduce

	We need postgresql-ctl for to keep backward compatibility with
	clients setting "PGPORT" directly in service file.

	DISTSUFF variable (which is read by ./configure) may be used to
	generated namespaced binary names -- e.g. DISTSUFF=93 results in
	postgresql93-setup is generated instead of postgresql-setup.

	This commit also adjusts autotools build system to not generate
	scripts by ./configure, but rather by make.

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	docs: update option documentation and generate man

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	postgresql-setup: code movement

	This commit just moves the function at the top of
	postgresqk.setup.in file.  Sorry for breaking history a little,
	juse "git blame -C" for analysing.

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	THANKS: adjust Dietmar Kling

	See rhbz#1015431, good idea.

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	configury: make it non-foreign

	This makes us to do some additional documentation, but it should
	not be so hard.

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	configury: prepare for autotools

	postgresql-setup: prepare for sysconfig

2014-07-01  Pavel Raiskup  <praiskup@redhat.com>

	Separate postgresql-setup from postgresql

	From now on, postgresql-setup is developed separately from
	Fedora's PostgreSQL RPM package.
