### this file is sourced not run
PKGVER=5.61
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=xlockmore-$PKGVER.tar.xz
MD5SUM=207c092868d4a13e4afe6adecc9dec29
SRC_URL=http://sillycycle.com/xlock/$TARBALL # current version
#SRC_URL=http://sillycycle.com/xlock/recent-releases/$TARBALL # older releases
BUNDLE=

SLACKREQ='libX11' # 
SLACKDESC="xlockmore: xlockmore $PKGVER (Lock desktop)  
xlockmore:  
xlockmore: xlock locks the X server till the user enters their password at the 
xlockmore: keyboard. While xlock is running, all new server connections are 
xlockmore: refused. The screen saver is disabled. The mouse cursor is turned 
xlockmore: off. The screen is blanked and a changing pattern is put on the 
xlockmore: screen. If a key or a mouse button is pressed then the user is 
xlockmore: prompted for the password of the user who started xlock.  
xlockmore: 
xlockmore: 
xlockmore:
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cp tmp/pkg/makekey.c tmp/xlock*
}
### default pkg_package
### build
pkg_build() {
	echo "bin::2:" >> /etc/group # needs bin group
	
	# use dejavu font by default - font, planfont, messagefont, fontset, planfontset
	# from 5.42, xlockmore builds with USE_MB by default, so it requires fontset and plantfontset
	# if this doesn't work, use --disable_mb at configure line, but this may break stuff
	cd /tmp/xlock* &&
	sed -i -e '/^XLock.font:/ s/.*/XLock.font: -misc-dejavu sans mono-medium-r-normal--*-100-*-*-m-*-*-*/' xlock/XLock.ad &&
	sed -i -e '/^XLock.font:/ aXLock.planfont: -misc-dejavu sans mono-medium-r-normal--*-100-*-*-m-*-*-*' xlock/XLock.ad &&
	sed -i -e '/^XLock.messagefont:/ s/.*/XLock.messagefont: -misc-dejavu sans mono-medium-r-normal--*-100-*-*-m-*-*-*/' xlock/XLock.ad &&	
	sed -i -e '/^XLock.planfont:/ aXLock.fontset: -misc-dejavu sans mono-medium-r-normal--*-100-*-*-m-*-*-*' xlock/XLock.ad &&
	sed -i -e '/^XLock.fontset:/ aXLock.planfontset: -misc-dejavu sans mono-medium-r-normal--*-100-*-*-m-*-*-*' xlock/XLock.ad &&
	
	# fix Bomb segfault
	patch -Np1 -i /tmp/pkg/xlockmore-bomb-fix.patch
	
	# make sure we don't link to extra stuff, just the basic stuff
	CONFFLAGS="$CONFFLAGS --enable-xlockrc --enable-vtlock --enable-appdefaultdir=/etc/X11/app-defaults \
	    --enable-def-play=aplay --without-magick --without-gtk2 --without-gtk --enable-syslog"
	pkg_build_autoconf &&

	# build makekey for use with "cpasswd"
	gcc -s -o /usr/bin/makekey makekey.c -lcrypt &&
	
	pkg_build_slackdesc &&	
	rm -f /etc/group
}

