xmlbasedsrs/xmlbasedsrs.spec

Mon, 17 May 2010 20:26:46 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 17 May 2010 20:26:46 +0200
changeset 244
c81553da0489
parent 62
53785d38f0e4
child 248
cee99faf0afd
permissions
-rw-r--r--

Introduce various corrections and improvements.
Remove hardcoded path from diff XML template.
Improve SRS new template directory generation.
Update defunct Mr Project references to Gnome Planner.

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

mercurial