# postgresql/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. If the Linux account "postgres" and/or group "postgres" don't exist prior to a build of this package, the build will create either or both as necessary. If the "postgres" account is created, the account password will be set to a unique and non-recoverable string. This is O.K. as login to the account by password isn't needed. #--------------------------------------------------------------------- [buildtimes] 00.04 hours (or 002.48 minutes) - HP EliteBook 8560w 32GB RAM 00.05 hours (or 002.78 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM 00.06 hours (or 003.75 minutes) - ThinkPad E540 i7 4x2 16GB RAM 00.07 hours (or 004.23 minutes) - Dell Inspiron 6400 2.0 GHz Intel Duo 7200 2GB RAM 00.08 hours (or 005.10 minutes) - ThinkPad W530 i7 4x2 32GB RAM 00.09 hours (or 005.62 minutes) - 2022 OpenVZ 4GB RAM 1x4 CPU 00.33 hours (or 019.70 minutes) - Compaq 1.7 GHz Intel Pentium 4 512MB RAM #--------------------------------------------------------------------- [settings] altpkg = yes exepack = yes fortran = disabled license = See "license*.txt" in installed tree licfile = COPYRIGHT nls = disabled tmpsize = 188M setpath = e2fsprogs libxml2 #--------------------------------------------------------------------- [depends] actools bison3 e2fsprogs flex gawk grep libxml2 libxslt ncurses openssl perl prexwin readline sed tcltk # May not be used zlib #--------------------------------------------------------------------- [configure] killall -qw --signal SIGTERM postmaster || true DATADIR=/var/lib/postgresql/14/main if [ -d $DATADIR ]; then cat << END Error: PostgreSQL data directory already exists: $DATADIR The PostgreSQL package build procedure will delete the data directory. If you know what you're doing, stop the PostgreSQL service, move the directory somewhere else, build the package, stop the service again, and restore a copy of the directory. It may be safer to export all databases and to import them after the build. If the software is updated as well as rebuilt, the new release may not be backwards-compatible with existing formats. END exit 1 fi #--------------------------------------------------------------------- MANBASE=$PKGDIR_PROD/man mkdir -p $MANBASE APASS=`od -Anone /dev/random | head -1 | sed -e 's/ //g'` USER=postgres mkdir -p /home/jail if test -z "`grep "^$USER:" /etc/group`" ; then groupadd $USER fi if test -z "`grep "^$USER:" /etc/passwd`" ; then useradd $USER -g $USER -d /home/jail \ -s /bin/bash -p $APASS fi sed -e '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' \ -i src/include/pg_config_manual.h bash ./configure \ --prefix=$PKGDIR_PROD \ --build=$LACARCHBUILD \ --host=$LACARCHHOST \ --disable-debug \ --disable-nls \ --disable-profiling \ --enable-thread-safety \ --mandir=$MANBASE \ --with-uuid=e2fs \ --with-openssl #--------------------------------------------------------------------- [build] smpmake smpmake install #--------------------------------------------------------------------- [postbuild] echo postbuild started HERE=`pwd` BINDIR=$PKGDIR_PROD/bin DATADIR=/var/lib/postgresql/14/main DOCDIR=$PKGDIR_PROD/doc SBINDIR=$PKGDIR_PROD/sbin mkdir -p $BINDIR $DATADIR $DOCDIR $SBINDIR chown -R postgres.postgres $PKGDIR_PROD/ $DATADIR/ echo Running PostgreSQL initdb PATH=$BINDIR:$PATH chmod 700 $DATADIR X=$PKGDIR_PROD chown -R postgres.postgres $X $DATADIR su postgres -c "PATH=$X/bin:$PATH initdb -D $DATADIR" cd $HERE/contrib for dir in adminpack citext pg_trgm uuid-ossp do cd $dir make && make install cd .. done echo Misc. adjustments rm -fr $DOCDIR/html echo Creating postgresql-start cd $SBINDIR sed -e "s|__META_DATADIR__|$DATADIR|g" \ -e "s|__META_LACUTIL__|$SYSDIR_LACUTIL|g" \ -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \ -e "s|__META_PRODTREE__|$PRODTREE|g" \ < $PKGDIR_SPECIAL/postgresql-start.in \ > postgresql-start chmod 755 postgresql-start #--------------------------------------------------------------------- [setup.boot] APASS=`od -Anone /dev/random | head -1 | sed -e 's/ //g'` mkdir -p /home/jail if test -z "`grep '^postgres:' /etc/group`" ; then groupadd postgres fi if test -z "`grep '^postgres:' /etc/passwd`" ; then useradd postgres -g postgres -d /home/jail \ -s /bin/bash -p $APASS fi P=postgresql for DATADIR in \ /run/$P \ /var/cache/$P \ /var/log/$P \ /var/run/$P do mkdir -p $DATADIR chown -R postgres.postgres $DATADIR done sed -e 's/^\(dynamic_shared_memory_type\) =.*/\1 = mmap/' \ -i /var/lib/postgresql/14/main/postgresql.conf $PRODTREE/postgresql/sbin/postgresql-start #--------------------------------------------------------------------- # Original URLs. These URLs were valid at one point, but may have died # since then. If you download newer versions of tarballs [etc.], don't # delete the original versions, as you may not be able to replace # them. [urls] url_debian = tbd url_home = http://www.postgresql.org/ url_lfs = n/a url_tarball = https://ftp.postgresql.org/pub/source/\ v14.13/postgresql-14.13.tar.bz2 #--------------------------------------------------------------------- [history] 170517 Updated from 9.4.5 to 9.6.3 171021 Updated to 10.0 180312 Updated to 10.2 180323 Updated to 10.3 180511 Updated to 10.4 180814 Updated to 10.5 181026 Updated to 11.0 181112 Updated to 11.1 190218 Updated to 11.2 190512 Updated to 11.3 191004 Updated to 11.5 210530 Updated to 11.9 211019 Updated to 11.13 211212 Updated to 11.14 220913 Updated to 11.17 240704 Updated to 14.12 241110 Updated to 14.13