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

Last change on this file since 1249 was 1249, checked in by Silvan Scherrer, 8 years ago

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

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