michael@60: ## michael@60: ## xmlbasedsrs.spec -- OpenPKG RPM Package Specification michael@244: ## Copyright (c) 2010 Michael Schloh von Bennewitz michael@60: ## michael@60: ## Permission to use, copy, modify, and distribute this software for michael@60: ## any purpose with or without fee is hereby granted, provided that michael@60: ## the above copyright notice and this permission notice appear in all michael@60: ## copies. michael@60: ## michael@60: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@60: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@60: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@60: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@60: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@60: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@60: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@60: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@60: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@60: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@60: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@60: ## SUCH DAMAGE. michael@60: ## michael@60: michael@60: # package information michael@60: Name: xmlbasedsrs michael@60: Summary: Software requirements specifications (SRS) DTD and tools michael@60: URL: http://xmlbasedsrs.tigris.org/ michael@60: Vendor: Tigris michael@62: Packager: Michael Schloh von Bennewitz michael@387: Distribution: Europalab Networks Production michael@60: Class: EVAL michael@60: Group: SGML michael@60: License: GPL michael@60: Version: 0.1 michael@249: Release: 20100514 michael@60: michael@60: # list of sources michael@60: Source0: http://xmlbasedsrs.tigris.org/files/documents/673/3179/xmlbasedsrs-%{version}.tar.gz michael@60: michael@60: # build information michael@60: Prefix: %{l_prefix} michael@60: BuildRoot: %{l_buildroot} michael@60: BuildPreReq: OpenPKG, openpkg >= 20040130, sgml, libxslt, perl michael@60: PreReq: OpenPKG, openpkg >= 20040130, sgml, libxslt, perl michael@60: AutoReq: no michael@60: AutoReqProv: no michael@60: michael@60: %description michael@60: The goal of xmlbasedsrc is to define the DTD used for Software michael@60: Requirements Specifications (SRS) and provide useful tools to michael@60: transform a XML based SRS document to useful formats. This michael@60: distribution includes basic transformation XSL stylesheets to michael@60: improve software development through requirements engineering. michael@60: michael@60: %track michael@60: prog xmlbasedsrs = { michael@60: version = %{version} michael@60: url = http://xmlbasedsrs.tigris.org/files/documents/673/3179/ michael@60: regex = xmlbasedsrs-(__VER__)\.tar\.gz michael@60: } michael@60: michael@60: %prep michael@60: # unpack sources michael@60: %setup -q -n xmlbasedsrs michael@60: michael@244: # rename projplan doc from defunct michael@244: mv xsl/mrproject.xsl xsl/planner.xsl michael@244: michael@60: # create a utility to generate new SRS from template michael@60: ( echo "#! /bin/sh" michael@244: echo "mkdir srsnew" michael@244: echo "( cd srsnew || exit -1" michael@60: echo " ln -s %{l_prefix}/share/sgml/xmlbasedsrs-xml/dtd/srs.dtd" michael@60: echo " cp %{l_prefix}/share/sgml/xmlbasedsrs-xml/xml/filesToDiff.xml ." michael@60: echo " cp %{l_prefix}/share/sgml/xmlbasedsrs-xml/xml/srs.xml ." michael@60: echo ") || echo 'Failed.'" michael@244: ) >newsrs michael@244: chmod +x newsrs michael@60: michael@60: # correct hard coded variable text michael@60: %{l_shtool} subst \ michael@60: -e 's;\(xsltproc\);%{l_prefix}/bin/\1;g' \ michael@60: -e 's;^#!/usr/bin/perl;#! %{l_prefix}/bin/perl;' \ michael@60: -e 's;$XML_DIR\."/\(filesToDiff\.xml\)";"./\1";' \ michael@60: -e 's;^\(@XSL_FILES\)\ *=\ *\((.*\)"intro",\ *\(.*\);\1 = \2\3;' \ michael@60: -e 's;^\(\$SRS_ROOT\)\ *=\ *"/home/lapsystems/Projects/xmlbasedsrs";\1 = "%{l_prefix}/share/sgml/xmlbasedsrs-xml";;' \ michael@60: bin/gsrs michael@244: %{l_shtool} subst \ michael@244: -e 's;mrproject;planner;g' \ michael@244: xsl/imp_standard.xsl \ michael@244: bin/gsrs michael@244: %{l_shtool} subst \ michael@249: -e 's;Non Functional RequirementS;Nonfunctional Requirements;' \ michael@249: dtd/srs.dtd michael@249: %{l_shtool} subst \ michael@249: -e 's;iso-8859-1;ISO-8859-1;' \ michael@249: xml/* \ michael@249: xsl/* michael@249: %{l_shtool} subst \ michael@244: -e 's;\(\).*\(filesToDiff.xml\);\1\2;' \ michael@244: xml/filesToDiff.xml michael@249: %{l_shtool} subst \ michael@249: -e 's;[\ \t][\ \t]*Krav$;;' \ michael@249: -e 's;[\ \t][\ \t]*och$;;' \ michael@249: -e 's;[\ \t][\ \t]*x$;;' \ michael@249: xsl/* michael@249: %{l_shtool} subst \ michael@249: -e 's;Select view;Select document view;' \ michael@249: -e 's;Introduction;Preliminary topics;' \ michael@249: -e 's;Non functional requirements;Nonfunctional requirements;' \ michael@249: -e 's;Demonstration;Use case demonstration;' \ michael@249: -e 's;Map of requirement dependencies;Dependency map;' \ michael@249: -e 's;Differences between versions;Revision changes;' \ michael@249: -e 's;Printable;Printable output;' \ michael@249: -e 's;MrProject;Project plan;g' \ michael@249: -e 's;Work view;Work chart;' \ michael@249: xsl/imp_standard.xsl \ michael@249: xsl/print.xsl michael@249: %{l_shtool} subst \ michael@249: -e 's;Select Use Case;Select use case;' \ michael@249: -e 's;.*vilket.*ndarfall.*demonstrera.*fliken.*;;' \ michael@249: xsl/demo.xsl michael@249: %{l_shtool} subst \ michael@249: -e 's;Number of Use Cases;Number of use cases;' \ michael@249: xsl/tree.xsl michael@249: %{l_shtool} subst \ michael@249: -e 's;Use Cases;Use cases;' \ michael@249: xsl/imp_standard.xsl \ michael@249: xsl/list.xsl \ michael@249: xsl/tree.xsl michael@249: %{l_shtool} subst \ michael@249: -e 's;Tree view of [Uu]se [Cc]ases;Functional requirements;' \ michael@249: xsl/imp_standard.xsl \ michael@249: xsl/print.xsl \ michael@249: xsl/tree.xsl michael@60: michael@60: # # lump nonfunctional and functional requirements together michael@60: # %{l_shtool} subst \ michael@60: # -e 's;\([Nn]on\)\ \([Ff]unctional\ [Rr]equirements\);(\1)\2;' \ michael@60: # dtd/srs.dtd \ michael@60: # xsl/imp_standard.xsl \ michael@60: # xsl/print.xsl michael@60: michael@60: # remove obscured attribution text until correctly implemented michael@60: %{l_shtool} subst \ michael@60: -e 's;\ *xmlbasedsrs\.tigris\.org\ *;;' \ michael@60: xsl/imp_standard.xsl michael@60: michael@60: %build michael@60: michael@60: %install michael@60: rm -rf $RPM_BUILD_ROOT michael@60: michael@60: # create installation hierarchy michael@60: %{l_shtool} mkdir -f -p -m 755 \ michael@60: $RPM_BUILD_ROOT%{l_prefix}/bin \ michael@60: $RPM_BUILD_ROOT%{l_prefix}/share/sgml/xmlbasedsrs-xml michael@60: michael@60: # install xsltproc(1) wrapper michael@60: %{l_shtool} install -m 755 \ michael@60: bin/gsrs \ michael@244: newsrs \ michael@60: $RPM_BUILD_ROOT%{l_prefix}/bin/ michael@60: michael@60: # clean sources michael@60: rmdir bin michael@60: rm INSTALL michael@60: michael@60: # install XML based SRS DTD michael@60: cp -r * $RPM_BUILD_ROOT%{l_prefix}/share/sgml/xmlbasedsrs-xml/ michael@60: michael@60: # determine file list michael@60: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@60: %{l_files_std} \ michael@60: '%not %dir %{l_prefix}/share/sgml' michael@60: michael@60: %files -f files michael@60: michael@60: %clean michael@60: rm -rf $RPM_BUILD_ROOT michael@60: michael@60: %post michael@60: # if [ $1 -eq 1 ]; then michael@60: # $RPM_INSTALL_PREFIX/bin/sgmlcatalog \ michael@60: # -? compile similar to docbook package michael@60: # fi michael@60: michael@60: %preun michael@60: # if [ $1 -eq 0 ]; then michael@60: # $RPM_INSTALL_PREFIX/bin/sgmlcatalog \ michael@60: # -? compile similar to docbook package michael@60: # fi michael@60: