# $Id: packages,v 1.12 2003/07/28 13:17:51 d3xter Exp $
#
# To build Debian package, please run in a source directory:
#
#   yada rebuild rules
#   debian/rules build
#   debian/rules binary

%define automake_version 1.7

Source: securecgi
Section: web
Priority: extra
Maintainer: Piotr Roszatycki <dexter@debian.org>
Standards-Version: 3.6.10
Description: wrapper for secure executing of CGI programs
Home-Page: <URL:http://securecgi.sourceforge.net/>
Origin: debian
Copyright: GPL
 (c) 2001-2002 Krzysztof Bielawski
 (c) 2001-2003 Piotr Roszatycki
Build-Depends: libcap-dev, automake%{automake_version}, autoconf
Build: sh
 CC=${CC:-gcc}
 CFLAGS="${CFLAGS:--Wall -g -fsigned-char}"
 LDFLAGS=$LDFLAGS
 if [ "${DEB_BUILD_OPTIONS#*noopt}" != "$DEB_BUILD_OPTIONS" ]; then
      CFLAGS="$CFLAGS -O0"
 else
      CFLAGS="$CFLAGS -O2"
 fi
 aclocal-%{automake_version}
 autoheader
 automake-%{automake_version} --add-missing --copy
 autoconf
 CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" ./configure \
     --prefix=/usr --bindir=/usr/lib/cgi-bin --mandir=/usr/share/man
 make
Clean: sh
 make distclean || make clean || true
 for i in $(find -name .cvsignore); do
     ( cd $(dirname $i) && rm -rf $(cat .cvsignore) )
 done

Package: securecgi
Architecture: any
Suggests: apache | httpd
Description: Wrapper for secure executing of CGI programs
 The suid-ed wrapper which executes CGI scripts with owner rights.
 It also modifies resources limits and drops capabilities.
Install: sh
 make install DESTDIR=$ROOT
 yada install -doc -as NEWS.Debian -gzip debian/NEWS
Finalize: sh
 chmod u+s $ROOT/usr/lib/cgi-bin/securecgi
 chmod u+s $ROOT/usr/lib/cgi-bin/nph-securecgi
Overrides: .
 setuid-binary usr/lib/cgi-bin/securecgi 4755 root/root
 setuid-binary usr/lib/cgi-bin/nph-securecgi 4755 root/root
