File: www-sql.spec

package info (click to toggle)
www-sql 0.5.0-5
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 624 kB
  • ctags: 759
  • sloc: ansic: 6,004; lex: 171; sh: 152; yacc: 151; makefile: 111; sql: 41
file content (59 lines) | stat: -rw-r--r-- 1,574 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Name: www-sql
Version: 0.5.0
Release: 1
Group: Applications/Databases
Summary: www-sql allows commands to be embedded in html to allow reports
Copyright: GPL
Source: ftp://ftp.daa.com.au/pub/james/www-sql/www-sql-0.5.0.tar.gz
Requires: apache

%description
www-sql is a small scripting language that allows you to embed commands in
HTML documents that are evaluated when the page is accessed (via the www-sql
CGI program), allowing information from a database to be inserted into the
document.  The program is also flexible enough to allow the insertion of new
data and updating of current data in the tables.

The idea is similar to PHP, but www-sql is easier to learn, and easier to
set up.

%prep
%setup

# guess what database system is in use ...
if which mysql > /dev/null; then
  TARGET=mysql
elif which psql > /dev/null; then
  TARGET=pgsql
else
  TARGET=mysql
fi
CFLAGS="$RPM_OPT_FLAGS" YACC=yacc ./configure --with-database="$TARGET" --enable-apache-action-check

%build
make

%install
make install CGI_DIR=/home/httpd/cgi-bin

%post
if grep 'Action www-sql' /etc/httpd/conf/srm.conf>/dev/null; then
  :
else
  echo 'Creating association between .sql files and www-sql...'
  echo 'Action www-sql /cgi-bin/www-sql' >> /etc/httpd/conf/srm.conf
  echo 'AddHandler www-sql sql' >> /etc/httpd/conf/srm.conf
  echo 'Restarting apache...'
  /etc/rc.d/init.d/httpd.init stop ; /etc/rc.d/init.d/httpd.init start
fi
echo "Consider creating a user nobody for your databases"

%files
/home/httpd/cgi-bin/www-sql
%doc example.sql
%doc COPYING Changelog README www-sql.html