File: adacgi.spec

package info (click to toggle)
adacgi 1.6-32
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 372 kB
  • sloc: ada: 1,683; sh: 84; makefile: 64
file content (441 lines) | stat: -rw-r--r-- 15,843 bytes parent folder | download | duplicates (11)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# Copyright (C) 1999, 2000
# by Juergen Pfeifer <juergen@gnuada.org>
# Ada for Linux Team (ALT)
#
# Permission is hereby granted, free of charge, to any person obtaining a  
# copy of this software and associated documentation files (the            
# "Software"), to deal in the Software without restriction, including      
# without limitation the rights to use, copy, modify, merge, publish,      
# distribute, distribute with modifications, sublicense, and/or sell       
# copies of the Software, and to permit persons to whom the Software is    
# furnished to do so, subject to the following conditions:                 
#                                                                          
# The above copyright notice and this permission notice shall be included  
# in all copies or substantial portions of the Software.                   
#                                                                          
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   
# IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    
# THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               
#                                                                          
# Except as contained in this notice, the name(s) of the above copyright   
# holders shall not be used in advertising or otherwise to promote the     
# sale, use or other dealings in this Software without prior written       
# authorization.          
#
# ---------------------------------------------------------------------------
# Author: Juergen Pfeifer <juergen@gnuada.org>
# ---------------------------------------------------------------------------
# GNU Ada RPM Packaging for David Wheelers CGI package
#
# This specification file is generated using a m4 based macrosystem.
# Please don't change it directly but get instead the macro system
# and change the input files of this system. 
# ---------------------------------------------------------------------------
#
%define        PKG_TARGET_OS       Linux
%define        TARGET_OS           linux
%define        TARGET_ARCH         i386
%define        COMPAT_TARGET_ARCH  i386 i486 i586 i686
%define        DEF_USER            bin
%define        DEF_GROUP           bin
%define        CFG_PREFIX          /usr
#
%define        AUTHOR_NAME         Juergen Pfeifer
%define        AUTHOR_MAIL	   juergen.pfeifer@gmx.net
#
%define        GNAT_BASE_VERSION   3.12
%define        GNAT_PKG_VERSION    3.12p
%define        GNAT_PKG_RELEASE    10
%define        GCC_VERSION         2.8.1
%define        GDB_VERSION         4.17
%define        GLIBC_VERSION	   2.1
%define        GNAT_VERSION        3.12p
%define        BASE_VERSION        gcc-%{GCC_VERSION}
#
%define        BASE_NAME           gnat
%define        GNAT_PKG_NAME       gnat
%define        GNATRT_PKG_NAME     gnat-3.12p-runtime
%define        GNATRT_PKG_VERSION  1
#
%define        ADA_ROOT            /lib/ada
%define        ADA_BASE            %{CFG_PREFIX}%{ADA_ROOT}
%define        SHARE_BASE	   /share/ada
%define        ADA_SHARE           %{CFG_PREFIX}%{SHARE_BASE}
#
%define        HTML_BASE	   %{SHARE_BASE}/html
%define        ADA_HTML	           %{CFG_PREFIX}%{HTML_BASE}
#
%define        GNAT_SO_MAJOR       1
%define        GNAT_SO_MINOR       %{GNAT_PKG_RELEASE}
#
%define        RPM_C_FLAGS         -O3 -m486
%define        RPM_ADA_FLAGS       -gnatpn
#
%define        THREADLIBS          -lpthread
#
%define        DOC_BASE            %{CFG_PREFIX}/doc
#
%define        GNAT_ALIAS          %{BASE_NAME}
%define        GNAT_NAME           %{GNAT_ALIAS}-%{GNAT_VERSION}
%define        GNAT_SO             %{GNAT_NAME}
#
%define        GNARL_ALIAS         gnarl
%define        GNARL_NAME          %{GNARL_ALIAS}-%{GNAT_VERSION}
%define        GNARL_SO            %{GNARL_NAME}
#
%define        AINC_NAME           adainclude
%define        AINC_DIR            %{ADA_BASE}/%{AINC_NAME}
#
%define        ALIB_NAME           adalib
%define        ALIB_DIR            %{ADA_BASE}/%{ALIB_NAME}
#
%define        ETC_NAME            etc
%define        ETC_DIR             %{ADA_BASE}/%{ETC_NAME}
%define        EMACS_DIR           %{ADA_ROOT}/%{ETC_NAME}/adamode
%define        ADAMODE_DIR         %{CFG_PREFIX}%{EMACS_DIR}
%define        INFO_NAME           %{ADA_ROOT}/info
%define        INFO_DIR            %{CFG_PREFIX}%{INFO_NAME}
#
%define        ASIS_ALIAS          asis
%define        ASIS_NAME           %{ASIS_ALIAS}-%{GNAT_VERSION}
%define        ASIS_SO             %{ASIS_NAME}
%define        ASIS_DIR            %{ADA_BASE}/%{ASIS_NAME}
#
%define        GLADE_ALIAS         garlic
%define        GLADE_NAME          garlic-%{GNAT_VERSION}
%define        GLADE_SO            garlic-%{GNAT_VERSION}
%define        GLADE_DIR           %{ADA_BASE}/%{GLADE_NAME}
#
%define        FLORIST_ALIAS       florist
%define        FLORIST_NAME        %{FLORIST_ALIAS}-%{GNAT_VERSION}
%define        FLORIST_SO          %{FLORIST_NAME}
#
%define        GNAT_GCC            gnatgcc
#
%define PKG_NAME    adacgi
%define PKG_VERSION 1.6
%define PKG_RELEASE 1
# 
# If there is a runtime package, it has this name
%define PKGRT_NAME  adacgi-runtime
#
# Name of development package in the old scheme
%define OLD_DEVPKG_NAME adacgi-devel-3.12p
%define OLD_RTNAME      adacgi-3.12p
#
# ---------------------------------------------------------------------------
# We restrict the use of this package script at the moment to Intel and
# Linux. For sure there are details (compiler options, shared library
# building) that must be fixed for other architectures and OSes.
#
ExclusiveArch: %{COMPAT_TARGET_ARCH}
ExclusiveOS:   %{PKG_TARGET_OS}
Vendor:        Ada for Linux Team (ALT)
Packager:      Juergen Pfeifer
Distribution:  ALT (Ada for Linux Team)
Version:       %{PKG_VERSION}
Release:       %{PKG_RELEASE}
Name:          %{PKG_NAME}
BuildRoot:     %{_builddir}/%{PKG_NAME}_glibc%{GLIBC_VERSION}-%{version}-root
Autoreq:       No
Autoreqprov:   No
# ---------------------------------------------------------------------------
#
# This are the official sources
Source0:       http://www.dwheeler.com/adacgi/latest/adacgi-%{version}.tar.gz
#
#  ---------------------------------------------------------------------------
Copyright:     GPL (modified for runtime)
URL:           http://www.dwheeler.com
Summary:       Ada95 CGI Programming Interface
Summary(de):   Ada95 Interface fu%r CGI Programmierung
Group:         Libraries
Requires:      %{GNAT_PKG_NAME} = %{GNAT_PKG_VERSION}
Provides:      %{name}
Obsoletes:     %{name}
Conflicts:     %{name}-%{GNAT_VERSION}
Prefix:        %{CFG_PREFIX}
# I don't have this icon:
# Icon:          adasmall.gif
#
%description
This is David A. Wheeler's package for implementing web programs in Ada95.
This is an Ada95 binding to CGI (the Common Gateway Interface), a common
interface between web servers and specialized web server applications.
You only need to install this package if you're compiling Ada95 programs
which use this binding.
%description -l de
Dies ist David A. Wheeler's Paket fu%r die Implementierung von Web Programmen
in Ada95. Es ist ein Ada95 Binding fu%r CGI (das Common Gateway Interface),
eine allgemeine Schnittstelle zwischen Web-Servern und Web-Server Anwendungen.
Sie brauchen dieses Paket nur zu installieren wenn Sie Ada95 Programme schreiben
wollen, die dieses Binding benutzen.
#
#-----------------------------------------------------------------------------
%prep
#=============================================================================
#
%setup
#
#-----------------------------------------------------------------------------
%build
#=============================================================================
#
# Get the name of the Operating System in lower case
OS=%{TARGET_OS}
#
PATH=/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
if [ "${GNAT_ROOT}" != "" ]; then
   PATH="${GNAT_ROOT}/bin:${PATH}"
fi
export PATH
#
%define ALT_BUILD_DOC  $RPM_BUILD_ROOT/doc
%define ALT_BUILD_HTML $RPM_BUILD_ROOT%{ADA_HTML}
#
# Create the required directory structure for the binary package
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{CFG_PREFIX}/info
mkdir -p $RPM_BUILD_ROOT%{CFG_PREFIX}/bin
mkdir -p $RPM_BUILD_ROOT%{CFG_PREFIX}/lib
mkdir -p $RPM_BUILD_ROOT%{CFG_PREFIX}/doc
mkdir -p $RPM_BUILD_ROOT%{AINC_DIR}
mkdir -p $RPM_BUILD_ROOT%{ALIB_DIR}
mkdir -p $RPM_BUILD_ROOT%{GLADE_DIR}
mkdir -p $RPM_BUILD_ROOT%{ASIS_DIR}
mkdir -p $RPM_BUILD_ROOT%{ETC_DIR}
mkdir -p $RPM_BUILD_ROOT%{INFO_DIR}
mkdir -p $RPM_BUILD_ROOT%{ADA_SHARE}
mkdir -p %{ALT_BUILD_DOC}
mkdir -p %{ALT_BUILD_HTML}
#
mkdir -p %{ALT_BUILD_DOC}/sample
mkdir -p %{ALT_BUILD_HTML}/adacgi
#
%{GNAT_GCC} -c  %{RPM_C_FLAGS} %{RPM_ADA_FLAGS} cgi.adb
#
#-----------------------------------------------------------------------------
%install
#=============================================================================
OS=%{TARGET_OS}
#
#
cp -pf cgi.ad?     $RPM_BUILD_ROOT%{AINC_DIR}
cp -pf cgi.ali     $RPM_BUILD_ROOT%{ALIB_DIR}
cp -pf cgi.o       $RPM_BUILD_ROOT%{ALIB_DIR}
rm -f  cgi.ad?
#
cp -pf  README      %{ALT_BUILD_DOC}/
cp -pf  COPYING     %{ALT_BUILD_DOC}/
cp -pf  *.txt       %{ALT_BUILD_DOC}/
cp -pf  cgi.html    %{ALT_BUILD_DOC}/
cp -pf  cgi.html    %{ALT_BUILD_HTML}/cgi-doc.html
cp -pf  *.ad?       %{ALT_BUILD_DOC}/sample    
cp -pf  makefile    %{ALT_BUILD_DOC}/sample    
cp -pf  screen.html %{ALT_BUILD_DOC}/sample    
rm -f   %{ALT_BUILD_DOC}/sample/cgi.ad?
#
pushd $RPM_BUILD_ROOT%{AINC_DIR}
${GNAT_ROOT:-/usr}/bin/gnathtml -I../%{ALIB_NAME} \
  -o%{ALT_BUILD_HTML}/adacgi *.ad[bs]
