rpms/viewvc/F-11 viewvc-lexer-mimetypes.py, NONE, 1.1 viewvc.spec, 1.17, 1.18

bojan bojan at fedoraproject.org
Tue Aug 11 03:26:33 UTC 2009


Author: bojan

Update of /cvs/pkgs/rpms/viewvc/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30391

Modified Files:
	viewvc.spec 
Added Files:
	viewvc-lexer-mimetypes.py 
Log Message:
Install and populate mimetypes.conf.


--- NEW FILE viewvc-lexer-mimetypes.py ---
#!/usr/bin/python

import sys
import re
from pygments.lexers import get_all_lexers

for fullname, names, exts, mimetype in get_all_lexers():
  if len(exts) > len(mimetype):
    for j in range(len(mimetype)):
      for i in range(len(exts)):
        if re.match('\*\.',exts[i]):
          if i == 0:
            print mimetype[j],
          if re.search('\[[0-9]+\]',exts[i]):
            s=re.search('\[[0-9]+\]',exts[i]).span()[0]+1
            e=re.search('\[[0-9]+\]',exts[i]).span()[1]-1
            for k in range(s,e):
              print exts[i][2:s-1]+exts[i][k]+exts[i][e+1:],
          else:
            print exts[i][2:],
          if i == len(exts)-1:
            print
  else:
    for i in range(len(mimetype)):
      if len(exts) > i:
        if re.match('\*\.',exts[i]):
          if re.search('\[[0-9]+\]',exts[i]):
            s=re.search('\[[0-9]+\]',exts[i]).span()[0]+1
            e=re.search('\[[0-9]+\]',exts[i]).span()[1]-1
            print mimetype[i],
            for k in range(s,e):
              print exts[i][2:s-1]+exts[i][k]+exts[i][e+1:],
            print
          else:
            print mimetype[i], exts[i][2:]


Index: viewvc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/viewvc/F-11/viewvc.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -r1.17 -r1.18
--- viewvc.spec	3 Jun 2009 21:36:31 -0000	1.17
+++ viewvc.spec	11 Aug 2009 03:26:33 -0000	1.18
@@ -2,7 +2,7 @@
 
 Name:           viewvc
 Version:        1.1.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Browser interface for CVS and SVN version control repositories
 
 Group:          Development/Tools
@@ -11,13 +11,14 @@ URL:            http://www.viewvc.org/
 Source0:        http://www.viewvc.org/%{name}-%{version}.tar.gz
 Source1:        viewvc.conf
 Source2:        README.httpd
+Source3:        viewvc-lexer-mimetypes.py 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Obsoletes:      %{name}-selinux < 1.0.3-13
 Conflicts:      selinux-policy < 2.5.10-2
 
 BuildArch:      noarch
-BuildRequires:  python-devel >= 2.0
+BuildRequires:  python-devel >= 2.0, python-pygments
 Requires:       webserver, rcs, diffutils
 Requires:       subversion >= 1.2
 Requires:       cvsgraph
@@ -79,6 +80,10 @@ with decent performance when run under A
 %{__rm} -f %{buildroot}%{python_sitelib}/viewvc/viewvc.conf
 %{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/cvsgraph.conf %{buildroot}%{_sysconfdir}/viewvc/cvsgraph.conf
 %{__rm} -f %{buildroot}%{python_sitelib}/viewvc/cvsgraph.conf
+%{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/mimetypes.conf %{buildroot}%{_sysconfdir}/viewvc/mimetypes.conf
+%{__rm} -f %{buildroot}%{python_sitelib}/viewvc/mimetypes.conf
+
+%{SOURCE3} >> %{buildroot}%{_sysconfdir}/viewvc/mimetypes.conf
 
 # Install Apache configuration and README
 %{__sed} -e s,__datadir__,%{_datadir}, \
@@ -113,6 +118,10 @@ with decent performance when run under A
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/viewvc.conf
 
 %changelog
+* Tue Aug 11 2009 Bojan Smojver <bojan at rexursive.com> - 1.1.1-2
+- install mimetypes.conf
+- populate mimetypes.conf with what pygments understands
+
 * Thu Jun  4 2009 Bojan Smojver <bojan at rexursive.com> - 1.1.1-1
 - Bump up to 1.1.1
 




More information about the fedora-extras-commits mailing list