xmlbasedsrs/xmlbasedsrs.spec

Fri, 09 Jan 2009 17:17:28 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 09 Jan 2009 17:17:28 +0100
changeset 60
e72e671d6f8c
child 62
53785d38f0e4
permissions
-rw-r--r--

Import new package spec for introduction into repository.

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

mercurial