michael@60: ## michael@60: ## xmlbasedsrs.spec -- OpenPKG RPM Package Specification michael@62: ## Copyright (c) 2009 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@62: Distribution: MSvB Recherche Production michael@60: Class: EVAL michael@60: Group: SGML michael@60: License: GPL michael@60: Version: 0.1 michael@60: Release: 20090106 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@60: # create a utility to generate new SRS from template michael@60: ( echo "#! /bin/sh" michael@60: echo "mkdir newsrs" michael@60: echo "( cd newsrs || 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@60: ) >newsrs_tmpl michael@60: chmod +x newsrs_tmpl 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@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@60: newsrs_tmpl \ 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: