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