~beaky/wacs/wacs-php

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
# RPM Spec File for Wacs PHP 1.0.1
# NB: this version may not work with selinux enabled (yet)
%define name wacs-php
%define metaname wacs
%define version 1.0.1
%define majorversion 1.0
%define pkgrelease 3

# user name definitions (used in pre section)
%{!?wacs_user:%define wacs_user wacs}
%{!?wacs_group:%define wacs_group wacs}
%{!?http_user:%define http_user apache}

# work out the distro name, karch and type
%define distid %(lsb_release -si | sed 's/\ /_/g')
%define distrel %(lsb_release -sr)
%define procarch %(uname -m)

# work out the extension (Fedora & CentOS only at present)
%define DISTTAG %([ %distid == CentOS ] && echo "centos" || echo "fc" )
%define VER %{distrel}

Summary: WACS Adult Web Site Toolkit - PHP5 API Library
Name: %{name}
Version: %{version}
Release: %{pkgrelease}.%{DISTTAG}%{VER}
Source: %{name}-%{version}-%{pkgrelease}.tar.gz
License: GPLv3, BSD
URL: http://wacsip.sourceforge.net
Group: Applications/Publishing
BuildRoot: %{_tmppath}/%{metaname}-%{version}-%{release}-root
Requires: php >= 5
Requires: wacs-core >= %{majorversion}
Requires: js-jquery
Buildarch: noarch
Vendor: The WACS Development Team

%description 
WACS is a tool for building Adult Web Sites; equally suitable for managing
a private collection or building a commercial site. It has many best of
breed features including dynamic filtering, model catalogs, automatic
download and powerful search engine.

This package provides an extensive PHP5 implementation of the WACS API to
allow the WACS system to be used from PHP-based web pages in addition to
perl-based cgi-bin programs.  It also includes a pair of demonstration Web
2.0 AJAX applications using jQuery called modelsel.php and setsel.php.

%prep
%setup -n %{name}-%{version}

%install
rm -rf %{buildroot}

