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.

     1 ##
     2 ##  xmlbasedsrs.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2010 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: Michael Schloh von Bennewitz
    31 Class:        EVAL
    32 Group:        SGML
    33 License:      GPL
    34 Version:      0.1
    35 Release:      20100512
    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     #   rename projplan doc from defunct
    67     mv xsl/mrproject.xsl xsl/planner.xsl
    69     #   create a utility to generate new SRS from template
    70     ( echo "#! /bin/sh"
    71       echo "mkdir srsnew"
    72       echo "( cd srsnew || exit -1"
    73       echo "  ln -s %{l_prefix}/share/sgml/xmlbasedsrs-xml/dtd/srs.dtd"
    74       echo "  cp %{l_prefix}/share/sgml/xmlbasedsrs-xml/xml/filesToDiff.xml ."
    75       echo "  cp %{l_prefix}/share/sgml/xmlbasedsrs-xml/xml/srs.xml ."
    76       echo ") || echo 'Failed.'"
    77     ) >newsrs
    78     chmod +x newsrs
    80     #   correct hard coded variable text
    81     %{l_shtool} subst \
    82         -e 's;\(xsltproc\);%{l_prefix}/bin/\1;g' \
    83         -e 's;^#!/usr/bin/perl;#! %{l_prefix}/bin/perl;' \
    84         -e 's;$XML_DIR\."/\(filesToDiff\.xml\)";"./\1";' \
    85         -e 's;^\(@XSL_FILES\)\ *=\ *\((.*\)"intro",\ *\(.*\);\1 = \2\3;' \
    86         -e 's;^\(\$SRS_ROOT\)\ *=\ *"/home/lapsystems/Projects/xmlbasedsrs";\1 = "%{l_prefix}/share/sgml/xmlbasedsrs-xml";;' \
    87         bin/gsrs
    88     %{l_shtool} subst \
    89         -e 's;mrproject;planner;g' \
    90         -e 's;MrProject;ProjPlan;g' \
    91         xsl/imp_standard.xsl \
    92         bin/gsrs
    93     %{l_shtool} subst \
    94         -e 's;\(<file>\).*\(filesToDiff.xml\);\1\2;' \
    95         xml/filesToDiff.xml
    97 #    #   lump nonfunctional and functional requirements together
    98 #    %{l_shtool} subst \
    99 #        -e 's;\([Nn]on\)\ \([Ff]unctional\ [Rr]equirements\);(\1)\2;' \
   100 #        dtd/srs.dtd \
   101 #        xsl/imp_standard.xsl \
   102 #        xsl/print.xsl
   104     #   remove obscured attribution text until correctly implemented
   105     %{l_shtool} subst \
   106         -e 's;\ *<a href="http://xmlbasedsrs\.tigris\.org">xmlbasedsrs\.tigris\.org</a>\ *;;' \
   107         xsl/imp_standard.xsl
   109 %build
   111 %install
   112     rm -rf $RPM_BUILD_ROOT
   114     #   create installation hierarchy
   115     %{l_shtool} mkdir -f -p -m 755 \
   116         $RPM_BUILD_ROOT%{l_prefix}/bin \
   117         $RPM_BUILD_ROOT%{l_prefix}/share/sgml/xmlbasedsrs-xml
   119     #   install xsltproc(1) wrapper
   120     %{l_shtool} install -m 755 \
   121         bin/gsrs \
   122         newsrs \
   123         $RPM_BUILD_ROOT%{l_prefix}/bin/
   125     #   clean sources
   126     rmdir bin
   127     rm INSTALL
   129     #   install XML based SRS DTD
   130     cp -r * $RPM_BUILD_ROOT%{l_prefix}/share/sgml/xmlbasedsrs-xml/
   132     #   determine file list
   133     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   134         %{l_files_std} \
   135         '%not %dir %{l_prefix}/share/sgml'
   137 %files -f files
   139 %clean
   140     rm -rf $RPM_BUILD_ROOT
   142 %post
   143 #    if [ $1 -eq 1 ]; then
   144 #        $RPM_INSTALL_PREFIX/bin/sgmlcatalog \
   145 #            -? compile similar to docbook package
   146 #    fi
   148 %preun
   149 #    if [ $1 -eq 0 ]; then
   150 #        $RPM_INSTALL_PREFIX/bin/sgmlcatalog \
   151 #            -? compile similar to docbook package
   152 #    fi

mercurial