source: TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/paster_templates/Makefile @ 7847

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/paster_templates/Makefile@7847
Revision 7847, 17.0 KB checked in by pjkersha, 11 years ago (diff)

Incomplete - task 16: NDG Security 2.x.x - incl. updated Paster templates

  • fixes to the ndgsecurity_services template
  • Property svn:keywords set to Id
Line 
1#
2# Makefile to copy ndg.security.test.integration configurations and make them
3# into templates.  This is intended for use preparing a distribution, not
4# for post-installation use.
5#
6# @author P J Kershaw 16/11/10
7#
8# @copyright: (C) 2010 STFC
9#
10# @license: BSD - LICENSE file
11#
12# $Id$
13
14# Settings for all Templates
15ROOT_FILEPATH = ../../../../../
16DEST_DIR = ./
17TEST_DIR = ${ROOT_FILEPATH}ndg_security_test/ndg/security/test/
18TEST_CONFIG_SRC_DIR = ${TEST_DIR}config/
19PKI_SRC_DIR = ${TEST_CONFIG_SRC_DIR}pki/
20CA_SRC_DIR = ${PKI_SRC_DIR}ca/
21SERVER_CERT_SRC_FILEPATH = ${PKI_SRC_DIR}localhost.crt
22SERVER_KEY_SRC_FILEPATH = ${PKI_SRC_DIR}localhost.key
23INTEGRATION_TEST_DIR = ${TEST_DIR}integration/
24
25USERDB_FILENAME = user.db
26USERDB_FILEPATH = ${TEST_CONFIG_SRC_DIR}${USERDB_FILENAME}
27
28# OpenID Provider Specific Settings
29OP_SERVER_YADIS_TMPL_SRC_FILENAME = serveryadis.xml
30OP_YADIS_TMPL_SRC_FILENAME = yadis.xml
31
32
33# Generic Services Template Settings
34SERVICE_SRC_DIRNAME = full_system/
35SERVICE_DEST_DIRNAME = services/
36SERVICE_SRC_DIR = ${INTEGRATION_TEST_DIR}${SERVICE_SRC_DIRNAME}
37SERVICE_DEST_DIR = ${DEST_DIR}${SERVICE_DEST_DIRNAME}
38SERVICE_SRC_INI_FILENAME = securityservices.ini
39SERVICE_SRC_INI_FILEPATH = ${SERVICE_SRC_DIR}${SERVICE_SRC_INI_FILENAME}
40SERVICE_INI_FILEPATH_TMP = ${SERVICE_DEST_DIR}${SERVICE_SRC_INI_FILENAME}
41SERVICE_INI_TMPL_FILEPATH = ${SERVICE_DEST_DIR}service.ini_tmpl
42SERVICE_PKI_DEST_DIR = ${SERVICE_DEST_DIR}pki/
43SERVICE_CA_DEST_DIR = ${SERVICE_PKI_DEST_DIR}ca/
44SERVICE_LOG_DEST_DIR = ${SERVICE_DEST_DIR}log/
45SERVICE_LOG_FILEPATH = ${SERVICE_LOG_DEST_DIR}service.log
46SERVICE_SURPLUS_FILES = README __init__.* attributeinterface.* securedapp.* \
47        request-filter.xml pep_result_handler *.pyc authn/* \
48        openidprovider/associations/  openidprovider/beaker/ \
49        openidprovider/README openidprovider/nonces/ openidprovider/temp/ \
50        openidrelyparty/store/ openidrelyparty/__init__.* \
51        pip-session-cache/* log
52SERVICE_OP_DIRNAME = openidprovider/
53SERVICE_OP_DIR = ${SERVICE_DEST_DIR}${SERVICE_OP_DIRNAME}
54SERVICE_OP_TMPL_DIR = ${SERVICE_OP_DIR}templates/
55SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP = ${SERVICE_OP_TMPL_DIR}serveryadis.xml
56SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH = ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP}_tmpl
57SERVICE_OP_YADIS_TMPL_FILEPATH_TMP = ${SERVICE_OP_TMPL_DIR}yadis.xml
58SERVICE_OP_YADIS_TMPL_FILEPATH = ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP}_tmpl
59
60
61all: service_tmpl securedapp_tmpl authorisation_service_tmpl \
62                attribute_service_tmpl openidprovider_tmpl
63                       
64force: clean all
65
66               
67service_tmpl: ${SERVICE_SRC_DIR}
68        @-echo Preparing Generic Services template ...
69        @-echo
70        @-echo Copying configuration files ...
71        @-cp -r ${SERVICE_SRC_DIR} ${SERVICE_DEST_DIR} 2> /dev/null
72        @-echo Clear out SVN directories ...
73        @-find ${SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
74        @-echo Remove unneeded files ...
75        for i in ${SERVICE_SURPLUS_FILES} ; do \
76                rm -rf ${SERVICE_DEST_DIR}$$i ; \
77        done ;
78        # Make an empty log file so that log directory is included in egg
79        @-echo Make log directory ...
80        mkdir ${SERVICE_DEST_DIR}log
81        touch ${SERVICE_LOG_FILEPATH}
82        @-echo Making substitutions for ini file template variables ...
83        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \
84        -e s/'baseURI =.*'/'baseURI = %%\{baseURI}'/ \
85        -e s/'saml\.soapbinding\.mountPath.*'/'saml.soapbinding.mountPath = %%\{attributeServiceMountPath\}'/ \
86        -e s/'saml\.mountPath.*'/'saml.mountPath = %%\{authorisationServiceMountPath\}'/ \
87        -e s/'saml\.soapbinding\.issuerName =.*'/'saml.soapbinding.issuerName = %%\{attributeServiceIssuerName}'/ \
88        -e s/'saml\.issuerName =.*'/'samlIssuerName = %%\{authorisationServiceIssuerName}'/ \
89        -e s/'saml\.soapbinding\.issuerFormat =.*'/'saml.soapbinding.issuerFormat = %%\{attributeServiceIssuerFormat}'/ \
90        -e s/'saml\.issuerFormat =.*'/'saml.issuerFormat = %%\{authorisationServiceIssuerFormat}'/ \
91        -e s/'authkitCookieSecret =.*'/'authkitCookieSecret = %%\{authkitCookieSecret}'/ \
92        -e s/'beakerSessionCookieSecret =.*'/'beakerSessionCookieSecret = %%\{beakerSessionCookieSecret}'/ \
93        -e s/'authkit.openid.session.secret = .*'/'authkit.openid.session.secret = %%\{openidRelyingPartyCookieSecret}'/ \
94        -e s/'testConfigDir = .*'// \
95        -e s/testConfigDir/here/g \
96        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\'/ \
97        -e s/'# Revision:.*'//g \
98                ${SERVICE_INI_FILEPATH_TMP} > ${SERVICE_INI_TMPL_FILEPATH}
99        rm -f ${SERVICE_INI_FILEPATH_TMP}
100        @-echo Making substitutions for OpenID Provider Yadis templates ...
101        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<\/Service>'/d \
102        -e s/'<\/XRD>'/'    %%\{serveryadisExtraServiceEndpoints}\n    <\/XRD>'/ \
103                ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > \
104                ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH}
105        rm -f ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP}
106        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<\/Service>'/d \
107        -e s/'<\/XRD>'/'    %%\{yadisExtraServiceEndpoints}\n    <\/XRD>'/ \
108                ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP} > ${SERVICE_OP_YADIS_TMPL_FILEPATH}
109        rm -f ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP}
110        @-echo
111        @-echo Create PKI directory and copying files ...
112        -mkdir ${SERVICE_PKI_DEST_DIR}
113        cp ${SERVER_CERT_SRC_FILEPATH} ${SERVICE_PKI_DEST_DIR}
114        cp ${SERVER_KEY_SRC_FILEPATH} ${SERVICE_PKI_DEST_DIR}
115        -mkdir ${SERVICE_CA_DEST_DIR}
116        cp ${CA_SRC_DIR}* ${SERVICE_CA_DEST_DIR}
117        @-echo Copying test SQLite user database ...
118        cp ${USERDB_FILEPATH} ${SERVICE_DEST_DIR}
119        @-echo
120        @-echo Done.
121       
122service_tmpl_clean:
123        @-echo Clearing Services template ...
124        rm -rf ${SERVICE_DEST_DIR}
125
126
127# Secured Application Template Settings
128SECUREDAPP_SRC_DIRNAME = full_system/
129SECUREDAPP_DEST_DIRNAME = securedapp/
130SECUREDAPP_SRC_DIR = ${INTEGRATION_TEST_DIR}${SECUREDAPP_SRC_DIRNAME}
131SECUREDAPP_DEST_DIR = ${DEST_DIR}${SECUREDAPP_DEST_DIRNAME}
132SECUREDAPP_SRC_INI_FILENAME = securedapp.ini
133SECUREDAPP_SRC_INI_FILEPATH = ${SECUREDAPP_SRC_DIR}${SECUREDAPP_SRC_INI_FILENAME}
134SECUREDAPP_INI_FILEPATH_TMP = ${SECUREDAPP_DEST_DIR}${SECUREDAPP_SRC_INI_FILENAME}
135SECUREDAPP_INI_TMPL_FILEPATH = ${SECUREDAPP_DEST_DIR}service.ini_tmpl
136SECUREDAPP_PKI_DEST_DIR = ${SECUREDAPP_DEST_DIR}pki/
137SECUREDAPP_CA_DEST_DIR = ${SECUREDAPP_PKI_DEST_DIR}ca/
138SECUREDAPP_LOG_DEST_DIR = ${SECUREDAPP_DEST_DIR}log/
139SECUREDAPP_LOG_FILEPATH = ${SECUREDAPP_LOG_DEST_DIR}service.log
140SECUREDAPP_SURPLUS_FILES = README __init__.* attributeinterface.* \
141        securityservices*.* *.pyc authn/* openidprovider/ openidrelyparty/store/ \
142        openidrelyparty/__init__.* pip-session-cache/ log/ policy.xml \
143        pip-mapping.txt request-filter.xml
144SECUREDAPP_REQUEST_FILTER_FILENAME = request-filter.xml
145SECUREDAPP_REQUEST_FILTER_TMPL_FILENAME = ${SECUREDAPP_REQUEST_FILTER_FILENAME}_tmpl
146SECUREDAPP_REQUEST_FILTER_FILEPATH = ${SECUREDAPP_SRC_DIR}${SECUREDAPP_REQUEST_FILTER_FILENAME}
147SECUREDAPP_REQUEST_FILTER_TMPL_FILEPATH = ${SECUREDAPP_DEST_DIR}${SECUREDAPP_REQUEST_FILTER_TMPL_FILENAME}
148       
149securedapp_tmpl: ${SECUREDAPP_SRC_DIR}
150        @-echo Preparing Secured Application template ...
151        @-echo
152        @-echo Copying configuration files ...
153        @-cp -r ${SECUREDAPP_SRC_DIR} ${SECUREDAPP_DEST_DIR} 2> /dev/null
154        @-echo Clear out SVN directories ...
155        @-find ${SECUREDAPP_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
156        @-echo Remove unneeded files ...
157        for i in ${SECUREDAPP_SURPLUS_FILES} ; do \
158                rm -rf ${SECUREDAPP_DEST_DIR}$$i ; \
159        done ;
160        # Make an empty log file so that log directory is included in egg
161        @-echo Make log directory ...
162        mkdir ${SECUREDAPP_LOG_DEST_DIR}
163        touch ${SECUREDAPP_LOG_FILEPATH}
164        @-echo Making substitutions for ini file template variables ...
165        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \
166        -e s/'baseURI = .*'/'baseURI = %%\{baseURI}'/ \
167        -e s/'# Revision:.*'//g \
168        -e s/'authN.redirectURI = .*'/'authN.redirectURI = %%{authnRedirectURI}'/ \
169        -e s/'resultHandler.heading = .*'/'resultHandler.heading = %%{accessDeniedPageHeading}'/ \
170        -e s/'pep.authzServiceURI = .*'/'pep.authzServiceURI = %%{authzServiceURI}'/ \
171    -e s/'pep\.authzDecisionQuery\.issuerName = .*'/'pep\.authzDecisionQuery\.issuerName = %%\{authzDecisionQueryIssuerName}'/ \
172    -e s/'pep\.authzDecisionQuery\.issuerFormat = .*'/'pep\.authzDecisionQuery\.issuerFormat = %%\{authzDecisionQueryIssuerFormat}'/ \
173        -e s/'authkit\.cookie\.secret =.*'/'authkit\.cookie\.secret = %%\{authkitCookieSecret}'/ \
174        -e s/'beaker\.session\.secret =.*'/'beaker\.session\.secret = %%\{beakerSessionCookieSecret}'/ \
175        -e s/'authkit.openid.session.secret = .*'/'authkit.openid.session.secret = %%\{openidRelyingPartyCookieSecret}'/ \
176        -e s/'testConfigDir = .*'// \
177        -e s/testConfigDir/here/g \
178        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\'/ \
179                ${SECUREDAPP_INI_FILEPATH_TMP} > ${SECUREDAPP_INI_TMPL_FILEPATH}
180        rm -f ${SECUREDAPP_INI_FILEPATH_TMP}
181        @-echo "Make template for ${SECUREDAPP_REQUEST_FILTER_FILENAME} ..."
182        sed -r -e s/'http:\/\/localhost:7080\/'/'%%\{baseURI}'/ \
183                ${SECUREDAPP_REQUEST_FILTER_FILEPATH} > ${SECUREDAPP_REQUEST_FILTER_TMPL_FILEPATH}
184        @-echo
185        @-echo Create PKI directory and copying files ...
186        -mkdir ${SECUREDAPP_PKI_DEST_DIR}
187        cp ${SERVER_CERT_SRC_FILEPATH} ${SECUREDAPP_PKI_DEST_DIR}
188        cp ${SERVER_KEY_SRC_FILEPATH} ${SECUREDAPP_PKI_DEST_DIR}
189        -mkdir ${SECUREDAPP_CA_DEST_DIR}
190        cp ${CA_SRC_DIR}* ${SECUREDAPP_CA_DEST_DIR}
191        @-echo
192        @-echo Done.
193       
194securedapp_tmpl_clean:
195        @-echo Clearing Secured App template ...
196        rm -rf ${SECUREDAPP_DEST_DIR}
197
198# Authorisation Service Template Settings
199AUTHZ_SERVICE_DIRNAME = authorisationservice/
200AUTHZ_SERVICE_SRC_DIR = ${TEST_CONFIG_SRC_DIR}${AUTHZ_SERVICE_DIRNAME}
201AUTHZ_SERVICE_DEST_DIR = ${DEST_DIR}${AUTHZ_SERVICE_DIRNAME}
202AUTHZ_SERVICE_INI_FILENAME = authorisation-service.ini
203AUTHZ_SERVICE_INI_FILEPATH_TMP = ${AUTHZ_SERVICE_DEST_DIR}${AUTHZ_SERVICE_INI_FILENAME}
204AUTHZ_SERVICE_INI_TMPL_FILEPATH = ${AUTHZ_SERVICE_INI_FILEPATH_TMP}_tmpl
205AUTHZ_SERVICE_FILES = ${AUTHZ_SERVICE_INI_FILENAME} pip-mapping.txt policy.xml \
206        public authorisationserviceapp.py
207AUTHZ_SERVICE_PKI_DEST_DIR = ${AUTHZ_SERVICE_DEST_DIR}pki/
208AUTHZ_SERVICE_CA_DEST_DIR = ${AUTHZ_SERVICE_PKI_DEST_DIR}ca/
209AUTHZ_SERVICE_LOG_DEST_DIR = ${AUTHZ_SERVICE_DEST_DIR}log/
210AUTHZ_SERVICE_LOG_FILEPATH = ${AUTHZ_SERVICE_LOG_DEST_DIR}service.log
211
212
213authorisation_service_tmpl:
214        @-echo Preparing Authorisation Service template ...
215        @-echo
216        @-echo Copying test ini file and other configuration files ...
217        mkdir ${AUTHZ_SERVICE_DEST_DIR}
218        for i in ${AUTHZ_SERVICE_FILES}; do \
219                cp -r ${AUTHZ_SERVICE_SRC_DIR}$$i ${AUTHZ_SERVICE_DEST_DIR} ; \
220        done ;
221        @-echo Making substitutions for template variables ...
222        sed -e s/'# Description:.*'/'# Description: Paster ini file for SAML\/XACML based Authorisation Service'/ \
223        -e s/'saml\.mountPath.*'/'saml.mountPath = %%\{mountPath\}'/ \
224        -e s/'samlIssuerName =.*'/'samlIssuerName = %%\{issuerName}'/ \
225        -e s/'samlIssuerFormat =.*'/'samlIssuerFormat = %%\{issuerFormat}'/ \
226        -e s/'testConfigDir = .*'// \
227        -e s/testConfigDir/here/g \
228        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\',\ \'log\'/ \
229        ${AUTHZ_SERVICE_INI_FILEPATH_TMP} > ${AUTHZ_SERVICE_INI_TMPL_FILEPATH}
230        rm -f ${AUTHZ_SERVICE_INI_FILEPATH_TMP}
231        @-echo
232        # Make an empty log file so that log directory is included in egg
233        @-echo Make log directory ...
234        mkdir ${AUTHZ_SERVICE_DEST_DIR}log
235        touch ${AUTHZ_SERVICE_LOG_FILEPATH}
236        @-echo Create PKI directory and copying files ...
237        mkdir -p ${AUTHZ_SERVICE_CA_DEST_DIR}
238        cp ${SERVER_CERT_SRC_FILEPATH} ${AUTHZ_SERVICE_PKI_DEST_DIR}
239        cp ${SERVER_KEY_SRC_FILEPATH} ${AUTHZ_SERVICE_PKI_DEST_DIR}
240        cp ${CA_SRC_DIR}* ${AUTHZ_SERVICE_CA_DEST_DIR}
241        @-echo Clear out SVN directories ...
242        @-find ${AUTHZ_SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
243        @-echo
244        @-echo Done.
245       
246authorisation_service_tmpl_clean:
247        @-echo Clearing Authorisation Service template ...
248        rm -rf ${AUTHZ_SERVICE_DEST_DIR}
249
250
251# Attribute Service Template
252ATTR_SERVICE_DIRNAME = attributeservice/
253ATTR_SERVICE_SRC_DIR = ${TEST_CONFIG_SRC_DIR}attributeauthority/sitea/
254ATTR_SERVICE_DEST_DIR = ${DEST_DIR}${ATTR_SERVICE_DIRNAME}
255ATTR_SERVICE_INI_FILENAME = attribute-service.ini
256ATTR_SERVICE_INI_FILEPATH_TMP = ${ATTR_SERVICE_DEST_DIR}${ATTR_SERVICE_INI_FILENAME}
257ATTR_SERVICE_INI_TMPL_FILEPATH = ${ATTR_SERVICE_INI_FILEPATH_TMP}_tmpl
258ATTR_SERVICE_FILES = ${ATTR_SERVICE_INI_FILENAME} public attributeauthorityapp.py
259ATTR_SERVICE_STATIC_CONTENT_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}public/
260ATTR_SERVICE_PKI_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}pki/
261ATTR_SERVICE_CA_DEST_DIR = ${ATTR_SERVICE_PKI_DEST_DIR}ca/
262ATTR_SERVICE_LOG_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}log/
263ATTR_SERVICE_LOG_FILEPATH = ${ATTR_SERVICE_LOG_DEST_DIR}service.log
264
265
266attribute_service_tmpl:
267        @-echo Preparing Attribute Service template ...
268        @-echo
269        -mkdir ${ATTR_SERVICE_DEST_DIR}
270        @-echo Copying content directories and files ...
271        for i in ${ATTR_SERVICE_FILES}; do \
272                cp -r ${ATTR_SERVICE_SRC_DIR}$$i ${ATTR_SERVICE_DEST_DIR} ; \
273        done ;
274        @-echo Making substitutions for template variables ...
275        sed -e s/'# Description:.*'/'# Description: Paster ini file for SAML Attribute Service'/ \
276        -e s/'dbConnectionString = .*'/'dbConnectionString = sqlite:\/\/\/%(here)s\/user.db'/ \
277        -e s/'port = .*'/'port = %%\{portNumber}'/ \
278        -e s/'saml\.soapbinding\.mountPath.*'/'saml.soapbinding.mountPath = %%\{mountPath\}'/ \
279        -e s/'saml\.soapbinding\.issuerName.*'/'saml.soapbinding.issuerName = %%\{issuerName}'/ \
280        -e s/'saml\.soapbinding\.issuerFormat.*'/'saml\.soapbinding\.issuerFormat = %%\{issuerFormat}'/ \
281        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\',\ \'log\'/ \
282        ${ATTR_SERVICE_INI_FILEPATH_TMP} > ${ATTR_SERVICE_INI_TMPL_FILEPATH}
283        rm -f ${ATTR_SERVICE_INI_FILEPATH_TMP}
284        @-echo
285        @-echo Create PKI directory and copying files ...
286        -mkdir ${ATTR_SERVICE_PKI_DEST_DIR}
287        cp ${SERVER_CERT_SRC_FILEPATH} ${ATTR_SERVICE_PKI_DEST_DIR}
288        cp ${SERVER_KEY_SRC_FILEPATH} ${ATTR_SERVICE_PKI_DEST_DIR}
289        -mkdir ${ATTR_SERVICE_CA_DEST_DIR}
290        cp ${CA_SRC_DIR}* ${ATTR_SERVICE_CA_DEST_DIR}
291        # Make an empty log file so that log directory is included in egg
292        @-echo Make log directory ...
293        mkdir ${ATTR_SERVICE_DEST_DIR}log
294        touch ${ATTR_SERVICE_LOG_FILEPATH}
295        @-echo Copying test SQLite user database ...
296        cp ${USERDB_FILEPATH} ${ATTR_SERVICE_DEST_DIR}
297        @-echo Clear out SVN directories ...
298        @-find ${ATTR_SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
299        @-echo
300        @-echo Done.
301       
302attribute_service_tmpl_clean:
303        @-echo Clearing Attribute Service template ...
304        rm -rf ${ATTR_SERVICE_DEST_DIR}
305       
306
307# Settings to create OpenID Provider template
308OP_DIRNAME = openidprovider/
309OP_SRC_DIR = ${INTEGRATION_TEST_DIR}${OP_DIRNAME}
310OP_DEST_DIR = ${DEST_DIR}${OP_DIRNAME}
311OP_INI_FILENAME = service.ini
312OP_INI_FILEPATH_TMP = ${OP_DEST_DIR}openidprovider.ini
313OP_INI_TMPL_FILEPATH = ${OP_DEST_DIR}${OP_INI_FILENAME}_tmpl
314OP_PKI_DEST_DIR = ${OP_DEST_DIR}pki/
315OP_CA_DEST_DIR = ${OP_PKI_DEST_DIR}ca/
316OP_CONFIG_FILES = templates openidprovider.ini public
317OP_TMPL_DIR = ${OP_DEST_DIR}templates/
318OP_SERVER_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}serveryadis.xml
319OP_SERVER_YADIS_TMPL_FILEPATH = ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP}_tmpl
320OP_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}yadis.xml
321OP_YADIS_TMPL_FILEPATH = ${OP_YADIS_TMPL_FILEPATH_TMP}_tmpl
322OP_LOG_DEST_DIR = ${OP_DEST_DIR}log/
323OP_LOG_FILEPATH = ${OP_LOG_DEST_DIR}service.log
324
325
326openidprovider_tmpl:
327        @-echo Preparing OpenID Provider template ...
328        @-echo
329        @-echo Copying templates, CSS and graphics and ini file ...
330        mkdir ${OP_DEST_DIR}
331        mkdir ${OP_LOG_DEST_DIR}
332        touch ${OP_LOG_FILEPATH}
333        @-echo Copying files ...
334        for i in ${OP_CONFIG_FILES} ; do \
335                cp -r ${OP_SRC_DIR}$$i ${OP_DEST_DIR}; \
336        done ;
337        @-echo Making substitutions for template variables ...
338        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \
339        -e s/'baseURI =.*'/'baseURI = %%\{baseURI}'/ \
340        -e s/'testConfigDir = %(here)s\/\.\.\/\.\.\/config'// \
341        -e s/testConfigDir/here/g \
342        -e s/'# Revision:.*'// \
343        -e s/'beaker.session.secret =.*'/'beaker.session.secret = %%\{beakerSessionCookieSecret}'/ \
344        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\'/ \
345        ${OP_INI_FILEPATH_TMP} > ${OP_INI_TMPL_FILEPATH}
346        rm -f ${OP_INI_FILEPATH_TMP}
347        @-echo Making substitutions for Yadis templates ...
348        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<\/Service>'/d \
349        -e s/'<\/XRD>'/'    %%\{serveryadisExtraServiceEndpoints}\n    <\/XRD>'/ \
350                ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > ${OP_SERVER_YADIS_TMPL_FILEPATH}
351        rm -f ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP}
352        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<\/Service>'/d \
353        -e s/'<\/XRD>'/'    %%\{yadisExtraServiceEndpoints}\n    <\/XRD>'/ \
354                ${OP_YADIS_TMPL_FILEPATH_TMP} > ${OP_YADIS_TMPL_FILEPATH}
355        rm -f ${OP_YADIS_TMPL_FILEPATH_TMP}
356        @-echo
357        @-echo
358        @-echo Copying test SQLite user database ...
359        cp ${USERDB_FILEPATH} ${OP_DEST_DIR}
360        @-echo
361        @-echo Create PKI directory and copying files ...
362        -mkdir ${OP_PKI_DEST_DIR}
363        cp ${SERVER_CERT_SRC_FILEPATH} ${OP_PKI_DEST_DIR}
364        cp ${SERVER_KEY_SRC_FILEPATH} ${OP_PKI_DEST_DIR}
365        -mkdir ${OP_CA_DEST_DIR}
366        cp ${CA_SRC_DIR}* ${OP_CA_DEST_DIR}
367        @-echo Clear out SVN directories ...
368        @-find ${OP_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
369        @-echo
370        @-echo Done.
371       
372openidprovider_tmpl_clean:
373        @-echo Clearing OpenID Provider template ...
374        rm -rf ${OP_DEST_DIR}
375
376       
377clean: service_tmpl_clean securedapp_tmpl_clean \
378                authorisation_service_tmpl_clean \
379                attribute_service_tmpl_clean openidprovider_tmpl_clean
380
Note: See TracBrowser for help on using the repository browser.