popd
#
if [ -d ${RPM_BUILD_ROOT}%{AINC_DIR} ]; then
  find ${RPM_BUILD_ROOT}%{AINC_DIR} -type f -name '*.ad?' -exec chmod 0444 {} \;
fi
if [ -d ${RPM_BUILD_ROOT}%{ALIB_DIR} ]; then
  find ${RPM_BUILD_ROOT}%{ALIB_DIR} -type f -name '*.ali' -exec chmod 0444 {} \;
  find ${RPM_BUILD_ROOT}%{ALIB_DIR} -type f -name '*.o'   -exec chmod 0444 {} \;
  find ${RPM_BUILD_ROOT}%{ALIB_DIR} -type f -name '*.a'   -exec chmod 0444 {} \;
fi
if [ -d ${RPM_BUILD_ROOT}%{CFG_PREFIX}/lib ]; then
  find ${RPM_BUILD_ROOT}%{CFG_PREFIX}/lib -type f -name '*.so*' -exec chmod 0755 {} \;
fi
if [ -d ${RPM_BUILD_ROOT}/doc ]; then
  find ${RPM_BUILD_ROOT}/doc -type f -exec chmod 0444 {} \;
  find ${RPM_BUILD_ROOT}/doc -type d -exec chmod 0755 {} \;