<< "EOF"
# ./configure --help
`configure' configures this package to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

X features:
  --x-includes=DIR    X include files are in DIR
  --x-libraries=DIR   X library files are in DIR

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-gtktest       do not try to compile and run a test GTK program
  --enable-bitmapdir=DIR  set directory for bitmaps, default is ./bitmaps
  --enable-bitmaptype=name
                          set name for bitmap type
  --enable-pixmapdir=DIR  set directory for pixmaps, default is ./pixmaps
  --enable-pixmaptype=name
                          set name for pixmap type
  --enable-mapdir=DIR     set directory for bitmaps and pixmaps
  --enable-maptype=name   set name for bitmap and pixmap type
  --enable-def-play=program
                          set def-play to program that plays sounds
  --disable-vroot         disables xlock from being able to run in root window
                          (some window managers have problems)
  --enable-allow-root    allows users to turn on allowroot
  --disable-allow-root    allows users to turn off allowroot (default is to
                          always allow root to be able to unlock xlock)
  --enable-vtlock         allows to turn on VT switch lock (default is to be
                          able to switch to another VT)
  --enable-syslog         enable syslog logging
  --enable-multiple-user  enable multiple users
  --enable-multiple-root  enable multiple root users
  --enable-xlock-group    enable all in xlock group to unlock
  --enable-window-visibility
                          allow a window to be displayed over xlock
  --enable-old-event-loop some machines may still need this
                          (fd_set errors may be a sign)
  --enable-xlockrc        for unknown shadow passwd algorithm
  --enable-auto-logout=time
                          enable auto-logout code for lab use (time in minutes)
  --enable-default-auto-logout=time
                          set default-auto-logout (time in minutes)
  --enable-button-logout=time
                          enable button logout for lab use (time in minutes)
  --enable-default-button-logout=time
                          set default-button-logout (time in minutes)
  --disable-bomb          disable automatic logout mode
  --disable-interactive   disables interactive modes (useful for prod env)
  --enable-unstable       enables unstable (alpha) modes
  --disable-negative-logout
                          allows users to deny logout button and autologout
  --enable-closedown-logout
                          define this one or next, with enable-auto-logout
  --enable-session-logout enable-button-logout, and/or enable-bomb, for xdm
  --enable-staff-file=filename
                          set file of staff who are exempt from auto-logout
  --enable-staff-netgroup=netgroup
                          set netgroup of staff who are exempt from auto-logout
  --enable-kerberos4      enable Kerberos 4
  --enable-kerberos5      enable Kerberos 5
  --enable-write-krb5     write new krb5 credentials to credential cache
  --enable-dce-passwd     enable DCE passwording
  --enable-pam            enable PAM
  --enable-bad-pam        enable BAD_PAM
  --enable-good-pam       enable GOOD_PAM
  --enable-afs            enable AFS
  --enable-sia            enable SIA
  --enable-sunos-adjunct-passwd
                          enable SUNOS Adjunct passwording
  --disable-mb            disable Xmb function series so will only display ASCII
  --enable-customization  enable customization of XResource
  --enable-modules        enable modules (better to use xmkmf for this)
  --enable-blank-only     enable blank mode only (boring)
  --enable-nice-only      enable only low cpu modes
  --enable-check          enable check (experimental)
  --enable-orig-xpm-patch use the original pixmap patch for mail icon
                          (have colormap problems in 8 bits depth visuals)
  --enable-appdefaultdir=DIR
                          set directory installation of appdefaults,
			  default is where X is installed
  --disable-setuid        disables setuid installation if automatically chosen

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-purify           configure to postprocess with purify
  --with-x                use the X Window System
  --with-includes=DIR     search include DIR for optional packages below
  --with-libraries=DIR    search library DIR for optional packages below
  --without-motif         disable Motif (for xmlock)
  --without-editres       disable debugger (for x?lock)
  --without-xpm           disable color pixmap XPM mode(s)
  --without-magick        disable ImageMagick
  --with-magick-config    use this configator for ImageMagick
  --with-magick-prefix    use this prefix for ImageMagick
  --with-magick-includes  use this dir for ImageMagick headers
  --with-magick-libraries use this dir for ImageMagick libs
  --without-gltt          disable GL True Text library
  --without-ttf           disable True Text Font mode(s)
  --without-ftgl          disable GL font rendering library
  --without-freetype      disable Freetype2 mode(s)
  --without-opengl        disable 3D OpenGL (for GL modes)
  --without-mesa          disable Mesa 3D (for GL modes)
  --without-dtsaver       disable -dtsaver option
  --without-ext           disable EXT
  --without-dpms          disable DPMS
  --without-xinerama      disable Xinerama support
  --without-rplay         disable RPLAY sounds
  --with-esound           enable Enlightenment Sound Daemon sounds
  --with-esound-config    use this configator for Enlightenment Sound Daemon
  --with-esound-prefix    use this prefix for Enlightenment Sound Daemon
  --with-esound-includes  use this dir for Enlightenment Sound Daemon headers
  --with-esound-libraries use this dir for Enlightenment Sound Daemon libs
  --without-nas           disable NAS sounds
  --without-crypt         disable CRYPT
  --without-gtk2          disable GTK2 (no xglock build)
  --without-gtk           disable GTK (no xglock build)
  --with-gtk-prefix=DIR   Prefix where GTK is installed (optional)
  --with-gtk-exec-prefix=DIR
                          Exec prefix where GTK is installed (optional)
  --with-krb5-config=PATH Location of krb5-config script
  --with-passwd-helper=/path Use external helper program for authentication
  --with-lang=lang        use a foreign language (nl/fr/de/ja)

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CPP         C preprocessor
  XMKMF       Path to xmkmf, Makefile generator for X Window System

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to the package provider.
EOF
