rpms/libspe2/F-9 import.log, NONE, 1.1 libspe2-2.2.80-doxygen.patch, NONE, 1.1 libspe2.spec, NONE, 1.1 png-mtime.py, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Jochen Roth (jroth) fedora-extras-commits at redhat.com
Thu Jul 24 08:31:36 UTC 2008


Author: jroth

Update of /cvs/pkgs/rpms/libspe2/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18775/F-9

Modified Files:
	.cvsignore sources 
Added Files:
	import.log libspe2-2.2.80-doxygen.patch libspe2.spec 
	png-mtime.py 
Log Message:
Initial check in for F-9



--- NEW FILE import.log ---
libspe2-2_2_80_95-5_fc9:F-9:libspe2-2.2.80.95-5.fc9.src.rpm:1216888065

libspe2-2.2.80-doxygen.patch:

--- NEW FILE libspe2-2.2.80-doxygen.patch ---
Patch by Robert Scheck <robert at fedoraproject.org> for libspe2 >= 2.2.80.95, which solves the
multilib/multiarch problem by removing the timestamp within the footer from the doxygen generated
files. It also removes the LATEX_HEADER definition in order to get doxygen successfully run.

--- libspe2-2.2.80/doc/Doxyfile					2008-05-31 15:22:22.000000000 +0200
+++ libspe2-2.2.80/doc/Doxyfile.doxygen				2008-05-31 16:17:00.000000000 +0200
@@ -603,7 +603,7 @@
 # each generated HTML page. If it is left blank doxygen will generate a 
 # standard footer.
 
-HTML_FOOTER            = 
+HTML_FOOTER            = footer_no_timestamp.html
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
 # style sheet that is used by each HTML page. It can be used to 
--- libspe2-2.2.80/doc/Doxyfile					2007-03-21 15:49:59.000000000 +0100
+++ libspe2-2.2.80/doc/Doxyfile.doxygen				2008-05-31 15:22:22.000000000 +0200
@@ -732,7 +732,7 @@
 # the first chapter. If it is left blank doxygen will generate a 
 # standard header. Notice: only use this tag if you know what you are doing!
 
-LATEX_HEADER           = doc/LatexHeader
+LATEX_HEADER           = 
 
 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
 # is prepared for conversion to pdf (using ps2pdf). The pdf file will 
--- libspe2-2.2.80/doc/footer_no_timestamp.html			1970-01-01 01:00:00.000000000 +0100
+++ libspe2-2.2.80/doc/footer_no_timestamp.html.multilib	2008-05-31 16:17:00.000000000 +0200
@@ -0,0 +1,5 @@
+<hr size="1"><address style="text-align: right;"><small>Generated for $projectname by 
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> $doxygenversion </small></address>
+</body>
+</html>


--- NEW FILE libspe2.spec ---
%define up_version 2.2.80
%define up_release 95
%define spuinclude %{_includedir}/spu

Name:              libspe2
Version:           %{up_version}.%{up_release}
Release:           5%{?dist}
Summary:           SPE Runtime Management Library

Group:             System Environment/Libraries
License:           LGPLv2+
URL:               http://sourceforge.net/projects/libspe/
Source0:           http://downloads.sourceforge.net/sourceforge/libspe/%{name}-%{up_version}-%{up_release}.tar.gz
Source1:           png-mtime.py
Patch:             libspe2-2.2.80-doxygen.patch
BuildRoot:         %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:     doxygen, graphviz, python

Requires(post):    /sbin/chkconfig
Requires(preun):   /sbin/service, /sbin/chkconfig
Requires(postun):  /sbin/service

ExclusiveArch:     ppc ppc64

%description
SPE Runtime Management Library for the Cell Broadband Engine Architecture.

%package devel
Summary:           SPE Runtime Management Library
Group:             Development/Libraries
Requires:          %{name} = %{version}-%{release}, pkgconfig

%description devel
Header and object files for SPE Runtime Management Library.

%ifarch ppc
%package -n elfspe2
Summary:           Helper for standalong SPE applications
Group:             System Environment/Libraries
Requires:          %{name} = %{version}-%{release}

%description -n elfspe2
This tool acts as a standalone loader for spe binaries.
%endif

%ifarch ppc64
%package adabinding-devel
Summary:           Ada package files porting libspe headers
Group:             Development/Libraries
Requires:          %{name} = %{version}-%{release}

%description adabinding-devel
Ada package files porting libspe headers Management Library.
%endif

%prep
%setup -q -n %{name}-%{up_version}
%patch -p1 -b .doxygen

%build
# It doesn't understand handling of %{?_smp_mflags}
make OPTFLAGS="%{optflags}" SYSROOT="" prefix=%{_prefix} libdir=%{_libdir}

%ifarch ppc
# It doesn't understand handling of %{?_smp_mflags}
make elfspe2-all OPTFLAGS="%{optflags}" SYSROOT="" prefix=%{_prefix} libdir=%{_libdir}
%endif