fi
#  ---------------------------------------------------------------------------
%pre
if [ -f /etc/profile.d/%{BASE_NAME}-rts.sh ]; then
  source /etc/profile.d/%{BASE_NAME}-rts.sh
  if [ ! -z ${GNAT_ROOT} ]; then
    if [ "${GNAT_ROOT}" != "${RPM_INSTALL_PREFIX}" ]; then
      echo "%{BASE_NAME} was installed with --prefix=${GNAT_ROOT}" >&2
      echo "You must use the same prefix with this package." >&2
      exit 1
    fi
  else
    if [ "${RPM_INSTALL_PREFIX}" != "%{CFG_PREFIX}" ]; then
      echo "%{BASE_NAME} was installed without the --prefix option." >&2
      echo "You must do this also with this package." >&2
      exit 1
    fi
  fi
fi
#  ---------------------------------------------------------------------------
%post
etc_prof="/etc/profile.d"
ETC_DIR="${RPM_INSTALL_PREFIX}%{ADA_ROOT}/%{ETC_NAME}"
#
htmldir=${RPM_INSTALL_PREFIX}/share/ada/html
pkgfile=${htmldir}/packages

html_insert() {
  mkdir -p ${htmldir} 2>/dev/null
  if [ -f $pkgfile ]; then
    awk -F, '{printf "%s,\n",$1;}' < $pkgfile | grep -q "$1,"
    if [ $? -eq 0 ]; then
       sed -e "/^$1,/d" < $pkgfile >${pkgfile}.tmp
       mv -f ${pkgfile}.tmp ${pkgfile}
    fi
  fi
  echo "$1,$2,$3" >> $pkgfile
}

html_remove() {
   sed -e "/^$1,/d" < ${pkgfile} > ${pkgfile}.tmp
   mv -f ${pkgfile}.tmp ${pkgfile}
}

html_generate() {
  insmarker="<!--PACKAGES-->"
  indexfile=${htmldir}/index.html
  touch ${pkgfile}.in
  if [ -f ${pkgfile} ]; then
    awk -F, '{printf "<li><a href=\"%s\" TARGET=\"%s\">%s</a></li>\n",$2,$1,$3;}' < ${pkgfile} > ${pkgfile}.in
  fi
  if [ -f ${indexfile}.in ]; then
    cat > ${pkgfile}.sed <<EOF
/^${insmarker}/r ${pkgfile}.in
/^${insmarker}/d
EOF
    sed -f ${pkgfile}.sed < ${indexfile}.in > ${indexfile}
    rm -f ${pkgfile}.sed
  fi
  rm -f ${pkgfile}.in
}
html_insert "adacgi"  "cgi-doc.html"     "CGI Binding Documentation"
html_insert "adacgi2" "adacgi/index.htm" "CGI Binding Packages"
html_generate
#  ---------------------------------------------------------------------------
%postun
etc_prof="/etc/profile.d"
ETC_DIR="${RPM_INSTALL_PREFIX}%{ADA_ROOT}/%{ETC_NAME}"
#
htmldir=${RPM_INSTALL_PREFIX}/share/ada/html
pkgfile=${htmldir}/packages