# script files
install -d $RPM_BUILD_ROOT%{_datadir}/pear
install -m 0750 modules/wacs.php $RPM_BUILD_ROOT%{_datadir}/pear
install -m 0750 modules/wacsui.php $RPM_BUILD_ROOT%{_datadir}/pear
install -m 0750 modules/XMLSimple.php $RPM_BUILD_ROOT%{_datadir}/pear
# install modelsel and setsel applications
install -m 0770 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html
install -m 0660 apps/modelsel*.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html
install -m 0660 apps/setsel*.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html
# xajax support files for Web2.0 applications
# in Wacs-PHP 0.9.2, xajax is depricated and no longer used - the apps that 
# used it have been re-written to use jQuery.
# directories
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/tests
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_js
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/plugin_layer
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/plugin_layer/support
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/request
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/comet
install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/swfupload
# files (NOTE: this do not contain sensitive content - they're an AJAX library
# 1. examples
# not included in xajax-0.6beta
# 2. tests
install -m 0644 support/xajax-0.6/tests/*.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/tests
install -m 0644 support/xajax-0.6/tests/*.log $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/tests
install -m 0644 support/xajax-0.6/tests/*.js $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/tests
install -m 0644 support/xajax-0.6/copyright.inc.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6
# 3. xajax_controls
# not included in xajax_0.6beta
# 4. xajax_core
install -m 0644 support/xajax-0.6/xajax_core/*.inc.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core
install -m 0644 support/xajax-0.6/xajax_core/plugin_layer/*.inc.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/plugin_layer
install -m 0644 support/xajax-0.6/xajax_core/plugin_layer/support/*.inc.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/plugin_layer/support
# 5. xajax_js
install -m 0644 support/xajax-0.6/xajax_js/*.js $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_js
# 6. xajax_plugins
install -m 0644 support/xajax-0.6/xajax_plugins/response/*.inc.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response
install -m 0644 support/xajax-0.6/xajax_plugins/response/comet/*.inc.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/comet
install -m 0644 support/xajax-0.6/xajax_plugins/response/swfupload/*.inc.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/swfupload
install -m 0644 support/xajax-0.6/xajax_plugins/response/*.js $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response
install -m 0644 support/xajax-0.6/xajax_plugins/response/comet/*.js $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/comet
install -m 0644 support/xajax-0.6/xajax_plugins/response/swfupload/*.js $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/swfupload
install -m 0644 support/xajax-0.6/xajax_plugins/response/swfupload/*.swf $RPM_BUILD_ROOT%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/swfupload
# end of XAJAX support library
# samples
install -m 0770 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/samples/php
install -m 0770 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/samples/php/others
install -m 0770 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/samples/php/progguide
install -m 0770 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/samples/php/xajax
install -m 0660 samples/others/* $RPM_BUILD_ROOT%{_datadir}/%{metaname}/samples/php/others
install -m 0660 samples/progguide/* $RPM_BUILD_ROOT%{_datadir}/%{metaname}/samples/php/progguide
install -m 0660 samples/xajax/* $RPM_BUILD_ROOT%{_datadir}/%{metaname}/samples/php/xajax
# docs, etc
install -m 0640 README $RPM_BUILD_ROOT%{_datadir}/%{metaname}/README.php
install -m 0640 samples/xajax/README $RPM_BUILD_ROOT%{_datadir}/%{metaname}/samples/php/xajax/README
# simple skins
install -m 0770 -d $RPM_BUILD_ROOT%{_sysconfdir}/%{metaname}.d/
install -m 0770 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/simple
install -m 0770 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/simple/images
install -m 0770 -d $RPM_BUILD_ROOT%{_datadir}/%{metaname}/simple/styles
install -m 0660 skins/simple/*.php $RPM_BUILD_ROOT%{_datadir}/%{metaname}/simple
install -m 0660 skins/simple/styles/simple.css $RPM_BUILD_ROOT%{_datadir}/%{metaname}/simple/styles
install -m 0660 skins/simple/simple.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{metaname}.d/
install -m 0640 skins/README $RPM_BUILD_ROOT%{_datadir}/%{metaname}/README.skins
# make the simple directory appear at the top level
install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
install -m 0660 skins/simple.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d

%pre
getent group %wacs_group >/dev/null || groupadd -r %wacs_group
getent passwd %wacs_user >/dev/null || \
        useradd -m -g %wacs_group -r -c "WACS Files Owner" -s /bin/bash \
        %wacs_user >/dev/null 2>&1 || :
usermod -a -G %wacs_group %http_user >/dev/null 2>&1 || :

%post
# create a symlink so we expose the jquery library we have
ln -s /usr/share/javascript/ /var/www/html/.sysassets

%files
%defattr(0750,wacs,wacs)
# modules
%{_datadir}/pear/wacs.php
%{_datadir}/pear/wacsui.php
%{_datadir}/pear/XMLSimple.php
# applications
%defattr(0660,wacs,wacs)
%{_datadir}/%{metaname}/html/modelsel*.php
%{_datadir}/%{metaname}/html/setsel*.php
# samples
%defattr(2770,wacs,wacs)
%dir %{_datadir}/%{metaname}/samples
%dir %{_datadir}/%{metaname}/samples/php
%dir %{_datadir}/%{metaname}/samples/php/others
%dir %{_datadir}/%{metaname}/samples/php/progguide
%defattr(0770,wacs,wacs)
%{_datadir}/%{metaname}/samples/php/others/*.php
%{_datadir}/%{metaname}/samples/php/progguide/*.php
# docs
%defattr(0660,wacs,wacs)
%{_datadir}/%{metaname}/README.php

%package xajax-legacy
Summary: WACS Adult Web Site Toolkit - PHP API - Legacy XAJAX library
Group: Applications/Publishing
Requires: wacs-php

%description -n wacs-php-xajax-legacy
Wacs-PHP provides an Application Programming Interface (API) for use from
the PHP language favoured by many web developers.  Earlier versions of this
package included sample programs that implemented Dynamic Web Content 
using the XAJAX library - those applications have been re-writen to use the
popular jQuery platform instead, meaning the XAJAX library is no longer 
required by Wacs-PHP itself.  We are providing this library as an optional
package to allow developers using XAJAX to continue to use their existing
apps but we do encourage them to re-write those to use jQuery instead.

%post -n wacs-php-xajax-legacy

%files -n wacs-php-xajax-legacy
# xajax support code (DEPRICATED - use jQuery instead)
%defattr(2755,wacs,wacs)
%dir %{_datadir}/%{metaname}/html/xajax-0.6
%dir %{_datadir}/%{metaname}/html/xajax-0.6/tests
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_core
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/plugin_layer
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/plugin_layer/support
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_js
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/request
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/comet
%dir %{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/swfupload
%defattr(0770,wacs,wacs)
%{_datadir}/%{metaname}/html/xajax-0.6/copyright.inc.php
%{_datadir}/%{metaname}/html/xajax-0.6/tests/*.php
%{_datadir}/%{metaname}/html/xajax-0.6/tests/*.js
%{_datadir}/%{metaname}/html/xajax-0.6/tests/*.log
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/*.inc.php
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/plugin_layer/*.inc.php
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_core/plugin_layer/support/*.inc.php
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_js/*.js
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/*.inc.php
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/comet/*.inc.php
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/swfupload/*.inc.php
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/*.js
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/comet/*.js
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/swfupload/*.js
%{_datadir}/%{metaname}/html/xajax-0.6/xajax_plugins/response/swfupload/*.swf
# samples
%defattr(2770,wacs,wacs)
%dir %{_datadir}/%{metaname}/samples/php/xajax
%defattr(0770,wacs,wacs)
%{_datadir}/%{metaname}/samples/php/xajax/*.php
%defattr(0660,wacs,wacs)
%{_datadir}/%{metaname}/samples/php/xajax/README

%package skins-simple
Summary: WACS Adult Web Site Toolkit - PHP API - Sample Simple Web Site
Group: Applications/Publishing
Requires: wacs-core
Requires: wacs-php

%description -n wacs-php-skins-simple
Wacs-PHP provides an Application Programming Interface (API) for use from 
the PHP language favoured by many web developers.  This package contains
a small and fairly simplistic web site implemented using that API as both
a technology demonstrator and as a starting point for developers to quickly
get their WACS-based site up and running.  Requires wacs-php and wacs-core
for configuration files, icons and backend tools.

%post -n wacs-php-skins-simple

# reload the httpd configuration
service httpd reload

%files -n wacs-php-skins-simple
%defattr(2770,wacs,wacs)
%dir %{_datadir}/%{metaname}/simple
%dir %{_datadir}/%{metaname}/simple/images
%dir %{_datadir}/%{metaname}/simple/styles

%defattr(0660,wacs,wacs)
%config(noreplace) %{_sysconfdir}/%{metaname}.d/simple.cfg
%config(noreplace) %{_sysconfdir}/httpd/conf.d/simple.conf
%{_datadir}/%{metaname}/simple/*.php
%{_datadir}/%{metaname}/simple/styles/*.css

%defattr(0640,wacs,wacs)
%{_datadir}/%{metaname}/README.skins

%changelog
* Thu Jun 25 2020 beaky <wacs@beaky.name>
- dropped requirement for DB module as we now use the PDO extension
- new versions of just about everything as we now use PDO

* Tue Sep 26 2017 beaky <wacs@beaky.name>
- brought in the jqueryurl configuration variable
- created a new wacs-php-xajax-legacy package to contain the XAJAX stuff no
  longer actually required by wacs-php.

* Fri Aug 18 2017 beaky <wacs@beaky.name>
- finally packaging up the re-written apps which now use jQuery instead of
  XAJAX - the xajax libraries are now depricated and are supplied to support
  legacy code.

* Sat Jun  8 2013 Beaky <wacs@beaky.name>
- release candidate 3 while we try to sort out pathing problems in Ubuntu

* Fri May 31 2013 Beaky <wacs@beaky.name>
- revised for wacs 0.9.1 release
- now looks for a tarball named for the release as well as version when
  building
- commented out ownership of /usr/share/wacs/html to avoid ownership conflict

* Wed Sep 28 2011 Beaky <wacs@beaky.name>
- revised for Wacs-PHP 0.8.6 release
- includes much revised dynamic selector app

* Tue Mar 22 2011 Beaky <wacs@beaky.name>
- added xajax-0.6 for PHP 5.3.x compatibility

* Mon Aug 24 2009 Beaky <wacs@beaky.name>
- revised for Wacs-PHP 0.8.4 release
- added xajax sample code directory and scripts
- added xajax standard support code

* Fri May  8 2009 Beaky <wacs@beaky.name>
- revised for Wacs-PHP 0.8.3 release
- added README.skins to the package

* Sun Nov 23 2008 Beaky <wacs@beaky.name>
- added new section to make a seperate package of the Simple skin
- added httpd reload to make it pick up the configuration change

* Mon Aug 25 2008 Beaky <wacs@beaky.name>
- added wacs user account creation pre section to ensure ownerships are correct
- added placeholders so the directories have ownerships and setgid settings

* Thu Aug 21 2008 Beaky <wacs@beaky.name>
- fixed up the standard versus metaname issues

* Wed Aug 20 2008 Beaky <wacs@beaky.name>
- initial version of the spec file created