Package-Name: roxen
Suggests: gmp zlib
Homepage: http://www.roxen.com/
# FIXME: partial version in URL
Source: http://download.roxen.com/3.3//(dl.html\x2Froxen-dist-(\d+(\.\d+)+)(-(\w*))?\.tar\.gz)/[\0-\377]*roxen-dist-(\d+(.\d+)+)(-(\w*))?.tar.gz $1$4
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
	test -d roxen-"$(VERSION)" || mv roxen* roxen-"$(VERSION)"
Compile:
# This prefix is correct--Roxen installs everything into $(prefix)/roxen
	CFLAGS="-O2 $(GCC_OPT_FLAGS)" CXXFLAGS="-O2 $(GCC_OPT_FLAGS)" ./configure --prefix="/pkg"
	$(MAKE)
	$(MAKE) install
Old-Compile:
# FIXME: gcc 3.2 weirdness with /usr/local/include
	mv -f configure configure.old
	sed 's,/usr/local/[^ ]*,,g' <configure.old >configure
	chmod +x configure
	if packager c gmp ; then GMP=--with-gmp ; else GMP=--without-gmp ; fi ; \
	if packager c zlib ; then ZLIB=--with-zlib ; else ZLIB=--without-zlib ; fi ; \
# FIXME: threads test broken with glibc 2.3.1
	$(MAKE) -f ../Makefile configure CONFIGURE_OPTS="--without-threads $$GMP $$ZLIB"
	echo '#undef HAVE_STATVFS' >>pike/0.5/src/modules/files/file_machine.h
	$(MAKE)
	rm -rf "$(PREFIX)"/roxen
	$(MAKE) install
	rm -rf `find "$(PREFIX)" -name .cvsignore -o -name CVS`
	rm -rf "$(PREFIX)"/{bin,server,roxen/{configurations,logs}}
	rm -f "$(PREFIX)"/{configurations,logs}
	if test -d "$(PREFIX)"/local ; then \
		rm -rf "$(PREFIX)"/roxen/local ; \
	fi
	umask 077 ; mkdir -p /etc/roxen
	ln -s /etc/roxen "$(PREFIX)"/configurations
	umask 022 ; mkdir -p /var/log/roxen
	ln -s /var/log/roxen "$(PREFIX)"/logs
	mv -f "$(PREFIX)"/roxen/* "$(PREFIX)"/
	rmdir "$(PREFIX)"/roxen
	ln -s . "$(PREFIX)"/roxen
	strip "$(PREFIX)"/server/bin/{cgi,fcgi,pike}
	ln -fs pike "$(PREFIX)"/server/bin/roxen
Install:
# nothing to do
Old-Patch: <<EOT
--- extern/fast_cgi/libfcgi/fcgi_stdio.c.old	1998-10-22 01:15:09 +0900
+++ extern/fast_cgi/libfcgi/fcgi_stdio.c	2002-11-27 22:44:02 +0900
@@ -40,7 +40,7 @@
 #define TRUE  (1)
 #endif
 
-FCGI_FILE _fcgi_sF[3] = {{stdin, NULL}, {stdout, NULL}, {stderr, NULL}};
+FCGI_FILE _fcgi_sF[3] = {{NULL, NULL}, {NULL, NULL}, {NULL, NULL}};
 
 /*
  *----------------------------------------------------------------------
EOT

-/etc/roxen/
-/pkg/roxen/local/
-/var/log/roxen/
/etc/roxen/
/pkg/roxen/
/var/log/roxen/
