source: spec/trunk/SPECS/bww-resources-rpm/macros.bww@ 1235

Last change on this file since 1235 was 1235, checked in by herwigb, 8 years ago

spec: bww-resources-rpm: Release version 1.1.0-1.

File size: 7.0 KB
Line 
1#
2# Macros for bitwiseworks default WPS object structure
3#
4# Reserved WPS ID's in this macro
5# - README
6# - LICENSE
7# - COPYRIGHT
8# - DOCDIR
9# - FOLDER
10# - APP
11#
12#
13# bww_folder creates:
14# the bww help center as WP_BWWHELP wps id in WP_ASSISTANCE
15# a shadow of the /@unixroot/usr/share/doc dir as WP_BWWDOC in the bww help center (WP_BWWHELP)
16# the bww apps folder as WP_BWWAPPS in WP_PROGRAMSFOLDER
17# a shadow of the bww help center as WP_BWWHELPSHADOW in the bww apps folder (WP_BWWAPPS)
18# a folder for the installed app
19#
20# the first 4 WPS objects are usually only updated and the referenc counter in wps_create is adjusted
21# it is necessary that every app creates the bww_folder first, as else the counters are wrong
22#
23# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24# !!!!!! be aware that the -V option (if used) is not the last option. !!!!!!
25# !!!!!! as else the complete object is not generated. !!!!!!
26# !!!!!! this looks like a rpm issue !!!!!!
27# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28#
29# %bww_folder -t TITLE [-V] [-n PAGKAGE]
30# -t TITLE (Mandatory: use TITLE as the folder title)
31# (TITLE *must* be a %global macro if with spaces)
32# -n PACKAGE (when provided: associate the folder with PACKAGE, else with %{name})
33# -V (when provided: don't add the version to the folder title)
34
35%bww_folder(t:n:V)\
36%{!?-t:%{error:%0: Missing mandatory TITLE parameter}}\
37%bww_create_folder_id\
38%global __bww_title %{-t*}\
39%global __bww_title_ver %{!-V:%{__bww_title} %{version}}%{-V:%{__bww_title}}\
40%wps_object_create WP_BWWHELP:WPFolder|bww Help|<WP_ASSISTANCE>|TITLE=bitwiseworks Help Center;SHOWALLINTREEVIEW=YES;ICONRESOURCE=60,PMWP.DLL;ICONNRESOURCE=83,PMWP.DLL;BACKGROUND=((/@unixroot/usr/share/os2/bww/bwwfbkg.bmp));ALWAYSSORT=YES;DEFAULTSORT=-1;DEFAULTVIEW=TREE;OPEN=TREE;NODELETE=YES;\
41%wps_object_create WP_BWWDOC:WPShadow|Documentation|<WP_BWWHELP>|SHADOWID=((/@unixroot/usr/share/doc));\
42%wps_object_create WP_BWWAPPS:WPFolder|bww Apps|<WP_PROGRAMSFOLDER>|TITLE=bitwiseworks Apps and Ports;ICONRESOURCE=1,BWWRES.DLL;ICONNFILE=((/@unixroot/usr/share/os2/bww/bwwfldro.ico));BACKGROUND=((/@unixroot/usr/share/os2/bww/bwwfbkg.bmp));ICONVIEW=FLOWED;\
43%wps_object_create WP_BWWHELPSHADOW:WPShadow|bitwiseworks Help Center|<WP_BWWAPPS>|SHADOWID=<WP_BWWHELP>;\
44%wps_object_create %{__bww_folder_id}:WPFolder|%{__bww_folder_name}|<WP_BWWAPPS>|TITLE=%{__bww_title_ver};\
45%{nil}
46
47# bww_app creates:
48# a object in the bww folder (will get a BWW_%{name}_<ID>_APP WPS object ID)
49# a shadow of the object on the desktop (if requested) (will get a BWW_%{name}_<ID>_APP_SHADOW WPS object ID)
50#
51# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
52# !!!!!! be aware that the -s option (if used) is not the last option. !!!!!!
53# !!!!!! as else the complete object is not generated. !!!!!!
54# !!!!!! this looks like a rpm issue !!!!!!
55# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
56#
57# %bww_app [ID] -f APP -t TITLE [-n PACKAGE] [-s] [-a ASSOCIATIONS] [-i ICON] [-d STARTUPDIR]
58# ID (when provided: this ID is added to the WPS id)
59# -f EXEFILE (Mandatory: fullpath/to/app)
60# -t TITLE (Mandatory: use TITLE as the app title)
61# (TITLE *must* be a %global macro if with spaces)
62# -n PACKAGE (when provided: associate the folder with PACKAGE, else with %{name})
63# -a ASSOCIATIONS (when provided: associate a file filter to the object)
64# examples are *.txt or *.txt,*.pdf,*.html
65# -i ICON (when provided: an icon is added to the object)
66# The icon has to be copied to /@unixroot/usr/share/os2/icons during
67# installation!
68# -d STARTUPDIR (when provided: this value is set as STARTUPDIR in the wps object)
69# -s (when provided: create a shadow on the desktop)
70#
71
72%bww_app(f:t:n:a:i:d:s)\
73%{!-f:%{error:%0: Missing mandatory EXEFILE parameter}}\
74%{!-t:%{error:%0: Missing mandatory TITLE parameter}}\
75%bww_create_folder_id\
76%bww_create_app_id\
77%global __bww_app_title %{-t*}\
78%global __bww_app_icon %{!-i:}%{-i:ICONFILE=((/@unixroot/usr/share/os2/icons/%{-i*}));}\
79%global __bww_app_assoc %{!-a:}%{-a:ASSOCFILTER=%{-a*};}\
80%global __bww_app_startupdir %{!-d:}%{-d:STARTUPDIR=((%{-d*}));}\
81%global __bww_app_name %{-f*}\
82%wps_object_create %{__bww_app_id}:WPProgram|%{__bww_app_title}|<%{__bww_folder_id}>|EXENAME=((%{__bww_app_name}));%{__bww_app_startupdir}TITLE=%{__bww_app_title};%{__bww_app_icon}%{__bww_app_assoc}\
83%{-s:%wps_object_create %{__bww_app_id}_SHADOW:WPShadow|%{__bww_app_title}|<WP_DESKTOP>|SHADOWID=<%{__bww_app_id}>;}\
84%{nil}
85
86# bww_readme creates:
87# a shadow of a readme file (will get a BWW_%{name}_README WPS ID)
88#
89# %bww_readme -f FILE [-n PACKAGE]
90# -f FILE (Mandatory: create a shadow for the provided readme FILE)
91# -n PACKAGE (when provided: associate the folder with PACKAGE, else with %{name})
92
93%bww_readme(f:n:)\
94%bww_file README\
95%{nil}
96
97# bww_license creates:
98# a shadow of a license file (will get a BWW_%{name}_LICENSE WPS ID)
99#
100# %bww_license -f LICENSE [-n PACKAGE]
101# -f FILE (Mandatory: create a shadow for the provided license FILE)
102# -n PACKAGE (when provided: associate the folder with PACKAGE, else with %{name})
103
104%bww_license(f:n:)\
105%bww_file LICENSE\
106%{nil}
107
108# bww_copyright creates:
109# a shadow of a copyright file (will get a BWW_%{name}_COPYRIGHT WPS ID)
110#
111# %bww_copyright -f FILE [-n PACKAGE]
112# -f FILE (Mandatory: create a shadow for the provided copyright FILE)
113# -n PACKAGE (when provided: associate the folder with PACKAGE, else with %{name})
114
115%bww_copyright(f:n:)\
116%bww_file COPYRIGHT\
117%{nil}
118
119# bww_doc creates:
120# a shadow of a doc directory (will get a BWW_%{name}_DOCDIR WPS ID)
121#
122# %bww_doc -f FILE [-n PACKAGE]
123# -f FILE (Mandatory: create a shadow for the provided doc FILE (directory in this case))
124# -n PACKAGE (when provided: associate the folder with PACKAGE, else with %{name})
125
126%bww_doc(f:n:)\
127%bww_file DOCDIR\
128%{nil}
129
130# bww_file creates:
131# a shadow of a file (will get a BWW_%{name}_<ID> WPS object ID)
132#
133# %bww_file ID -f FILE [-n PACKAGE]
134# ID (Mandatory: the name of the file for the WPS object id)
135# -f FILE (Mandatory: create a shadow for the provided FILE)
136# -n PACKAGE (when provided: associate the folder with PACKAGE, else with %{name})
137
138%bww_file(f:n:)\
139%{!?1:%{error:%0: Missing mandatory WPS ID parameter}}\
140%{!-f:%{error:%0: Missing mandatory FILE parameter}}\
141%bww_create_folder_id\
142%global __bww_file_id %{1}\
143%global __bww_file %{-f*}\
144%wps_object_create BWW_%{__bww_folder_name}_%{__bww_file_id}:WPShadow|%{__bww_file_id}|<%{__bww_folder_id}>|SHADOWID=((%{__bww_file}))\
145%{nil}
146
147
148%bww_create_folder_id(n:)\
149%global __bww_folder_name %{!-n:%{name}}%{-n:%{-n*}}\
150%global __bww_folder_id BWW_%{__bww_folder_name}_FOLDER\
151%{nil}
152
153%bww_create_app_id(n:)\
154%global __bww_pkg_id %{?1:_%{1}}%{!?1:}\
155%global __bww_app_id BWW_%{__bww_folder_name}%{__bww_pkg_id}_APP\
156%{nil}
157
Note: See TracBrowser for help on using the repository browser.