|
1 ## |
|
2 ## xmlbasedsrs.spec -- OpenPKG RPM Package Specification |
|
3 ## Copyright (c) 2006 Spacenet AG <http://www.space.net/> |
|
4 ## Copyright (c) 2006 Michael Schloh von Bennewitz <michael@schloh.com> |
|
5 ## |
|
6 ## Permission to use, copy, modify, and distribute this software for |
|
7 ## any purpose with or without fee is hereby granted, provided that |
|
8 ## the above copyright notice and this permission notice appear in all |
|
9 ## copies. |
|
10 ## |
|
11 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
12 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
13 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
14 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
15 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
16 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
17 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
18 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
19 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
20 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
21 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
22 ## SUCH DAMAGE. |
|
23 ## |
|
24 |
|
25 # package information |
|
26 Name: xmlbasedsrs |
|
27 Summary: Software requirements specifications (SRS) DTD and tools |
|
28 URL: http://xmlbasedsrs.tigris.org/ |
|
29 Vendor: Tigris |
|
30 Packager: Spacenet |
|
31 Distribution: Spacenet |
|
32 Class: EVAL |
|
33 Group: SGML |
|
34 License: GPL |
|
35 Version: 0.1 |
|
36 Release: 20090106 |
|
37 |
|
38 # list of sources |
|
39 Source0: http://xmlbasedsrs.tigris.org/files/documents/673/3179/xmlbasedsrs-%{version}.tar.gz |
|
40 |
|
41 # build information |
|
42 Prefix: %{l_prefix} |
|
43 BuildRoot: %{l_buildroot} |
|
44 BuildPreReq: OpenPKG, openpkg >= 20040130, sgml, libxslt, perl |
|
45 PreReq: OpenPKG, openpkg >= 20040130, sgml, libxslt, perl |
|
46 AutoReq: no |
|
47 AutoReqProv: no |
|
48 |
|
49 %description |
|
50 The goal of xmlbasedsrc is to define the DTD used for Software |
|
51 Requirements Specifications (SRS) and provide useful tools to |
|
52 transform a XML based SRS document to useful formats. This |
|
53 distribution includes basic transformation XSL stylesheets to |
|
54 improve software development through requirements engineering. |
|
55 |
|
56 %track |
|
57 prog xmlbasedsrs = { |
|
58 version = %{version} |
|
59 url = http://xmlbasedsrs.tigris.org/files/documents/673/3179/ |
|
60 regex = xmlbasedsrs-(__VER__)\.tar\.gz |
|
61 } |
|
62 |
|
63 %prep |
|
64 # unpack sources |
|
65 %setup -q -n xmlbasedsrs |
|
66 |
|
67 # create a utility to generate new SRS from template |
|
68 ( echo "#! /bin/sh" |
|
69 echo "mkdir newsrs" |
|
70 echo "( cd newsrs || exit -1" |
|
71 echo " ln -s %{l_prefix}/share/sgml/xmlbasedsrs-xml/dtd/srs.dtd" |
|
72 echo " cp %{l_prefix}/share/sgml/xmlbasedsrs-xml/xml/filesToDiff.xml ." |
|
73 echo " cp %{l_prefix}/share/sgml/xmlbasedsrs-xml/xml/srs.xml ." |
|
74 echo ") || echo 'Failed.'" |
|
75 ) >newsrs_tmpl |
|
76 chmod +x newsrs_tmpl |
|
77 |
|
78 # correct hard coded variable text |
|
79 %{l_shtool} subst \ |
|
80 -e 's;\(xsltproc\);%{l_prefix}/bin/\1;g' \ |
|
81 -e 's;^#!/usr/bin/perl;#! %{l_prefix}/bin/perl;' \ |
|
82 -e 's;$XML_DIR\."/\(filesToDiff\.xml\)";"./\1";' \ |
|
83 -e 's;^\(@XSL_FILES\)\ *=\ *\((.*\)"intro",\ *\(.*\);\1 = \2\3;' \ |
|
84 -e 's;^\(\$SRS_ROOT\)\ *=\ *"/home/lapsystems/Projects/xmlbasedsrs";\1 = "%{l_prefix}/share/sgml/xmlbasedsrs-xml";;' \ |
|
85 bin/gsrs |
|
86 |
|
87 # # lump nonfunctional and functional requirements together |
|
88 # %{l_shtool} subst \ |
|
89 # -e 's;\([Nn]on\)\ \([Ff]unctional\ [Rr]equirements\);(\1)\2;' \ |
|
90 # dtd/srs.dtd \ |
|
91 # xsl/imp_standard.xsl \ |
|
92 # xsl/print.xsl |
|
93 |
|
94 # remove obscured attribution text until correctly implemented |
|
95 %{l_shtool} subst \ |
|
96 -e 's;\ *<a href="http://xmlbasedsrs\.tigris\.org">xmlbasedsrs\.tigris\.org</a>\ *;;' \ |
|
97 xsl/imp_standard.xsl |
|
98 |
|
99 %build |
|
100 |
|
101 %install |
|
102 rm -rf $RPM_BUILD_ROOT |
|
103 |
|
104 # create installation hierarchy |
|
105 %{l_shtool} mkdir -f -p -m 755 \ |
|
106 $RPM_BUILD_ROOT%{l_prefix}/bin \ |
|
107 $RPM_BUILD_ROOT%{l_prefix}/share/sgml/xmlbasedsrs-xml |
|
108 |
|
109 # install xsltproc(1) wrapper |
|
110 %{l_shtool} install -m 755 \ |
|
111 bin/gsrs \ |
|
112 newsrs_tmpl \ |
|
113 $RPM_BUILD_ROOT%{l_prefix}/bin/ |
|
114 |
|
115 # clean sources |
|
116 rmdir bin |
|
117 rm INSTALL |
|
118 |
|
119 # install XML based SRS DTD |
|
120 cp -r * $RPM_BUILD_ROOT%{l_prefix}/share/sgml/xmlbasedsrs-xml/ |
|
121 |
|
122 # determine file list |
|
123 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
124 %{l_files_std} \ |
|
125 '%not %dir %{l_prefix}/share/sgml' |
|
126 |
|
127 %files -f files |
|
128 |
|
129 %clean |
|
130 rm -rf $RPM_BUILD_ROOT |
|
131 |
|
132 %post |
|
133 # if [ $1 -eq 1 ]; then |
|
134 # $RPM_INSTALL_PREFIX/bin/sgmlcatalog \ |
|
135 # -? compile similar to docbook package |
|
136 # fi |
|
137 |
|
138 %preun |
|
139 # if [ $1 -eq 0 ]; then |
|
140 # $RPM_INSTALL_PREFIX/bin/sgmlcatalog \ |
|
141 # -? compile similar to docbook package |
|
142 # fi |
|
143 |