xmlbasedsrs/xmlbasedsrs.spec

Sat, 27 Oct 2012 17:19:03 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 27 Oct 2012 17:19:03 +0200
changeset 748
7548d72a64e3
parent 249
e56c07037162
permissions
-rw-r--r--

Update version adjusting patch logic accordingly, correctly create
installation hierarchy, and introduce apache-php::with_xmlwriter
dependency required by rather important XML sitemap logic.

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@387 30 Distribution: Europalab Networks Production
michael@60 31 Class: EVAL
michael@60 32 Group: SGML
michael@60 33 License: GPL
michael@60 34 Version: 0.1
michael@249 35 Release: 20100514
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 xsl/imp_standard.xsl \
michael@244 91 bin/gsrs
michael@244 92 %{l_shtool} subst \
michael@249 93 -e 's;Non Functional RequirementS;Nonfunctional Requirements;' \
michael@249 94 dtd/srs.dtd
michael@249 95 %{l_shtool} subst \
michael@249 96 -e 's;iso-8859-1;ISO-8859-1;' \
michael@249 97 xml/* \
michael@249 98 xsl/*
michael@249 99 %{l_shtool} subst \
michael@244 100 -e 's;\(<file>\).*\(filesToDiff.xml\);\1\2;' \
michael@244 101 xml/filesToDiff.xml
michael@249 102 %{l_shtool} subst \
michael@249 103 -e 's;[\ \t][\ \t]*Krav$;;' \
michael@249 104 -e 's;[\ \t][\ \t]*och$;;' \
michael@249 105 -e 's;[\ \t][\ \t]*x$;;' \
michael@249 106 xsl/*
michael@249 107 %{l_shtool} subst \
michael@249 108 -e 's;Select view;Select document view;' \
michael@249 109 -e 's;Introduction;Preliminary topics;' \
michael@249 110 -e 's;Non functional requirements;Nonfunctional requirements;' \
michael@249 111 -e 's;Demonstration;Use case demonstration;' \
michael@249 112 -e 's;Map of requirement dependencies;Dependency map;' \
michael@249 113 -e 's;Differences between versions;Revision changes;' \
michael@249 114 -e 's;Printable;Printable output;' \
michael@249 115 -e 's;MrProject;Project plan;g' \
michael@249 116 -e 's;Work view;Work chart;' \
michael@249 117 xsl/imp_standard.xsl \
michael@249 118 xsl/print.xsl
michael@249 119 %{l_shtool} subst \
michael@249 120 -e 's;Select Use Case;Select use case;' \
michael@249 121 -e 's;.*vilket.*ndarfall.*demonstrera.*fliken.*;;' \
michael@249 122 xsl/demo.xsl
michael@249 123 %{l_shtool} subst \
michael@249 124 -e 's;Number of Use Cases;Number of use cases;' \
michael@249 125 xsl/tree.xsl
michael@249 126 %{l_shtool} subst \
michael@249 127 -e 's;Use Cases;Use cases;' \
michael@249 128 xsl/imp_standard.xsl \
michael@249 129 xsl/list.xsl \
michael@249 130 xsl/tree.xsl
michael@249 131 %{l_shtool} subst \
michael@249 132 -e 's;Tree view of [Uu]se [Cc]ases;Functional requirements;' \
michael@249 133 xsl/imp_standard.xsl \
michael@249 134 xsl/print.xsl \
michael@249 135 xsl/tree.xsl
michael@60 136
michael@60 137 # # lump nonfunctional and functional requirements together
michael@60 138 # %{l_shtool} subst \
michael@60 139 # -e 's;\([Nn]on\)\ \([Ff]unctional\ [Rr]equirements\);(\1)\2;' \
michael@60 140 # dtd/srs.dtd \
michael@60 141 # xsl/imp_standard.xsl \
michael@60 142 # xsl/print.xsl
michael@60 143
michael@60 144 # remove obscured attribution text until correctly implemented
michael@60 145 %{l_shtool} subst \
michael@60 146 -e 's;\ *<a href="http://xmlbasedsrs\.tigris\.org">xmlbasedsrs\.tigris\.org</a>\ *;;' \
michael@60 147 xsl/imp_standard.xsl
michael@60 148
michael@60 149 %build
michael@60 150
michael@60 151 %install
michael@60 152 rm -rf $RPM_BUILD_ROOT
michael@60 153
michael@60 154 # create installation hierarchy
michael@60 155 %{l_shtool} mkdir -f -p -m 755 \
michael@60 156 $RPM_BUILD_ROOT%{l_prefix}/bin \
michael@60 157 $RPM_BUILD_ROOT%{l_prefix}/share/sgml/xmlbasedsrs-xml
michael@60 158
michael@60 159 # install xsltproc(1) wrapper
michael@60 160 %{l_shtool} install -m 755 \
michael@60 161 bin/gsrs \
michael@244 162 newsrs \
michael@60 163 $RPM_BUILD_ROOT%{l_prefix}/bin/
michael@60 164
michael@60 165 # clean sources
michael@60 166 rmdir bin
michael@60 167 rm INSTALL
michael@60 168
michael@60 169 # install XML based SRS DTD
michael@60 170 cp -r * $RPM_BUILD_ROOT%{l_prefix}/share/sgml/xmlbasedsrs-xml/
michael@60 171
michael@60 172 # determine file list
michael@60 173 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@60 174 %{l_files_std} \
michael@60 175 '%not %dir %{l_prefix}/share/sgml'
michael@60 176
michael@60 177 %files -f files
michael@60 178
michael@60 179 %clean
michael@60 180 rm -rf $RPM_BUILD_ROOT
michael@60 181
michael@60 182 %post
michael@60 183 # if [ $1 -eq 1 ]; then
michael@60 184 # $RPM_INSTALL_PREFIX/bin/sgmlcatalog \
michael@60 185 # -? compile similar to docbook package
michael@60 186 # fi
michael@60 187
michael@60 188 %preun
michael@60 189 # if [ $1 -eq 0 ]; then
michael@60 190 # $RPM_INSTALL_PREFIX/bin/sgmlcatalog \
michael@60 191 # -? compile similar to docbook package
michael@60 192 # fi
michael@60 193

mercurial