html_insert() {
  mkdir -p ${htmldir} 2>/dev/null
  if [ -f $pkgfile ]; then
    awk -F, '{printf "%s,\n",$1;}' < $pkgfile | grep -q "$1,"
    if [ $? -eq 0 ]; then
       sed -e "/^$1,/d" < $pkgfile >${pkgfile}.tmp
       mv -f ${pkgfile}.tmp ${pkgfile}
    fi
  fi
  echo "$1,$2,$3" >> $pkgfile
}

html_remove() {
   sed -e "/^$1,/d" < ${pkgfile} > ${pkgfile}.tmp
   mv -f ${pkgfile}.tmp ${pkgfile}
}

html_generate() {
  insmarker="<!--PACKAGES-->"
  indexfile=${htmldir}/index.html
  touch ${pkgfile}.in
  if [ -f ${pkgfile} ]; then
    awk -F, '{printf "<li><a href=\"%s\" TARGET=\"%s\">%s</a></li>\n",$2,$1,$3;}' < ${pkgfile} > ${pkgfile}.in
  fi
  if [ -f ${indexfile}.in ]; then
    cat > ${pkgfile}.sed <<EOF
/^${insmarker}/r ${pkgfile}.in
/^${insmarker}/d
EOF
    sed -f ${pkgfile}.sed < ${indexfile}.in > ${indexfile}
    rm -f ${pkgfile}.sed
  fi
  rm -f ${pkgfile}.in
}
html_remove adacgi
html_remove adacgi2
html_generate
#  ---------------------------------------------------------------------------
%files
%defattr(-,%{DEF_USER},%{DEF_GROUP})
%doc %{ALT_BUILD_DOC}/*
%dir %{CFG_PREFIX}
%dir %{ADA_BASE}
%dir %{AINC_DIR}
%dir %{ALIB_DIR}
%dir %{ADA_HTML}
%dir %{ADA_HTML}/adacgi
%{AINC_DIR}/*
%{ALIB_DIR}/*
%{ADA_HTML}/*.html
%{ADA_HTML}/adacgi/*
#
#  ---------------------------------------------------------------------------
%clean
rm -rf $RPM_BUILD_ROOT
#  ---------------------------------------------------------------------------

rm -rf $RPM_BUILD_DIR/adacgi
#
%changelog
* Wed Nov 1 2000 David A. Wheeler <dwheeler@dwheeler.com>
- Released version 1.6.

* Tue Mar 14 2000 Juergen Pfeifer <juergen@gnuada.org>
- Published as Release 1 of Version 1.5

* Wed Mar 01 2000 Juergen Pfeifer <juergen@gnuada.org>
- Fixed documentation generation in spec file

* Sun Feb 27 2000 Juergen Pfeifer <juergen@gnuada.org>
- Published as Release 6

* Wed Feb 23 2000 Juergen Pfeifer <juergen@gnuada.org>
- Grand package renaming

* Mon Jan 03 2000 Juergen Pfeifer <juergen@gnuada.org>
- Published as Release 5

* Wed Dec 29 1999 Juergen Pfeifer <juergen@gnuada.org>
- Inlined HTML generation into the installation scripts to eliminate
  installation order dependencies.
  
* Mon Nov 15 1999 Juergen Pfeifer <juergen@gnuada.org>
- Published as Release 4

* Sun Nov 07 1999 Juergen Pfeifer <juergen@gnuada.org>
- Added gnathtml generated package docu
- Integrate AdaCGI HTML page into overall HTML docu. 

* Sun Oct 31 1999 Juergen Pfeifer <juergen@gnuada.org>
- Fixed build architecture handling
- Published as Release 3

* Fri Oct 29 1999 Juergen Pfeifer <juergen@gnuada.org>
- Published as Release 2 (3.12p based)

* Tue Sep 14 1999 David A. Wheeler <dwheeler@dwheeler.com>
- Updated to adacgi 1.4:
  + merged in Juergen Pfeifer's patch,
  + added cookie support
  + Expanded documentation
  + License change to be LGPL-like

* Wed Mar 31 1999 Juergen Pfeifer <juergen@gnuada.org>
- Changed description
- Published as Release 1

* Wed Mar 10 1999 Juergen Pfeifer <juergen@gnuada.org>
- Created