xmlbasedsrs/xmlbasedsrs.spec

Sun, 29 May 2011 16:29:06 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 29 May 2011 16:29:06 +0200
changeset 344
e33c1efbd60f
parent 248
cee99faf0afd
child 387
33ae2d61c751
permissions
-rw-r--r--

Update, correct, improve build configuration and packaging logic.
Update to new version of vendor software, bump copyright date, remove implicit
gcc dependency, add comments for Trolltech bug tracking, correct enforced
dynamic library linkage, and install mysterious process stub binary.

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

mercurial