Fix spurious 'unsafe include' errors and rpmlint complaints
- Use 'unsafe' mode by default (bug 506953) - Install filter scripts in %{_datadir}/asciidoc - Convert spec file, CHANGELOG, and README to utf-8 - Preserve timestamps on installed files, where feasible - s/$RPM_BUILD_ROOT/%{buildroot} and drop duplicated /'s - Fix rpmlint mixed-use-of-spaces-and-tabs and end-of-line-encoding warnings
This commit is contained in:
parent
e64f1cebe6
commit
3492e36939
54
asciidoc-8.4.5-datadir.patch
Normal file
54
asciidoc-8.4.5-datadir.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
diff -up asciidoc-8.4.5/asciidoc.py.datadir asciidoc-8.4.5/asciidoc.py
|
||||||
|
--- asciidoc-8.4.5/asciidoc.py.datadir 2009-07-18 14:48:29.000000000 -0400
|
||||||
|
+++ asciidoc-8.4.5/asciidoc.py 2009-07-18 14:50:26.000000000 -0400
|
||||||
|
@@ -651,6 +651,8 @@ def filter_lines(filter_cmd, lines, attr
|
||||||
|
if not found:
|
||||||
|
found = findfilter(filtername, CONF_DIR, cmd)
|
||||||
|
if not found:
|
||||||
|
+ found = findfilter(filtername, DATA_DIR, cmd)
|
||||||
|
+ if not found:
|
||||||
|
found = findfilter(filtername, APP_DIR, cmd)
|
||||||
|
else:
|
||||||
|
if os.path.isfile(cmd):
|
||||||
|
@@ -4997,6 +4999,7 @@ APP_DIR = None # This file'
|
||||||
|
USER_DIR = None # ~/.asciidoc
|
||||||
|
# Global configuration files directory (set by Makefile build target).
|
||||||
|
CONF_DIR = '/etc/asciidoc'
|
||||||
|
+DATA_DIR = '/usr/share/asciidoc'
|
||||||
|
HELP_FILE = 'help.conf' # Default (English) help file.
|
||||||
|
|
||||||
|
# Globals
|
||||||
|
diff -up asciidoc-8.4.5/Makefile.in.datadir asciidoc-8.4.5/Makefile.in
|
||||||
|
--- asciidoc-8.4.5/Makefile.in.datadir 2009-04-23 18:49:43.000000000 -0400
|
||||||
|
+++ asciidoc-8.4.5/Makefile.in 2009-07-18 14:46:22.000000000 -0400
|
||||||
|
@@ -23,6 +23,7 @@ srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
|
||||||
|
ASCIIDOCCONF = $(sysconfdir)/asciidoc
|
||||||
|
+ASCIIDOCDATA = $(datadir)/asciidoc
|
||||||
|
|
||||||
|
prog = asciidoc.py a2x
|
||||||
|
progdir = $(bindir)
|
||||||
|
@@ -126,6 +127,13 @@ fixconfpath:
|
||||||
|
mv $$f.out $$f; \
|
||||||
|
done
|
||||||
|
|
||||||
|
+fixdatapath:
|
||||||
|
+ @for f in $(prog); do \
|
||||||
|
+ echo "Fixing DATA_DIR in $$f"; \
|
||||||
|
+ $(SED) "s#^DATA_DIR = '.*'#DATA_DIR = '$(ASCIIDOCDATA)'#; s#^DATA_DIR=.*#DATA_DIR=$(ASCIIDOCDATA)#" $$f > $$f.out; \
|
||||||
|
+ mv $$f.out $$f; \
|
||||||
|
+ done
|
||||||
|
+
|
||||||
|
install-vim:
|
||||||
|
@for d in $(DESTDIR)/$(vimdir) /etc/vim; do \
|
||||||
|
if ! test -d $$d; then continue; fi ; \
|
||||||
|
@@ -145,7 +153,7 @@ uninstall-vim:
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
-build: fixconfpath
|
||||||
|
+build: fixconfpath fixdatapath
|
||||||
|
|
||||||
|
install: all $(PROGTARGETS) $(DATATARGETS) progsymlink install-vim
|
||||||
|
|
38
asciidoc-8.4.5-use-unsafe-mode-by-default.patch
Normal file
38
asciidoc-8.4.5-use-unsafe-mode-by-default.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
diff -up asciidoc-8.4.5/asciidoc.py.default-unsafe asciidoc-8.4.5/asciidoc.py
|
||||||
|
--- asciidoc-8.4.5/asciidoc.py.default-unsafe 2009-05-25 22:12:38.000000000 -0400
|
||||||
|
+++ asciidoc-8.4.5/asciidoc.py 2009-07-16 02:27:09.000000000 -0400
|
||||||
|
@@ -1138,7 +1138,7 @@ class Document:
|
||||||
|
self.level = 0 # 0 => front matter. 1,2,3 => sect1,2,3.
|
||||||
|
self.has_errors = False # Set true if processing errors were flagged.
|
||||||
|
self.has_warnings = False # Set true if warnings were flagged.
|
||||||
|
- self.safe = True # Default safe mode.
|
||||||
|
+ self.safe = False # Default safe mode.
|
||||||
|
def update_attributes(self):
|
||||||
|
# Set implicit attributes.
|
||||||
|
if self.infile and os.path.exists(self.infile):
|
||||||
|
@@ -5205,8 +5205,8 @@ def execute(cmd,opts,args):
|
||||||
|
for o,v in opts:
|
||||||
|
if o in ('--help','-h'):
|
||||||
|
help_option = True
|
||||||
|
- if o == '--unsafe':
|
||||||
|
- document.safe = False
|
||||||
|
+ if o == '--safe':
|
||||||
|
+ document.safe = True
|
||||||
|
if o == '--version':
|
||||||
|
print('asciidoc %s' % VERSION)
|
||||||
|
sys.exit(0)
|
||||||
|
diff -up asciidoc-8.4.5/doc/asciidoc.1.default-unsafe asciidoc-8.4.5/doc/asciidoc.1
|
||||||
|
--- asciidoc-8.4.5/doc/asciidoc.1.default-unsafe 2009-05-26 02:38:36.000000000 -0400
|
||||||
|
+++ asciidoc-8.4.5/doc/asciidoc.1 2009-08-12 23:51:09.000000000 -0400
|
||||||
|
@@ -123,9 +123,9 @@ Auto\-number HTML article section titles
|
||||||
|
\fB\-a numbered\fR\.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
-\fB\-\-unsafe\fR
|
||||||
|
+\fB\-\-safe\fR
|
||||||
|
.RS 4
|
||||||
|
-Disable safe mode\. Safe mode is enabled by default, disabling it is potentially dangerous\.
|
||||||
|
+Enable safe mode\. Safe mode is disabled by default\.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\fB\-v, \-\-verbose\fR
|
110
asciidoc.spec
110
asciidoc.spec
@ -1,13 +1,17 @@
|
|||||||
Summary: Text based document generation
|
Summary: Text based document generation
|
||||||
Name: asciidoc
|
Name: asciidoc
|
||||||
Version: 8.4.5
|
Version: 8.4.5
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
# The python code does not specify a version.
|
# The python code does not specify a version.
|
||||||
# The javascript example code is GPLv2+.
|
# The javascript example code is GPLv2+.
|
||||||
License: GPL+ and GPLv2+
|
License: GPL+ and GPLv2+
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
URL: http://www.methods.co.nz/asciidoc/
|
URL: http://www.methods.co.nz/asciidoc/
|
||||||
Source0: http://www.methods.co.nz/asciidoc/%{name}-%{version}.tar.gz
|
Source0: http://www.methods.co.nz/asciidoc/%{name}-%{version}.tar.gz
|
||||||
|
# http://groups.google.com/group/asciidoc/browse_thread/thread/7f7a633c5b11ddc3
|
||||||
|
Patch0: asciidoc-8.4.5-datadir.patch
|
||||||
|
# https://bugzilla.redhat.com/506953
|
||||||
|
Patch1: asciidoc-8.4.5-use-unsafe-mode-by-default.patch
|
||||||
Requires: python >= 2.3
|
Requires: python >= 2.3
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
@ -19,55 +23,74 @@ to HTML and DocBook markups using the asciidoc(1) command.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch0 -p1 -b .datadir
|
||||||
|
%patch1 -p1 -b .use-unsafe-mode-by-default
|
||||||
|
|
||||||
|
# Fix line endings on COPYRIGHT file
|
||||||
|
sed -i "s/\r//g" COPYRIGHT
|
||||||
|
|
||||||
|
# Convert CHANGELOG and README to utf-8
|
||||||
|
for file in CHANGELOG README; do
|
||||||
|
iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
|
||||||
|
touch -r $file $file.new && \
|
||||||
|
mv $file.new $file
|
||||||
|
done
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf %{buildroot}
|
||||||
# make directory structure
|
# make directory structure
|
||||||
%{__install} -d $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/code \
|
%{__install} -d \
|
||||||
-d $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/music \
|
%{buildroot}%{_sysconfdir}/asciidoc/filters/code \
|
||||||
-d $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/source \
|
%{buildroot}%{_sysconfdir}/asciidoc/filters/graphviz \
|
||||||
-d $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/graphviz \
|
%{buildroot}%{_sysconfdir}/asciidoc/filters/music \
|
||||||
$RPM_BUILD_ROOT/%{_datadir}/asciidoc/docbook-xsl \
|
%{buildroot}%{_sysconfdir}/asciidoc/filters/source \
|
||||||
$RPM_BUILD_ROOT/%{_datadir}/asciidoc/stylesheets \
|
%{buildroot}%{_datadir}/asciidoc/docbook-xsl \
|
||||||
$RPM_BUILD_ROOT/%{_datadir}/asciidoc/javascripts \
|
%{buildroot}%{_datadir}/asciidoc/stylesheets \
|
||||||
$RPM_BUILD_ROOT/%{_datadir}/asciidoc/images/icons/callouts \
|
%{buildroot}%{_datadir}/asciidoc/javascripts \
|
||||||
$RPM_BUILD_ROOT/%{_bindir} \
|
%{buildroot}%{_datadir}/asciidoc/images/icons/callouts \
|
||||||
$RPM_BUILD_ROOT/%{_mandir}/man1
|
%{buildroot}%{_datadir}/asciidoc/filters/code \
|
||||||
|
%{buildroot}%{_datadir}/asciidoc/filters/graphviz \
|
||||||
|
%{buildroot}%{_datadir}/asciidoc/filters/music \
|
||||||
|
%{buildroot}%{_bindir} \
|
||||||
|
%{buildroot}%{_mandir}/man1
|
||||||
|
|
||||||
# real conf data goes to sysconfdir, rest goes to datadir
|
# real conf data goes to sysconfdir, rest goes to datadir
|
||||||
%{__install} -m 0644 *.conf $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc
|
%{__install} -m 0644 *.conf %{buildroot}%{_sysconfdir}/asciidoc
|
||||||
%{__install} -m 0644 filters/code/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/code/
|
for filter in code graphviz music source ; do
|
||||||
%{__install} -m 0644 filters/music/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/music/
|
%{__install} -p -m 0644 filters/$filter/*.conf \
|
||||||
%{__install} -m 0644 filters/source/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/source/
|
%{buildroot}%{_sysconfdir}/asciidoc/filters/$filter/
|
||||||
%{__install} -m 0644 filters/graphviz/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/graphviz/
|
done
|
||||||
%{__install} filters/code/*.py $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/code/
|
|
||||||
%{__install} filters/music/*.py $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/music/
|
# filter scripts
|
||||||
%{__install} filters/graphviz/*.py $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/filters/graphviz/
|
for filter in code graphviz music ; do
|
||||||
|
%{__install} -p -m 0755 filters/$filter/*.py \
|
||||||
|
%{buildroot}%{_datadir}/asciidoc/filters/$filter/
|
||||||
|
done
|
||||||
|
|
||||||
# symlinks so asciidoc works
|
# symlinks so asciidoc works
|
||||||
ln -s %{_datadir}/asciidoc/docbook-xsl $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/
|
ln -s %{_datadir}/asciidoc/docbook-xsl %{buildroot}%{_sysconfdir}/asciidoc/
|
||||||
ln -s %{_datadir}/asciidoc/stylesheets $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/
|
ln -s %{_datadir}/asciidoc/stylesheets %{buildroot}%{_sysconfdir}/asciidoc/
|
||||||
ln -s %{_datadir}/asciidoc/javascripts $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/
|
ln -s %{_datadir}/asciidoc/javascripts %{buildroot}%{_sysconfdir}/asciidoc/
|
||||||
ln -s %{_datadir}/asciidoc/images $RPM_BUILD_ROOT/%{_sysconfdir}/asciidoc/
|
ln -s %{_datadir}/asciidoc/images %{buildroot}%{_sysconfdir}/asciidoc/
|
||||||
|
|
||||||
# binaries
|
# binaries
|
||||||
%{__install} asciidoc.py $RPM_BUILD_ROOT/%{_bindir}/asciidoc
|
%{__install} -p asciidoc.py %{buildroot}%{_bindir}/asciidoc
|
||||||
%{__install} a2x $RPM_BUILD_ROOT/%{_bindir}/
|
%{__install} -p a2x %{buildroot}%{_bindir}/
|
||||||
|
|
||||||
# manpages
|
# manpages
|
||||||
%{__install} -m 0644 doc/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1
|
%{__install} -m 0644 doc/*.1 %{buildroot}%{_mandir}/man1
|
||||||
|
|
||||||
# ancillary data
|
# ancillary data
|
||||||
%{__install} -m 0644 docbook-xsl/*.xsl $RPM_BUILD_ROOT/%{_datadir}/asciidoc/docbook-xsl
|
%{__install} -p -m 0644 docbook-xsl/*.xsl %{buildroot}%{_datadir}/asciidoc/docbook-xsl
|
||||||
%{__install} -m 0644 stylesheets/*.css $RPM_BUILD_ROOT/%{_datadir}/asciidoc/stylesheets/
|
%{__install} -p -m 0644 stylesheets/*.css %{buildroot}%{_datadir}/asciidoc/stylesheets/
|
||||||
%{__install} -m 0644 javascripts/*.js $RPM_BUILD_ROOT/%{_datadir}/asciidoc/javascripts
|
%{__install} -p -m 0644 javascripts/*.js %{buildroot}%{_datadir}/asciidoc/javascripts
|
||||||
%{__install} -m 0644 images/icons/callouts/* $RPM_BUILD_ROOT/%{_datadir}/asciidoc/images/icons/callouts
|
%{__install} -p -m 0644 images/icons/callouts/* %{buildroot}%{_datadir}/asciidoc/images/icons/callouts
|
||||||
%{__install} -m 0644 images/icons/{README,*.png} $RPM_BUILD_ROOT/%{_datadir}/asciidoc/images/icons
|
%{__install} -p -m 0644 images/icons/{README,*.png} %{buildroot}%{_datadir}/asciidoc/images/icons
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,0755)
|
%defattr(-,root,root,0755)
|
||||||
@ -78,6 +101,14 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%doc README BUGS CHANGELOG COPYRIGHT
|
%doc README BUGS CHANGELOG COPYRIGHT
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Aug 13 2009 Todd Zullinger <tmz@pobox.com> - 8.4.5-3
|
||||||
|
- Use 'unsafe' mode by default (bug 506953)
|
||||||
|
- Install filter scripts in %%{_datadir}/asciidoc
|
||||||
|
- Convert spec file, CHANGELOG, and README to utf-8
|
||||||
|
- Preserve timestamps on installed files, where feasible
|
||||||
|
- s/$RPM_BUILD_ROOT/%%{buildroot} and drop duplicated /'s
|
||||||
|
- Fix rpmlint mixed-use-of-spaces-and-tabs and end-of-line-encoding warnings
|
||||||
|
|
||||||
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-2
|
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||||
|
|
||||||
@ -124,19 +155,18 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
- use _datadir
|
- use _datadir
|
||||||
- use config and _sysconfdir
|
- use config and _sysconfdir
|
||||||
|
|
||||||
* Wed Jun 29 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.1-1
|
* Wed Jun 29 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.1-1
|
||||||
|
|
||||||
- 7.0.1
|
- 7.0.1
|
||||||
- Drop patch now upstream
|
- Drop patch now upstream
|
||||||
- Build as noarch (Petr KlÃma)
|
- Build as noarch (Petr Klíma)
|
||||||
|
|
||||||
* Sat Jun 11 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.3
|
* Sat Jun 11 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.3
|
||||||
- Add include patch
|
- Add include patch
|
||||||
|
|
||||||
* Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.2
|
* Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.2
|
||||||
- Fix stylesheets according to Stuart
|
- Fix stylesheets according to Stuart
|
||||||
|
|
||||||
* Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.1
|
* Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.1
|
||||||
- Initial package
|
- Initial package
|
||||||
- Based on Debian package, thx!
|
- Based on Debian package, thx!
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user