# Generate documentation via doxygen including the images
pushd doc
doxygen

# Solve multilib problems by changing the internal PNG timestamp to a reference timestamp;
# see http://fedoraproject.org/wiki/PackagingDrafts/MultilibTricks for further information.
python %{SOURCE1} html/graph_legend.png ARCHITECTURE
popd

%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT SYSROOT="" prefix=%{_prefix} libdir=%{_libdir} speinclude=%{spuinclude}
mv -f $RPM_BUILD_ROOT%{_prefix}/adainclude/* $RPM_BUILD_ROOT%{_includedir}

%ifarch ppc
make elfspe2-install DESTDIR=$RPM_BUILD_ROOT SYSROOT="" prefix=%{_prefix} libdir=%{_libdir} speinclude=%{spuinclude}
install -D -m 755 elfspe2.init $RPM_BUILD_ROOT%{_initrddir}/elfspe2

# Ada makes only sense on ppc64 arch
rm -f $RPM_BUILD_ROOT%{_includedir}/*.ads
%endif

# Remove unwanted files, static files and files for %doc
rm -f $RPM_BUILD_ROOT%{_includedir}/README-libspe2
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}/libspe.*

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%ifarch ppc
%post -n elfspe2
/sbin/chkconfig --add elfspe2
%{_bindir}/elfspe2-register

%preun -n elfspe2
if [ $1 -eq 0 ]; then
  /sbin/service elfspe2 stop > /dev/null 2>&1 || :
  /sbin/chkconfig --del elfspe2
fi

%postun -n elfspe2
if [ $1 -ne 0 ]; then
  /sbin/service elfspe2 condrestart > /dev/null 2>&1 || :
fi
%endif

%files
%defattr(-,root,root)
%doc COPYING
%{_libdir}/%{name}.so.*

%files devel
%defattr(-,root,root)
%doc PATCH-SUBMITTING-RULES doc/ARCHITECTURE
%doc doc/html
%{_libdir}/%{name}.so
%{_includedir}/*2*.h
%{_includedir}/cbea_map.h
%{spuinclude}
%{_libdir}/pkgconfig/libspe2.pc

%ifarch ppc
%files -n elfspe2
%defattr(-,root,root)
%doc PATCH-SUBMITTING-RULES
%{_initrddir}/elfspe2
%{_bindir}/elfspe2-register
%{_bindir}/elfspe2-unregister
%{_bindir}/elfspe2
%endif

%ifarch ppc64
%files adabinding-devel
%defattr(-,root,root)
%doc ada/README
%{_includedir}/libspe2.ads
%{_includedir}/libspe2_types.ads
%{_includedir}/cbea_map.ads
%endif

%changelog
* Thu Jul 24 2008 Jochen Roth <jroth at linux.vnet.ibm.com> 2.2.80.95-5
- changed release name to include branch name

* Tue Jul 22 2008 Jochen Roth <jroth at linux.vnet.ibm.com> 2.2.80.95-4
- Changed elfspe startup script to be enabled per default

* Wed Jul 16 2008 Jochen Roth <jroth at linux.vnet.ibm.com> 2.2.80.95-3
- Changes according to package review comments.

* Mon Jun 02 2008 Jochen Roth <jroth at linux.vnet.ibm.com> 2.2.80.95-2
- Repaired rpm build errors

* Sat May 31 2008 Robert Scheck <robert at fedoraproject.org> 2.2.80.95-1
- Changes to (hopefully) match with Fedora Packaging Guidelines

* Fri Apr 11 2008 Jochen Roth <jroth at linux.vnet.ibm.com> 2.2.80-95
- adopted to suit Fedora's packaging guidelines

* Mon Aug 13 2007 Gerhard Stenzel <stenzel at de.ibm.com> 2.2.0-85
- fixes for rpmlint complaints

* Thu Nov 24 2005 Arnd Bergmann <arnd at arndb.de> 1.0.1-3
- initial spec file for fc5


--- NEW FILE png-mtime.py ---
#! /usr/bin/python -tt

#  This script takes a PNG file, and parses the GMT timestamp information from
# it. You can then print and/or alter the timestamp, and finally save the new
# timestamp information back to the PNG file.
#  See the __main__ section for API usage.
#
#  CMD line usage:
#      png-mtime.py <png-file> [reference-file]
#
#  If the reference file isn't there, it just prints the old timestamp.
#
#  Author: James Antill <james at fedoraproject.org>
#  Copyright: 2008
#  License: MIT, LGPL, new style BSD ... take your pick

import os
import sys
import binascii
import struct
import time
import calendar

_PNG_HEADER = "\x89PNG\r\n\x1A\n"

class PNG_time:
    """ For reading, displaying and setting a PNG's modification time. """

    _time_chunk = None
    year   = None
    month  = None
    day    = None
    hour   = None
    minute = None
    second = None

    def _read_header(self, fo):
        """ read header, and make sure this is a png """
        header = fo.read(8)
        if header != _PNG_HEADER:
            print >>sys.stderr, " Bad HEADER:", header
            sys.exit(1)
        self.chunks = 0
        self.off    = 0

    def _read_chunk(self, fo):
        """ read a chunk, and check the CRC. Then return tuple. """
        length    = struct.unpack(">I",  fo.read(4))[0]
        rawtype   = fo.read(4)
        chunktype = struct.unpack(">4s", rawtype)[0]
        rawdata   = fo.read(length)
        data      = struct.unpack(">%ss" % length, rawdata)[0]
        CRC       = struct.unpack(">i",  fo.read(4))[0]
        # Check the CRC
        chk_CRC = binascii.crc32(rawtype + rawdata)
        if CRC != chk_CRC:
            print >>sys.stderr, " Bad CRC: %d %d" % (CRC, chk_CRC)
            sys.exit(1)
        # print "JDBG: Chunk[%s] = %d %d" % (chunktype, length, CRC)
        self.chunks += 1
        self.off    += (4 * 3) + length
        return (chunktype, length, data, CRC)

    def _get_time(self, chunktype, length, data):
        """ Convert a tIME chunk into a time dict. """
        if chunktype != "tIME" or length != 7:
            return False
        if self._time_chunk is not None:
            print >>sys.stderr, " Mulitple tIME Chunks %d %d" % (self._time_chunk, self.chunks)
            sys.exit(1)
        self._time_chunk = self.chunks
        self._time_off   = self.off - length
        vals = struct.unpack(">Hbbbbb", data)
        self.year   = vals[0]
        self.month  = vals[1]
        self.day    = vals[2]
        self.hour   = vals[3]
        self.minute = vals[4]
        self.second = vals[5]
        return True

    def __init__(self, fname):
        self.fname = fname
        fo = open(fname)
        self._read_header(fo)
        T = "blah"
        while T != "IEND":
            (T,l,d,c) = self._read_chunk(fo)
            self._get_time(T, l, d)
        if self._time_chunk is None:
            print >>sys.stderr, " No tIME Chunks"
            sys.exit(1)

    def ymdhms(self):
        """ Returns a tuple of: year, month, day, hour, minute, second.
            Note that this is all that's stored in the file, and so should
            be in UTC time. """
        return (self.year, self.month,  self.day,
                self.hour, self.minute, self.second)

    def tm(self):
        """ Returns a tm tuple for the PNG timestamp data. 
            Note that this is in UTC, as though it's from time.gmtime(). """
        return (self.year, self.month,  self.day,
                self.hour, self.minute, self.second, 0, 0, 0)

    def time(self):
        """ Returns an Epoch time for the PNG timestamp data. """
        return calendar.timegm(self.tm())

    def save(self):
        """ Save the new timestamp information over the old in the PNG file. """
        fo = open(self.fname, "r+")

        fo.seek(self._time_off)

        ymdhms = self.ymdhms()
        rawdata = struct.pack(">4sHbbbbb", "tIME", *ymdhms)
        CRC = binascii.crc32(rawdata)
        rawCRC = struct.pack(">i", CRC)

        fo.write(rawdata)
        fo.write(rawCRC)
        fo.close()

    def utime(self):
        """ Set the st_mtime of the file to the timestamp in the PNG file. """
        os.utime(self.fname, (time.time(), self.time()))

    def set_time_from_file(self, fname):
        """ Set the PNG timestamp data based on a reference file. """
        tm = time.gmtime(os.stat(fname).st_mtime)
        self.year   = tm.tm_year
        self.month  = tm.tm_mon
        self.day    = tm.tm_mday
        self.hour   = tm.tm_hour
        self.minute = tm.tm_min
        self.second = tm.tm_sec

if __name__ == '__main__':
    png = PNG_time(sys.argv[1])
    # print "JDBG: chunks=%d" % png.chunks
    print "orig time =", time.ctime(png.time())
    if len(sys.argv) > 2:
        png.set_time_from_file(sys.argv[2])
        print "new  time =", time.ctime(png.time())
        png.save()
    # Reset the mtime of the file to the modified time of the PNG file.
    # People might consider it evil to always utime here, but hey!
    png.utime()


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/libspe2/F-9/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	23 Jul 2008 15:53:32 -0000	1.1
+++ .cvsignore	24 Jul 2008 08:30:51 -0000	1.2
@@ -0,0 +1 @@
+libspe2-2.2.80-95.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/libspe2/F-9/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	23 Jul 2008 15:53:32 -0000	1.1
+++ sources	24 Jul 2008 08:30:51 -0000	1.2
@@ -0,0 +1 @@
+e534fd24e9c0225519d9dcc11f1ecba2  libspe2-2.2.80-95.tar.gz




More information about the fedora-extras-commits mailing list